Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 399 → Rev 398

/branches/BR-0.4/basico/widgets/wdg_annot.py
7,7 → 7,6
# Description: Annotation Widget
"""
 
import os
import html
import gi
gi.require_version('Gtk', '3.0')
41,29 → 40,6
self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
self.toolbar.set_property('margin-bottom', 0)
 
# Annotation icon
tool = self.srvgui.add_widget('gtk_tool_annotation_icon', Gtk.ToolItem())
box = self.srvgui.add_widget('gtk_box_annotation_icon', Gtk.Box())
tool.add(box)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.toolbar.insert(tool, -1)
 
# Title
tool = Gtk.ToolItem()
# ~ vbox = Gtk.VBox()
title = self.srvgui.add_widget('gtk_label_annotation_sid', Gtk.Label())
title.set_selectable(True)
if self.sid == '0000000000':
title.set_markup('<small><b>Annotation</b></small>')
else:
title.set_markup('<small><b>Annotation for SAP Note %s</b></small>' % str(int(self.sid)))
title.set_xalign(0.5)
tool.add(title)
self.toolbar.insert(tool, -1)
 
# Task Category button
tool = Gtk.ToolItem()
a_category_model = Gtk.ListStore(Pixbuf, str)
159,7 → 135,7
# Is template?
hbox = Gtk.HBox()
tool = Gtk.ToolItem()
icon = self.srvicm.get_new_image_icon('basico-annotation-type-template', 18, 18)
icon = self.srvicm.get_new_image_icon('basico-annotation-type-template')
switch = self.srvgui.add_widget('gtk_switch_annotation_template', Gtk.ToggleButton())
# ~ switch.connect('state-set', callback)
label = Gtk.Label()
183,10 → 159,23
tool.connect('clicked', self.srvclb.gui_attachment_add_to_annotation)
self.toolbar.insert(tool, -1)
 
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, True)
self.toolbar.insert(tool, -1)
 
# Title
tool = Gtk.ToolItem()
# ~ vbox = Gtk.VBox()
title = self.srvgui.add_widget('gtk_label_annotation_sid', Gtk.Label())
title.set_selectable(True)
if self.sid == '0000000000':
title.set_markup('<small><b>Annotation</b></small>')
else:
title.set_markup('<small><b>Annotation for SAP Note %s</b></small>' % str(int(self.sid)))
title.set_xalign(0.5)
# ~ vbox.pack_start(title, False, False, 3)
 
# Timestamp created
tool = Gtk.ToolItem()
tool.set_expand(False)
211,9 → 200,6
 
# Annotation Stack Switcher
tool = Gtk.ToolItem()
tool.set_is_important(True)
tool.set_visible_vertical(True)
tool.set_visible_horizontal(True)
stack_switcher = self.srvgui.add_widget('stack_switcher_annotation', Gtk.StackSwitcher())
stack_switcher.set_property('icon-size', 3)
stack = self.srvgui.add_widget('stack_annotation', Gtk.Stack())
227,10 → 213,6
 
# Arrow UP
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_previous_item', Gtk.ToolButton())
tool.set_expand(False)
tool.set_visible_horizontal(True)
tool.set_visible_vertical(True)
tool.set_is_important(True)
tool.set_tooltip_markup('<b>Previous annotation</b>')
tool.set_icon_name('basico-arrow-up')
tool.connect('clicked', self.srvclb.gui_annotation_previous_row)
238,10 → 220,6
 
# Arrow DOWN
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_next_item', Gtk.ToolButton())
tool.set_visible_vertical(True)
tool.set_visible_horizontal(True)
tool.set_is_important(True)
tool.set_expand(False)
tool.set_tooltip_markup('<b>Next annotation</b>')
tool.set_icon_name('basico-arrow-down')
tool.connect('clicked', self.srvclb.gui_annotation_next_row)
375,8 → 353,6
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', False)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', False)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', True)
elif stack_name == 'properties':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', False)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', False)
383,8 → 359,6
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', False)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', False)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', False)
elif stack_name == 'editor':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', True)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', True)
391,8 → 365,6
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', True)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', True)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', True)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', True)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', False)
 
 
def widget_annotation_preview(self):
605,21 → 577,19
self.set_aid_to_widget(aid)
sid = self.srvant.get_sid(aid)
title = self.srvgui.get_widget('gtk_label_annotation_sid')
# ~ if sid == '0000000000':
# ~ title.set_markup('<big><b>Annotation</b></big>')
if sid == '0000000000':
title.set_markup('<big><b>Annotation</b></big>')
self.srvuif.statusbar_msg("Creating new annotation")
else:
title.set_markup('<big><b>Annotation for SAP Note %s</b></big>' % str(int(sid)))
self.srvuif.statusbar_msg("Creating/Editing new annotation for SAP Note %s" % str(int(sid)))
 
# ~ else:
# ~ title.set_markup('<big><b>Annotation for SAP Note %s</b></big>' % str(int(sid)))
 
 
if action == 'create':
self.srvuif.statusbar_msg("Creating new annotation")
elif action == 'edit' or action == 'preview':
self.srvuif.statusbar_msg("Creating/Editing new annotation for SAP Note %s" % str(int(sid)))
pass
elif action == 'edit':
annotation = self.srvant.get_metadata_from_aid(aid)
if annotation is not None:
ANNOTATION_FILE_CONTENT = LPATH['ANNOTATIONS'] + aid + '.adoc'
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_title = self.srvgui.get_widget('gtk_entry_annotation_title')
635,10 → 605,7
a_wdg_link_button = self.srvgui.get_widget('gtk_link_button_annotation_link')
a_wdg_link_type = self.srvgui.get_widget('gtk_combobox_annotation_link_type')
 
title.set_markup("<big><b>%s - %s</b></big>" % (annotation['Type'], annotation['Title']))
a_wdg_aid.set_text(annotation['AID'])
icon = self.srvicm.get_new_image_icon('basico-annotation-type-%s' % annotation['Type'].lower())
self.srvgui.swap_widget(a_wdg_icon, icon)
a_wdg_timestamp.set_text(annotation['Timestamp'])
a_wdg_title.set_text(html.escape(annotation['Title']))
 
671,6 → 638,8
human_timestamp = self.srvutl.get_human_date_from_timestamp(annotation['Timestamp'])
a_wdg_human_timestamp.set_markup('<b>%s</b>' % human_timestamp)
a_wdg_timestamp_created.set_text(annotation['Created'])
# ~ self.stack_changed()
# ~ self.preview()
 
 
def get_metadata_from_widget(self):
762,24 → 731,9
if len(alink) > 0:
browser.load_url(alink)
else:
tpath = self.srvacd.get_target_path(aid)
if not os.path.exists(tpath):
target = self.srvacd.generate_preview(aid)
else:
spath = self.srvacd.get_source_path(aid)
smtime = self.srvutl.get_file_modification_date(spath)
tmtime = self.srvutl.get_file_modification_date(tpath)
# ~ self.log.debug("%s; %s", spath, smtime)
# ~ self.log.debug("%s; %s", tpath, tmtime)
if tmtime < smtime:
target = self.srvacd.generate_preview(aid)
self.log.debug("Preview generated")
else:
target = "file://" + tpath
self.log.debug("Using cache for preview")
target = self.srvacd.generate_preview(aid)
browser.load_url(html.escape(target))
except Exception as error:
self.log.error(error)
except:
self.log.debug("Showing editor instead preview")
stack_annotation = self.srvgui.get_widget('stack_annotation')
self.set_visible_stack('editor')
804,6 → 758,5
else:
entry.set_text(scope_text)
 
 
def product_activated(self, entry):
pass
/branches/BR-0.4/basico/widgets/wdg_visor_annotations.py
74,9 → 74,12
self.srvgui.set_key_value('ANNOTATIONS_PRIORITY_%s_VISIBLE' % priority.upper(), True)
 
 
def get_treeview(self):
return self.treeview
 
 
def sort_by_timestamp(self):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
sorted_model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
self.sorted_model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
 
 
def setup_panel(self):
277,13 → 280,13
scr.set_hexpand(True)
scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scr.set_shadow_type(Gtk.ShadowType.IN)
treeview = self.srvgui.add_widget('visor_annotation_treeview', Gtk.TreeView())
scr.add(treeview)
self.treeview = Gtk.TreeView()
scr.add(self.treeview)
scr.set_hexpand(True)
self.pack_start(scr, True, True, 0)
 
# Setup model
model = Gtk.TreeStore(
self.model = Gtk.ListStore(
str, # Annotation Id
Pixbuf, # Icon
int, # checkbox
298,7 → 301,7
str, # Annotation created
str, # Timestamp created
)
self.srvgui.add_widget('gtk_model_annotation', model)
self.srvgui.add_widget('gtk_model_annotation', self.model)
 
# Setup columns
def get_column_header_widget(title, icon_name=None, width=28, height=28):
319,7 → 322,7
self.column_key.set_expand(False)
self.column_key.set_clickable(False)
self.column_key.set_sort_indicator(True)
treeview.append_column(self.column_key)
self.treeview.append_column(self.column_key)
 
# Annotation Icon
self.renderer_icon = Gtk.CellRendererPixbuf()
332,7 → 335,7
self.column_icon.set_clickable(True)
self.column_icon.set_sort_indicator(True)
self.column_icon.set_sort_column_id(7)
treeview.append_column(self.column_icon)
self.treeview.append_column(self.column_icon)
 
# Annotation Checkbox
self.renderer_checkbox = Gtk.CellRendererToggle()
347,7 → 350,7
# ~ self.column_checkbox.set_sort_indicator(True)
# ~ self.column_checkbox.set_sort_column_id(2)
self.column_checkbox.set_property('spacing', 50)
treeview.append_column(self.column_checkbox)
self.treeview.append_column(self.column_checkbox)
 
# Annotation Id
self.renderer_sid = Gtk.CellRendererText()
363,7 → 366,7
self.column_sid.set_clickable(True)
self.column_sid.set_sort_indicator(True)
self.column_sid.set_sort_column_id(0)
treeview.append_column(self.column_sid)
self.treeview.append_column(self.column_sid)
 
# Annotation title
self.renderer_title = Gtk.CellRendererText()
371,7 → 374,6
self.renderer_title.set_property('ellipsize', Pango.EllipsizeMode.MIDDLE)
self.column_title = Gtk.TreeViewColumn('Title', self.renderer_title, markup=4)
widget = get_column_header_widget('Title', 'basico-tag')
# ~ widget.connect('button_press_event', self.header_right_click)
self.column_title.set_widget(widget)
self.column_title.set_visible(True)
self.column_title.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
379,7 → 381,7
self.column_title.set_clickable(True)
self.column_title.set_sort_indicator(True)
self.column_title.set_sort_column_id(4)
treeview.append_column(self.column_title)
self.treeview.append_column(self.column_title)
 
# Annotation Component
self.renderer_component = Gtk.CellRendererText()
393,7 → 395,7
self.column_component.set_clickable(True)
self.column_component.set_sort_indicator(True)
self.column_component.set_sort_column_id(5)
treeview.append_column(self.column_component)
self.treeview.append_column(self.column_component)
 
# Annotation Scope
self.renderer_scope = Gtk.CellRendererText()
407,7 → 409,7
self.column_scope.set_clickable(True)
self.column_scope.set_sort_indicator(True)
self.column_scope.set_sort_column_id(6)
treeview.append_column(self.column_scope)
self.treeview.append_column(self.column_scope)
 
# Annotation Product
self.renderer_type = Gtk.CellRendererText()
422,7 → 424,7
self.column_type.set_clickable(True)
self.column_type.set_sort_indicator(True)
self.column_type.set_sort_column_id(7)
treeview.append_column(self.column_type)
self.treeview.append_column(self.column_type)
 
# Annotation Priority
self.renderer_priority = Gtk.CellRendererText()
435,7 → 437,7
self.column_priority.set_clickable(True)
self.column_priority.set_sort_indicator(True)
self.column_priority.set_sort_column_id(8)
treeview.append_column(self.column_priority)
self.treeview.append_column(self.column_priority)
 
# Annotation Updated On
self.renderer_updated = Gtk.CellRendererText()
450,8 → 452,8
self.column_updated.set_sort_indicator(True)
self.column_updated.set_sort_column_id(10)
self.column_updated.set_sort_order(Gtk.SortType.DESCENDING)
model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
treeview.append_column(self.column_updated)
self.model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
self.treeview.append_column(self.column_updated)
 
# Timestamp updated
self.renderer_timestamp_updated = Gtk.CellRendererText()
462,7 → 464,7
self.column_timestamp_updated.set_sort_indicator(True)
self.column_timestamp_updated.set_sort_column_id(10)
self.column_timestamp_updated.set_sort_order(Gtk.SortType.ASCENDING)
treeview.append_column(self.column_timestamp_updated)
self.treeview.append_column(self.column_timestamp_updated)
 
# Annotation Created On
self.renderer_created = Gtk.CellRendererText()
477,8 → 479,8
self.column_created.set_sort_indicator(True)
self.column_created.set_sort_column_id(12)
self.column_created.set_sort_order(Gtk.SortType.DESCENDING)
model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
treeview.append_column(self.column_created)
self.model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
self.treeview.append_column(self.column_created)
 
# Timestamp
self.renderer_timestamp_created = Gtk.CellRendererText()
489,20 → 491,20
self.column_timestamp_created.set_sort_indicator(True)
self.column_timestamp_created.set_sort_column_id(12)
self.column_timestamp_created.set_sort_order(Gtk.SortType.ASCENDING)
treeview.append_column(self.column_timestamp_created)
self.treeview.append_column(self.column_timestamp_created)
 
# Treeview properties
treeview.set_can_focus(False)
treeview.set_enable_tree_lines(True)
treeview.set_headers_visible(True)
treeview.set_enable_search(True)
treeview.set_hover_selection(False)
treeview.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
treeview.set_enable_tree_lines(True)
treeview.set_level_indentation(10)
treeview.connect('button_press_event', self.row_right_click)
self.treeview.set_can_focus(False)
self.treeview.set_enable_tree_lines(True)
self.treeview.set_headers_visible(True)
self.treeview.set_enable_search(True)
self.treeview.set_hover_selection(False)
self.treeview.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
self.treeview.set_enable_tree_lines(True)
self.treeview.set_level_indentation(10)
self.treeview.connect('button_press_event', self.row_right_click)
 
treeview.modify_font(Pango.FontDescription('Monospace 9'))
self.treeview.modify_font(Pango.FontDescription('Monospace 9'))
 
# DOC: In order to have a Gtk.Widged with sorting and filtering
# capabilities, you have to filter the model first, and use this
510,25 → 512,24
# model to the treeview...
 
# Treeview filtering:
visible_filter = self.srvgui.add_widget('visor_annotation_filter', model.filter_new())
visible_filter.set_visible_func(self.visible_function)
self.visible_filter = self.model.filter_new()
self.visible_filter.set_visible_func(self.visible_function)
 
# TreeView sorting
sorted_model = Gtk.TreeModelSort(model=visible_filter)
self.srvgui.add_widget('visor_annotation_sorted_model', sorted_model)
# ~ self.sorted_model.set_sort_func(0, self.sort_function, None)
self.sorted_model = Gtk.TreeModelSort(model=self.visible_filter)
self.sorted_model.set_sort_func(0, self.sort_function, None)
 
# Selection
selection = treeview.get_selection()
selection.set_mode(Gtk.SelectionMode.SINGLE)
selection.connect('changed', self.row_changed)
self.selection = self.treeview.get_selection()
self.selection.set_mode(Gtk.SelectionMode.SINGLE)
self.selection.connect('changed', self.row_changed)
 
# Set model (filtered and sorted)
sorted_model.set_sort_column_id(9, Gtk.SortType.ASCENDING)
treeview.set_model(sorted_model)
self.sorted_model.set_sort_column_id(9, Gtk.SortType.ASCENDING)
self.treeview.set_model(self.sorted_model)
 
# Other signals
treeview.connect('row-activated', self.row_double_click)
self.treeview.connect('row-activated', self.row_double_click)
 
self.show_all()
 
583,11 → 584,10
 
 
def update_total_annotations_count(self):
visible_filter = self.srvgui.get_widget('visor_annotation_filter')
statusbar = self.srvgui.get_widget('widget_statusbar')
lblnotescount = self.srvgui.get_widget('gtk_label_total_notes')
total = self.srvant.get_total()
count = len(visible_filter)
count = len(self.visible_filter)
lblnotescount.set_markup("<b>%d/<big>%d annotations</big></b>" % (count, total))
msg = 'View populated with %d annotations' % count
self.srvuif.statusbar_msg(msg)
598,15 → 598,13
 
 
def row_current(self, *args):
treeview = self.srvgui.get_widget('visor_annotation_treeview')
selection = treeview.get_selection()
selection = self.treeview.get_selection()
model, treeiter = selection.get_selected()
return treeiter
 
 
def row_previous(self, *args):
treeview = self.srvgui.get_widget('visor_annotation_treeview')
selection = treeview.get_selection()
selection = self.treeview.get_selection()
model, iter_current = selection.get_selected()
if iter_current is not None:
iter_previous = model.iter_previous(iter_current)
617,30 → 615,28
 
 
def row_next(self, *args):
treeview = self.srvgui.get_widget('visor_annotation_treeview')
selection = treeview.get_selection()
selection = self.treeview.get_selection()
model, iter_current = selection.get_selected()
if iter_current is not None:
iter_next = model.iter_next(iter_current)
if iter_next:
selection.select_iter(iter_next)
path, col = treeview.get_cursor()
path, col = self.treeview.get_cursor()
row = self.srvuif.tree_path_to_row(path)
treeview.scroll_to_cell(row, column=None, use_align=False, row_align=0.5, col_align=0)
self.treeview.scroll_to_cell(row, column=None, use_align=False, row_align=0.5, col_align=0)
widget_annotation = self.srvgui.get_widget('widget_annotation')
widget_annotation.preview()
 
 
def rows_toggled(self):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
selected = []
 
def get_selected_sapnotes(model, path, itr):
aid = sorted_model.get(itr, 0)[0]
checked = sorted_model.get(itr, 2)[0]
aid = self.sorted_model.get(itr, 0)[0]
checked = self.sorted_model.get(itr, 2)[0]
if checked:
selected.append(str(aid))
sorted_model.foreach(get_selected_sapnotes)
self.sorted_model.foreach(get_selected_sapnotes)
 
return selected
 
674,10 → 670,9
 
 
def toggle_checkbox(self, cell, path):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
model = sorted_model.get_model()
rpath = sorted_model.convert_path_to_child_path(Gtk.TreePath(path))
model[rpath][2] = not model[rpath][2]
model = self.sorted_model.get_model()
# ~ path = model.convert_path_to_child_path(Gtk.TreePath(path))
model[path][2] = not model[path][2]
 
 
def get_node(self, key, icon, checkbox, sid, title, component, scope='', sntype='', priority='', updated='', ts_updated='', created='', ts_created=''):
718,10 → 713,6
 
 
def populate(self, annotations=None):
treeview = self.srvgui.get_widget('visor_annotation_treeview')
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
model = self.srvgui.get_widget('gtk_model_annotation')
# ~ model = sorted_model.get_model()
self.column_sid.set_visible(False)
# ~ self.column_checkbox.set_visible(True)
# ~ self.column_category.set_visible(True)
730,8 → 721,8
completion_model = completion.get_model()
completion_model.clear()
 
treeview.set_model(None)
model.clear()
self.treeview.set_model(None)
self.model.clear()
 
if annotations is None:
annotations = self.get_bag()
827,14 → 818,13
except Exception as error:
# Whenever an annotation is deleted, after reloading
# the view, it fails. Then, skip it
# ~ self.log.error("Annotation: %s", fname)
# ~ self.log.error(error)
pass
self.log.error("Annotation: %s", fname)
self.log.error(error)
 
for node in nodes:
model.append(None, node)
self.model.append(node)
 
treeview.set_model(sorted_model)
self.treeview.set_model(self.sorted_model)
self.sort_by_timestamp()
# ~ self.set_bag(bag)
self.update_panel_values()
882,16 → 872,12
# ~ dialog.destroy()
# ~ #FIXME: create an empty file for contents
 
def header_right_click(self, *args):
self.log.debug(args)
 
def row_right_click(self, treeview, event, data=None):
treeview = self.srvgui.get_widget('visor_annotation_treeview')
if event.button == 3:
rect = Gdk.Rectangle()
rect.x = x = int(event.x)
rect.y = y = int(event.y)
pthinfo = treeview.get_path_at_pos(x,y)
pthinfo = self.treeview.get_path_at_pos(x,y)
if pthinfo is not None:
path,col,cellx,celly = pthinfo
model = treeview.get_model()
997,7 → 983,6
 
 
def select_all(self, button, checked):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
def check_row(model, path, itr):
# ~ model[path][2] = not model[path][2]
if checked is not None:
1006,7 → 991,7
state = model[path][2]
model[path][2] = not state
 
model = sorted_model.get_model()
model = self.sorted_model.get_model()
model.foreach(check_row)
self.srvuif.grab_focus()
 
1085,13 → 1070,12
self.update_products()
 
def update_scopes(self):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
scopes = set()
 
def get_values(model, path, itr):
scope = sorted_model.get(itr, 6)[0]
scope = self.sorted_model.get(itr, 6)[0]
scopes.add(scope)
sorted_model.foreach(get_values)
self.sorted_model.foreach(get_values)
 
# Update scope combo
cmb_scope = self.srvgui.get_widget('gtk_combobox_filter_scope')
1112,13 → 1096,12
 
 
def update_products(self):
sorted_model = self.srvgui.get_widget('visor_annotation_sorted_model')
products = set()
 
def get_values(model, path, itr):
product = sorted_model.get(itr, 7)[0]
product = self.sorted_model.get(itr, 7)[0]
products.add(product)
sorted_model.foreach(get_values)
self.sorted_model.foreach(get_values)
 
# Update product combo
cmb_product = self.srvgui.get_widget('gtk_combobox_filter_product')
1139,7 → 1122,7
 
 
def clb_scope_changed(self, *args):
visible_filter = self.srvgui.get_widget('visor_annotation_filter')
visible_filter = self.get_visible_filter()
visible_filter.refilter()
self.update_total_annotations_count()
self.update_products()
1146,7 → 1129,7
 
 
def product_changed(self, *args):
visible_filter = self.srvgui.get_widget('visor_annotation_filter')
visible_filter = self.get_visible_filter()
visible_filter.refilter()
self.update_total_annotations_count()
self.update_scopes()
/branches/BR-0.4/basico/services/srv_asciidoctor.py
37,18 → 37,6
self.srvutl = self.get_service('Utils')
 
 
def get_target_path(self, aid):
source = self.get_source_path(aid)
target_dir = LPATH['CACHE_HTML']
target_file = os.path.basename(source).replace('.adoc', '.html')
path = os.path.join(target_dir, target_file)
return path
 
 
def get_source_path(self, aid):
return self.srvant.get_content_file(aid)
 
 
def generate_preview(self, aid):
adocprops = ''
for prop in ADOCPROPS:
/branches/BR-0.4/basico/services/srv_utils.py
182,14 → 182,6
return timestamp
 
 
def get_file_modification_date(self, filename):
"""
Get modification datetime for a given filename.
"""
t = os.path.getmtime(filename)
return datetime.fromtimestamp(t)
 
 
def get_datetime(self, timestamp):
"""
Missing method docstring (missing-docstring)