Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 407 → Rev 408

/branches/BR-0.4/basico/services/srv_annotations.py
107,6 → 107,7
 
 
def update(self, annotation):
self.log.debug(annotation)
ANNOTATION_FILE_METADATA = LPATH['ANNOTATIONS'] + annotation['AID'] + '.json'
ANNOTATION_FILE_CONTENT = LPATH['ANNOTATIONS'] + annotation['AID'] + '.adoc'
 
207,7 → 208,7
valid = os.path.exists(ANNOTATION_FILE)
if valid is False:
self.log.debug("Annotation %s is not valid or it doesn't exist yet." % aid)
 
# ~ self.log.debug("Annotation valid? %s", valid)
return valid
 
 
/branches/BR-0.4/basico/services/srv_callbacks.py
549,7 → 549,7
 
if visible_stack_name == 'visor-sapnotes':
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
visible_filter = visor_sapnotes.get_visible_filter()
visible_filter = self.srvgui.get_widget('visor_sapnotes_visible_filter')
visible_filter.refilter()
visor_sapnotes.update_total_sapnotes_count()
elif visible_stack_name == 'visor-annotations':
672,6 → 672,17
self.srvuif.grab_focus()
 
 
def action_annotation_save(self):
widget_annotation = self.srvgui.get_widget('widget_annotation')
aid = widget_annotation.get_aid_from_widget()
annotation = widget_annotation.get_metadata_from_widget()
 
if self.srvant.is_valid(aid):
self.srvant.update(annotation)
title = self.srvant.get_title(aid)
self.srvuif.statusbar_msg("Updated annotation: %s" % title, True)
 
 
def action_annotation_cancel(self, *args):
statusbar = self.srvgui.get_widget('widget_statusbar')
widget_annotation = self.srvgui.get_widget('widget_annotation')
/branches/BR-0.4/basico/services/srv_gui.py
61,7 → 61,6
def on_key_press_event(self, widget, event):
if Gdk.keyval_name(event.keyval) == 'Escape':
self.srvclb.action_annotation_cancel()
self.log.debug(" Key val, name: %s - %s", event.keyval, Gdk.keyval_name(event.keyval))
 
 
def get_services(self):
/branches/BR-0.4/basico/widgets/wdg_annot.py
321,9 → 321,7
def on_key_press_event(self, widget, event):
if Gdk.keyval_name(event.keyval) == 'Escape':
self.srvclb.action_annotation_cancel()
self.log.debug(" Key val, name: %s - %s", event.keyval, Gdk.keyval_name(event.keyval))
 
 
def __setup_header(self):
# Annotation Header
container = self.srvgui.get_widget('gtk_vbox_annotation_container')
638,6 → 636,7
a_wdg_icon = self.srvgui.get_widget('gtk_box_annotation_icon')
a_wdg_aid = self.srvgui.get_widget('gtk_label_aid')
a_wdg_timestamp = self.srvgui.get_widget('gtk_label_timestamp')
# ~ a_wdg_timestamp_created = self.srvgui.get_widget('gtk_label_timestamp_created')
a_wdg_title = self.srvgui.get_widget('gtk_entry_annotation_title')
a_wdg_type = self.srvgui.get_widget('gtk_combobox_annotation_type')
a_wdg_category = self.srvgui.get_widget('gtk_combobox_annotation_category')
760,7 → 759,9
 
 
def preview(self):
aid = self.get_aid_from_widget()
visor_annotations = self.srvgui.get_widget('visor_annotations')
aid = visor_annotations.row_current()
# ~ aid = self.get_aid_from_widget()
# ~ self.log.debug("Previewing aid: %s", aid)
if len(aid) == 0:
return
789,10 → 790,10
# ~ self.log.debug("%s; %s", tpath, tmtime)
if tmtime < smtime:
target = self.srvacd.generate_preview(aid)
# ~ self.log.debug("Preview generated")
self.log.debug("Preview generated")
else:
target = "file://" + tpath
# ~ self.log.debug("Using cache for preview")
self.log.debug("Using cache for preview")
browser.load_url(html.escape(target))
except Exception as error:
self.log.error(error)
/branches/BR-0.4/basico/widgets/wdg_visor_annotations.py
630,7 → 630,12
treeview = self.srvgui.get_widget('visor_annotation_treeview')
selection = treeview.get_selection()
model, treeiter = selection.get_selected()
return treeiter
if treeiter is not None:
aid = model.get(treeiter, 0)[0]
# ~ self.log.debug(aid)
else:
aid = ''
return aid
 
 
def row_previous(self, *args):
/branches/BR-0.4/basico/widgets/wdg_visor_sapnotes.py
775,13 → 775,13
 
 
def get_filtered_bag(self):
clean_html = self.srvutl.clean_html
sorted_model = self.srvgui.get_widget('visor_sapnotes_sorted_model')
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
selected = []
 
def get_selected_sapnotes(model, path, itr):
sid = model.get(itr, COLUMN.SID)[0]
self.log.debug(sid)
sid = clean_html(model.get(itr, COLUMN.SID)[0])
if len(escape(sid)) > 0:
selected.append(str(sid))