bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=task_data["donedate"]) task.set_title(task_data["title"]) task.set_due_date(task_data["duedate"]) task.set_start_date(task_data["startdat... | def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=dates.strtodate(task_data["donedate"])) task.set_title(task_data["title"]) task.set_due_date(task_data["duedate"]) task.set_start_date(ta... | 463,600 |
def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=task_data["donedate"]) task.set_title(task_data["title"]) task.set_due_date(task_data["duedate"]) task.set_start_date(task_data["startdat... | def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=task_data["donedate"]) task.set_title(task_data["title"]) task.set_due_date(dates.strtodate(task_data["duedate"])) task.set_start_date(da... | 463,601 |
def export_generate(self): #Template loading and cutting if self.export_all_active.get_active(): #Export the active tasks in the current view (the ones visible in # the Task Browser model = self.plugin_api.get_task_modelsort() tasks_str = self.treemodel_to_TaskStr(model, model.get_iter_first()) elif self.export_finishe... | def export_generate(self): #Template loading and cutting if self.export_all_active.get_active(): #Export the active tasks in the current view (the ones visible in # the Task Browser model = self.plugin_api.get_task_modelsort() tasks_str = self.treemodel_to_TaskStr(model, model.get_iter_first()) elif self.export_finishe... | 463,602 |
def get_canonical_date(self, arg): """ Transform "arg" in a valid yyyy-mm-dd date or return None. "arg" can be a yyyy-mm-dd, yyyymmdd, mmdd, today, next week, next month, next year, or a weekday name. """ day_names_en = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] day_names = [_("monda... | def get_canonical_date(self, arg): """ Transform "arg" in a valid yyyy-mm-dd date or return None. "arg" can be a yyyy-mm-dd, yyyymmdd, mmdd, today, next week, next month, next year, or a weekday name. """ day_names_en = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] day_names = [_("monda... | 463,603 |
def get_canonical_date(self, arg): """ Transform "arg" in a valid yyyy-mm-dd date or return None. "arg" can be a yyyy-mm-dd, yyyymmdd, mmdd, today, next week, next month, next year, or a weekday name. """ day_names_en = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] day_names = [_("monda... | def get_canonical_date(self, arg): """ Transform "arg" in a valid yyyy-mm-dd date or return None. "arg" can be a yyyy-mm-dd, yyyymmdd, mmdd, today, next week, next month, next year, or a weekday name. """ day_names_en = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] day_names = [_("monda... | 463,604 |
def test_get_canonical_date(self): ''' Tests for "get_canonical_date" ''' known_values = (("1985-03-29", "1985-03-29"), ("now", _("now")), ("soon", _("soon")), ("later", _("later"), ("", "")) for value, result in known_values: date = get_canonical_date(value) self.assertEqual(date.__str__(), result) | def test_get_canonical_date(self): ''' Tests for "get_canonical_date" ''' known_values = (("1985-03-29", "1985-03-29"), ("now", _("now")), ("soon", _("soon")), ("later", _("later")), ("", "")) for value, result in known_values: date = get_canonical_date(value) self.assertEqual(date.__str__(), result) | 463,605 |
def _detect_tag(self,buff,start,end) : # Removing already existing tag in the current selection # out of the tag table it = start.copy() table = buff.get_tag_table() old_tags = [] new_tags = [] #We must be strictly < than the end_offset. If not, we might #find the beginning of a tag on the nextline while (it.get_offset... | def _detect_tag(self,buff,start,end) : # Removing already existing tag in the current selection # out of the tag table it = start.copy() table = buff.get_tag_table() old_tags = [] new_tags = [] #We must be strictly < than the end_offset. If not, we might #find the beginning of a tag on the nextline while (it.get_offset... | 463,606 |
def on_get_iter(self, path): | def on_get_iter(self, path): | 463,607 |
def on_iter_next(self, node): | def on_iter_next(self, node): | 463,608 |
def on_iter_next(self, node): | def on_iter_next(self, node): | 463,609 |
def on_iter_next(self, node): | def on_iter_next(self, node): | 463,610 |
def on_iter_next(self, node): | def on_iter_next(self, node): | 463,611 |
def on_iter_parent(self, node): | def on_iter_parent(self, node): | 463,612 |
def _get_id(self): if hasattr(self.task, 'task'): if type(self.task.task) != list: return self.task.task.id else: return self.task.task[0].id else: return self.task.id | def _get_id(self): if hasattr(self.task, 'task'): if type(self.task.task) != list: return self.task.task.id else: return self.task.task[0].id else: return self.task.id | 463,613 |
def _get_status(self): if hasattr(self.task, 'task'): return self.get_proxy()._rtm_to_gtg_status[self.task.task.completed\ == ""] else: return self.get_proxy()._rtm_to_gtg_status[self.task.completed == ""] | def _get_status(self): if hasattr(self.task, 'task'): return self.get_proxy()._rtm_to_gtg_status[self.task.task.completed\ == ""] else: return self.get_proxy()._rtm_to_gtg_status[self.task.completed == ""] | 463,614 |
def get_task_ids_filtered(self, filters): """ Filters the task list and provides list of remaining ids @param: List of strings for filters to apply. See the filters_bank documentation for a list of stock filters. @return: List of ids """ tree = self.req.get_custom_tasks_tree() for filter in filters: if filter[0] == '... | def get_task_ids_filtered(self, filters): """ Filters the task list and provides list of remaining ids @param: List of strings for filters to apply. See the filters_bank documentation for a list of stock filters. @return: List of ids """ tree = self.req.get_tasks_tree() for filter in filters: if filter[0] == '!': tre... | 463,615 |
def get_task_ids_filtered(self, filters): """ Filters the task list and provides list of remaining ids @param: List of strings for filters to apply. See the filters_bank documentation for a list of stock filters. @return: List of ids """ tree = self.req.get_custom_tasks_tree() for filter in filters: if filter[0] == '... | def get_task_ids_filtered(self, filters): """ Filters the task list and provides list of remaining ids @param: List of strings for filters to apply. See the filters_bank documentation for a list of stock filters. @return: List of ids """ tree = self.req.get_custom_tasks_tree() for filter in filters: if filter[0] == '... | 463,616 |
def __init__(self, taskbrowser): """Constructor.""" # store references to some objects widgets = { 'dialog': 'PreferencesDialog', 'backend_tree': 'BackendTree', 'plugin_tree': 'PluginTree', 'plugin_about_dialog': 'PluginAboutDialog', 'plugin_configure': 'plugin_configure', 'plugin_depends': 'PluginDepends' 'plugin_conf... | def __init__(self, taskbrowser): """Constructor.""" # store references to some objects widgets = { 'dialog': 'PreferencesDialog', 'backend_tree': 'BackendTree', 'plugin_tree': 'PluginTree', 'plugin_about_dialog': 'PluginAboutDialog', 'plugin_configure': 'plugin_configure', 'plugin_depends': 'PluginDepends', 'plugin_con... | 463,617 |
def _refresh_backend_store(self): """Populate a gtk.ListStore with backend information.""" # create and clear a gtk.ListStore for backend information if not hasattr(self, 'backend_store'): # TODO: create the liststore. It should have one column for each # backend. backends [str] self.backend_store = gtk.ListStore(str) ... | def _refresh_backend_store(self): """Populate a gtk.ListStore with backend information.""" # create and clear a gtk.ListStore for backend information if not hasattr(self, 'backend_store'): # TODO: create the liststore. It should have one column for each # backend. self.backend_store = gtk.ListStore(str) self.backend_s... | 463,618 |
def get_signals_dict(self): """A dictionary of signals and functions to be connected.""" SIGNAL_CONNECTIONS_DIC = { 'on_preferences_activate': self.activate, # buttons in the dialog itself 'on_prefs_close': self.on_close, 'on_prefs_help': self.on_help, # preferences on the Tasks tab 'on_pref_show_preview_toggled': self... | def get_signals_dict(self): """A dictionary of signals and functions to be connected.""" SIGNAL_CONNECTIONS_DIC = { 'on_preferences_activate': self.activate, # buttons in the dialog itself 'on_prefs_close': self.on_close, 'on_prefs_help': self.on_help, # preferences on the Tasks tab 'on_pref_show_preview_toggled': self... | 463,619 |
def on_plugin_about_close(self, widget): """Close the PluginAboutDialog.""" self.plugin_about_dialog.hide() | def on_plugin_about_close(self, widget, *args): """Close the PluginAboutDialog.""" self.plugin_about_dialog.hide() | 463,620 |
def __init__(self,tree,filtersbank,refresh=True): """ Construct a FilteredTree object on top of an existing task tree. @param req: The requestor object @param tree: The tree to filter from @param maintree: Whether this tree is the main tree. The requester must be used to change filters against the main tree. """ self.... | def __init__(self,tree,filtersbank,refresh=True): """ Construct a FilteredTree object on top of an existing task tree. @param req: The requestor object @param tree: The tree to filter from @param maintree: Whether this tree is the main tree. The requester must be used to change filters against the main tree. """ self.... | 463,621 |
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self... | def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self... | 463,622 |
def update_buttons_sensitivity(self): enable = self.selection.count_selected_rows() + \ self.closed_selection.count_selected_rows() > 0 self.edit_mi.set_sensitive(enable) self.new_subtask_mi.set_sensitive(enable) self.mark_done_mi.set_sensitive(enable) self.dismiss_mi.set_sensitive(enable) self.delete_mi.set_sensitive(... | def update_buttons_sensitivity(self,a=None,b=None,c=None): enable = self.selection.count_selected_rows() + \ self.closed_selection.count_selected_rows() > 0 self.edit_mi.set_sensitive(enable) self.new_subtask_mi.set_sensitive(enable) self.mark_done_mi.set_sensitive(enable) self.dismiss_mi.set_sensitive(enable) self.de... | 463,623 |
def is_displayed(self,tid): return True | def is_displayed(self,tid): return True | 463,624 |
def move_task(self, parent_tid, child_tid): """Moves the task identified by child_tid under parent_tid, removing all the precedent parents. Child becomes a root task if parent_tid is None""" child_task = self.req.get_task(child_tid) current_parents = child_task.get_parents() #Avoid the typical time-traveller problem be... | def move_task(self, parent_tid, child_tid): """Moves the task identified by child_tid under parent_tid, removing all the precedent parents. Child becomes a root task if parent_tid is None""" child_task = self.req.get_task(child_tid) current_parents = child_task.get_parents() #Avoid the typical time-traveller problem be... | 463,625 |
def on_button_press(self, widget, event): # Here we intercept mouse clicks on selected items so that we can # drag multiple items without the click selecting only one target = self.get_path_at_pos(int(event.x), int(event.y)) print "we clikced on %s" %str(target) print "event.type = button_press : %s" %(event.type == gt... | def on_button_press(self, widget, event): # Here we intercept mouse clicks on selected items so that we can # drag multiple items without the click selecting only one target = self.get_path_at_pos(int(event.x), int(event.y)) if (target \ and event.type == gtk.gdk.BUTTON_PRESS\ and event.button == 1\ and not (event.stat... | 463,626 |
def on_button_press(self, widget, event): # Here we intercept mouse clicks on selected items so that we can # drag multiple items without the click selecting only one target = self.get_path_at_pos(int(event.x), int(event.y)) print "we clikced on %s" %str(target) print "event.type = button_press : %s" %(event.type == gt... | def on_button_press(self, widget, event): # Here we intercept mouse clicks on selected items so that we can # drag multiple items without the click selecting only one target = self.get_path_at_pos(int(event.x), int(event.y)) print "we clikced on %s" %str(target) print "event.type = button_press : %s" %(event.type == gt... | 463,627 |
def on_add_new_tag(self, widget=None, tid=None, tryagain = False): if not tid: self.tids_to_addtag = self.get_selected_tasks() else: self.tids_to_addtag = [tid] | def on_add_new_tag(self, widget=None, tid=None, tryagain = False): if not tid: self.tids_to_addtag = self.get_selected_tasks() else: self.tids_to_addtag = [tid] | 463,628 |
def __init__(self, requester, config, logger=None): | def __init__(self, requester, config, logger=None): | 463,629 |
def __init__(self,req): self.req = req self.collapsed_tags = [] self.tag_model = TagTreeModel(requester=self.req) self.tag_modelfilter = self.tag_model.filter_new() self.tag_modelfilter.set_visible_func(self.tag_visible_func) self.tag_modelsort = gtk.TreeModelSort(self.tag_modelfilter) self.tag_modelsort.set_sort_func(... | def __init__(self,req): self.req = req self.collapsed_tags = [] self.tag_model = TagTreeModel(requester=self.req) self.tag_modelfilter = self.tag_model.filter_new() self.tag_modelfilter.set_visible_func(self.tag_visible_func) self.tag_modelsort = gtk.TreeModelSort(self.tag_modelfilter) self.tags_tv = TagTreeView() self... | 463,630 |
def __init__(self,req): self.req = req self.collapsed_tags = [] self.tag_model = TagTreeModel(requester=self.req) self.tag_modelfilter = self.tag_model.filter_new() self.tag_modelfilter.set_visible_func(self.tag_visible_func) self.tag_modelsort = gtk.TreeModelSort(self.tag_modelfilter) self.tag_modelsort.set_sort_func(... | def __init__(self,req): self.req = req self.collapsed_tags = [] self.tag_model = TagTreeModel(requester=self.req) self.tag_modelfilter = self.tag_model.filter_new() self.tag_modelfilter.set_visible_func(self.tag_visible_func) self.tag_modelsort = gtk.TreeModelSort(self.tag_modelfilter) self.tag_modelsort.set_sort_func(... | 463,631 |
def tag_visible_func(self, model, iter, user_data=None): """Return True if the row must be displayed in the treeview. @param model: the model of the filtered treeview @param iter: the iter whose visiblity must be evaluated @param user_data: """ toreturn = False tag = model.get_value(iter, COL_OBJ) | def tag_visible_func(self, model, iter, user_data=None): """Return True if the row must be displayed in the treeview. @param model: the model of the filtered treeview @param iter: the iter whose visiblity must be evaluated @param user_data: """ toreturn = False tag = model.get_value(iter, COL_OBJ) | 463,632 |
def tag_sort_func(self, model, iter1, iter2, user_data=None): order = self.tags_tv.get_model().get_sort_column_id()[1] try: t1 = model.get_value(iter1, COL_OBJ) t2 = model.get_value(iter2, COL_OBJ) except TypeError: | defprint "Error: Undefined iter1 in tag_sort_func, assuming ascending sort" tag_sort_func(self,print "Error: Undefined iter1 in tag_sort_func, assuming ascending sort" model,print "Error: Undefined iter1 in tag_sort_func, assuming ascending sort" iter1,print "Error: Undefined iter1 in tag_sort_func, assuming ascending ... | 463,633 |
def _insert_at_cursor(self, tv, itera, tex, leng) : #We don't paste the bullet if tex.strip() != self.bullet1 : #print "text ###%s### inserted length = %s" %(tex,leng) #disable the insert signal to avoid recursion self.buff.disconnect(self.insert_sigid) self.insert_sigid = False self.buff.disconnect(self.modified_sigid... | def _insert_at_cursor(self, tv, itera, tex, leng) : #We don't paste the bullet if tex.strip() != self.bullet1 : #print "text ###%s### inserted length = %s" %(tex,leng) #disable the insert signal to avoid recursion self.buff.disconnect(self.insert_sigid) self.insert_sigid = False self.buff.disconnect(self.modified_sigid... | 463,634 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,635 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,636 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,637 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,638 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,639 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,640 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,641 |
def external_update_node(self,tid): if not tid: raise ValueError('cannot update node None') if self.__initialized: self.__updating_queue.append([tid,'update']) if self.__updating_lock.acquire(False) \ and len(self.__updating_queue) > 0: self.__execution_loop() | def external_update_node(self,tid): if not tid: raise ValueError('cannot update node None') if self.__initialized: self.__updating_queue.append([tid,'update']) if self.__updating_lock.acquire(False): self.__execution_loop() | 463,642 |
def external_add_node(self,tid): if not tid: raise ValueError('cannot add node None') if self.__initialized: self.__updating_queue.append([tid,'add']) if self.__updating_lock.acquire(False)\ and len(self.__updating_queue) > 0: self.__execution_loop() | def external_add_node(self,tid): if not tid: raise ValueError('cannot add node None') if self.__initialized: self.__updating_queue.append([tid,'add']) if self.__updating_lock.acquire(False): self.__execution_loop() | 463,643 |
def external_remove_node(self,tid): if not tid: raise ValueError('cannot remove node None') if self.__initialized: self.__updating_queue.append([tid,'delete']) if self.__updating_lock.acquire(False)\ and len(self.__updating_queue) > 0: self.__execution_loop() | def external_remove_node(self,tid): if not tid: raise ValueError('cannot remove node None') if self.__initialized: self.__updating_queue.append([tid,'delete']) if self.__updating_lock.acquire(False): self.__execution_loop() | 463,644 |
def __is_root(self,n): is_root = True if not self.flat and n.has_parent(): for par in n.get_parents(): if self.__is_displayed(par): is_root = False return is_root | def __is_root(self,n): is_root = True if not self.flat and n and n.has_parent(): for par in n.get_parents(): if self.__is_displayed(par): is_root = False return is_root | 463,645 |
def __root_update(self,tid,inroot): | def __root_update(self,tid,inroot): | 463,646 |
def __root_update(self,tid,inroot): | def __root_update(self,tid,inroot): | 463,647 |
def on_get_iter(self, path): | def on_get_iter(self, path): | 463,648 |
def _init_widget_aliases(self): self.window = self.builder.get_object("MainWindow") self.tagpopup = self.builder.get_object("tag_context_menu") self.nonworkviewtag_cb = self.builder.get_object("nonworkviewtag_mi") self.taskpopup = self.builder.get_object("task_context_menu") self.deferto... | def _init_widget_aliases(self): self.window = self.builder.get_object("MainWindow") self.tagpopup = self.builder.get_object("tag_context_menu") self.nonworkviewtag_cb = self.builder.get_object("nonworkviewtag_mi") self.taskpopup = self.builder.get_object("task_context_menu") self.deferto... | 463,649 |
def _init_widget_aliases(self): self.window = self.builder.get_object("MainWindow") self.tagpopup = self.builder.get_object("tag_context_menu") self.nonworkviewtag_cb = self.builder.get_object("nonworkviewtag_mi") self.taskpopup = self.builder.get_object("task_context_menu") self.deferto... | def _init_widget_aliases(self): self.window = self.builder.get_object("MainWindow") self.tagpopup = self.builder.get_object("tag_context_menu") self.nonworkviewtag_cb = self.builder.get_object("nonworkviewtag_mi") self.taskpopup = self.builder.get_object("task_context_menu") self.deferto... | 463,650 |
def on_delete(self, widget, user_data): # Cleanup collapsed row list for tid in self.priv["collapsed_tids"]: if not self.req.has_task(tid): self.priv["collapsed_tids"].remove(tid) | def on_delete(self, widget, user_data): # Cleanup collapsed row list for tid in self.priv["collapsed_tids"]: if not self.req.has_task(tid): self.priv["collapsed_tids"].remove(tid) | 463,651 |
def show_closed_pane(self): # The done/dismissed taks treeview self.ctask_tree = self.req.get_custom_tasks_tree() self.ctask_tree.apply_filter('closed') ctask_tree_model = TaskTreeModel(self.req, self.priv, \ self.ctask_tree) ctask_modelsort = gtk.TreeModelSort(ctask_tree_model) self.ctask_tv.set_model(ctask_modelsort)... | def show_closed_pane(self): # The done/dismissed taks treeview self.ctask_tree = self.req.get_custom_tasks_tree() self.ctask_tree.apply_filter('closed') ctask_tree_model = TaskTreeModel(self.req, self.priv, \ self.ctask_tree) ctask_modelsort = gtk.TreeModelSort(ctask_tree_model) self.ctask_tv.set_model(ctask_modelsort)... | 463,652 |
def hide_closed_pane(self): self.closed_pane.hide() self.ctask_tv.set_model(None) self.ctask_tree = None self.builder.get_object("view_closed").set_active(False) | def hide_closed_pane(self): self.ctask_tv.set_model(None) self.ctask_tree = None self.builder.get_object("view_closed").set_active(False) | 463,653 |
def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | 463,654 |
def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | 463,655 |
def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view. | 463,656 |
def __is_displayed(self,tid): """ This is a private method that return True if the task *should* be displayed in the tree, regardless of its current status """ if tid: result = True for f in self.applied_filters: filt = self.req.get_filter(f) if filt: result = result and filt.is_displayed(tid) return result else: retur... | def __is_displayed(self, tid): """ This is a private method that return True if the task *should* be displayed in the tree, regardless of its current status """ if tid: result = True for f in self.applied_filters: filt = self.req.get_filter(f) if filt: result = result and filt.is_displayed(tid) return result else: retu... | 463,657 |
def __is_root(self,n): is_root = True if n.has_parent(): for par in n.get_parents(): if self.__is_displayed(par): is_root = False return is_root | def __is_root(self,n): is_root = True if n.has_parent(): for par in n.get_parents(): if self.__is_displayed(par.get_id()): is_root = False return is_root | 463,658 |
def task_to_TaskStr(self, task): return self.TaskStr(task.get_title(), str(task.get_text()), [], task.get_status(), str(task.get_modified()), str(task.get_due_date()), str(task.get_start_date()), str(task.get_days_left()), str(task.get_closed_date()), map(lambda t: t.get_name(), task.get_tags())) | def task_to_TaskStr(self, task): return self.TaskStr(task.get_title(), str(task.get_text()), [], task.get_status(), str(task.get_modified()), str(task.get_due_date()), str(task.get_start_date()), str(task.get_days_left()), map(lambda t: t.get_name(), task.get_tags())) | 463,659 |
def anonymize(filename, outputfile): try: dom = parse(filename) except Exception, err: print "error while parsing %s: %s" % (filename, err) return tasks = dom.getElementsByTagName("task") for task in tasks: textnode = task.getElementsByTagName("title")[0].childNodes[0] nodevalue = textnode.nodeValue newnodevalue = "... | def anonymize(filename, outputfile): try: dom = parse(filename) except Exception, err: print "error while parsing %s: %s" % (filename, err) return tasks = dom.getElementsByTagName("task") for task in tasks: textnode = task.getElementsByTagName("title")[0].childNodes[0] nodevalue = textnode.nodeValue newnodevalue = "... | 463,660 |
def on_close(self, widget): """Close the preferences dialog.""" self.dialog.hide() return True | def on_close(self, widget, data = None): """Close the preferences dialog.""" self.dialog.hide() return True | 463,661 |
def load_tag_tree(self): # Loading tags tagfile = os.path.join(CoreConfig().get_data_dir(), TAG_XMLFILE) doc, xmlstore = cleanxml.openxmlfile(tagfile,TAG_XMLROOT) for t in xmlstore.childNodes: #We should only care about tag with a name beginning with "@" #Other are special tags tagname = t.getAttribute("name") tag = se... | def load_tag_tree(self): # Loading tags tagfile = os.path.join(CoreConfig().get_data_dir(), TAG_XMLFILE) doc, xmlstore = cleanxml.openxmlfile(tagfile,TAG_XMLROOT) for t in xmlstore.childNodes: #We should only care about tag with a name beginning with "@" #Other are special tags tagname = t.getAttribute("name") tag = se... | 463,662 |
def refresh_editor(self, title=None, refreshtext=False): to_save = False #title of the window if title : self.window.set_title(title) to_save = True else : self.window.set_title(self.task.get_title()) status = self.task.get_status() if status == "Dismiss": self.donebutton.set_label(GnomeConfig.MARK_DONE) self.donebutt... | def refresh_editor(self, title=None, refreshtext=False): to_save = False #title of the window if title : self.window.set_title(title) to_save = True else : self.window.set_title(self.task.get_title()) status = self.task.get_status() if status == "Dismiss": self.donebutton.set_label(GnomeConfig.MARK_DONE) self.donebutt... | 463,663 |
def active_tasks_treeview(self,tree): desc = {} #invisible 'title' column col_name = 'title' col = {} render_text = gtk.CellRendererText() render_text.set_property("ellipsize", pango.ELLIPSIZE_END) col['renderer'] = ['markup',render_text] col['value'] = [str,self.task_title_column] col['visible'] = False col['order'] ... | deftreeview.set_bg_color(self.task_bg_color,'tags') active_tasks_treeview(self,tree):treeview.set_bg_color(self.task_bg_color,'tags') desctreeview.set_bg_color(self.task_bg_color,'tags') =treeview.set_bg_color(self.task_bg_color,'tags') {}treeview.set_bg_color(self.task_bg_color,'tags') treeview.set_bg_color(self.task_... | 463,664 |
def active_tasks_treeview(self,tree): desc = {} #invisible 'title' column col_name = 'title' col = {} render_text = gtk.CellRendererText() render_text.set_property("ellipsize", pango.ELLIPSIZE_END) col['renderer'] = ['markup',render_text] col['value'] = [str,self.task_title_column] col['visible'] = False col['order'] ... | def active_tasks_treeview(self,tree): desc = {} #invisible 'title' column col_name = 'title' col = {} render_text = gtk.CellRendererText() render_text.set_property("ellipsize", pango.ELLIPSIZE_END) col['renderer'] = ['markup',render_text] col['value'] = [str,self.task_title_column] col['visible'] = False col['order'] ... | 463,665 |
def rename_tag(self, oldname, newname): if len(newname) > 0 and \ oldname not in ['gtg-tags-none','gtg-tags-all']: if newname[0] != "@": newname = "@" + newname if newname != oldname and newname != None \ and not self.tree.has_node(newname): ntag = self.new_tag(newname) otag = self.tree.get_node(oldname) #copy attribu... | def rename_tag(self, oldname, newname): if len(newname) > 0 and \ oldname not in ['gtg-tags-none','gtg-tags-all']: if newname[0] != "@": newname = "@" + newname if newname != oldname and newname != None \ and not self.tree.has_node(newname): ntag = self.new_tag(newname) otag = self.tree.get_node(oldname) #copy attribu... | 463,666 |
def find_mo_files(self): data_files = [] for mo in glob.glob(os.path.join(MO_DIR, '*', 'gtg.mo')): lang = os.path.basename(os.path.dirname(mo)) dest = os.path.join('share', 'locale', lang, 'LC_MESSAGES') data_files.append((dest, [mo])) return data_files | def find_mo_files(self): data_files = [] for mo in glob.glob(os.path.join(MO_DIR, '*', 'gtg.mo')): lang = os.path.basename(os.path.dirname(mo)) dest = os.path.join('share', 'locale', lang, 'LC_MESSAGES') data_files.append((dest, [mo])) return data_files | 463,667 |
def _init_signal_connections(self): SIGNAL_CONNECTIONS_DIC = { "on_add_task": self.on_add_task, "on_edit_active_task": self.on_edit_active_task, "on_edit_done_task": self.on_edit_done_task, "on_delete_task": self.on_delete_tasks, "on_add_new_tag": self.on_add_new_tag, "on_mark_as_done": self.on_mark_as_done, "on_mark_a... | def _init_signal_connections(self): SIGNAL_CONNECTIONS_DIC = { "on_add_task": self.on_add_task, "on_edit_active_task": self.on_edit_active_task, "on_edit_done_task": self.on_edit_done_task, "on_delete_task": self.on_delete_tasks, "on_add_new_tag": self.on_add_new_tag, "on_mark_as_done": self.on_mark_as_done, "on_mark_a... | 463,668 |
def do_toggle_workview(self): #We have to be careful here to avoid a loop of signals #menu_state = self.menu_view_workview.get_active() #button_state = self.toggle_workview.get_active() #We do something only if both widget are in different state tobeset = not self.priv['workview'] self.menu_view_workview.set_active(t... | def do_toggle_workview(self): #We have to be careful here to avoid a loop of signals #menu_state = self.menu_view_workview.get_active() #button_state = self.toggle_workview.get_active() #We do something only if both widget are in different state tobeset = not self.priv['workview'] self.menu_view_workview.set_active(t... | 463,669 |
def on_select_tag(self, widget=None, row=None, col=None): #When you click on a tag, you want to unselect the tasks taglist, notag = self.get_selected_tags() if notag: newtag = ["notag"] else: if taglist and len(taglist) > 0: newtag = [taglist[0]] else: newtag = ['no_disabled_tag'] | def on_select_tag(self, widget=None, row=None, col=None): #When you click on a tag, you want to unselect the tasks taglist, notag = self.get_selected_tags() if notag: newtag = ["notag"] else: if taglist and len(taglist) > 0: newtag = [taglist[0]] else: newtag = ['no_disabled_tag'] | 463,670 |
def on_task_added(self, sender, tid): Log.debug("Add task with ID: %s" % tid) self._update_window_title() | def on_task_added(self, sender, tid): Log.debug("Add task with ID: %s" % tid) self._update_window_title() | 463,671 |
def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | 463,672 |
def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | 463,673 |
def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | def _init_accelerators(self): agr = gtk.AccelGroup() self.builder.get_object("MainWindow").add_accel_group(agr) | 463,674 |
def create_static_menu(self): self.menu = gtk.Menu() self.view_main_window = gtk.CheckMenuItem(_("_View Main Window")) self.view_main_window.set_active(True) self.view_main_window.connect('activate', self.minimize, self.plugin_api) self.menu.append(self.view_main_window) # menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT) ... | def create_static_menu(self): self.menu = gtk.Menu() self.view_main_window = gtk.CheckMenuItem(_("_View Main Window")) self.view_main_window.set_active(True) self.view_main_window_signal = self.view_main_window.connect(\ 'activate', \ self.minimize, \ self.plugin_api) self.menu.append(self.view_main_window) # menuItem ... | 463,675 |
def on_drag_data_received(self, treeview, context, x, y, selection, info,\ timestamp): model = treeview.get_model() tasktree_model = model.get_model() drop_info = treeview.get_dest_row_at_pos(x, y) if drop_info: path, position = drop_info iter = model.get_iter(path) # Must add the task to the parent of the tas... | def on_drag_data_received(self, treeview, context, x, y, selection, info,\ timestamp): model = treeview.get_model() tasktree_model = model.get_model() drop_info = treeview.get_dest_row_at_pos(x, y) if drop_info: path, position = drop_info iter = model.get_iter(path) # Must add the task to the parent of the tas... | 463,676 |
def _insert_at_cursor(self, tv, itera, tex, leng) : #We don't paste the bullet if tex.strip() != self.bullet1 : #print "text ###%s### inserted length = %s" %(tex,leng) #disable the insert signal to avoid recursion self.buff.disconnect(self.insert_sigid) self.insert_sigid = False self.buff.disconnect(self.modified_sigid... | def _insert_at_cursor(self, tv, itera, tex, leng) : #We don't paste the bullet if tex.strip() != self.bullet1 : #print "text ###%s### inserted length = %s" %(tex,leng) #disable the insert signal to avoid recursion self.buff.disconnect(self.insert_sigid) self.insert_sigid = False self.buff.disconnect(self.modified_sigid... | 463,677 |
def on_quickadd_activate(self, widget): text = self.quickadd_entry.get_text() due_date = no_date defer_date = no_date if text: tags, notagonly = self.get_selected_tags() # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www.... | def on_quickadd_activate(self, widget): text = self.quickadd_entry.get_text() due_date = no_date defer_date = no_date if text: tags, notagonly = self.get_selected_tags() # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www.... | 463,678 |
def __update_node(self,tid,inroot): if tid not in self.node_to_remove: todis = self.__is_displayed(tid) curdis = self.is_displayed(tid) if todis: #if the task was not displayed previously but now should #we add it. if not curdis: | def __update_node(self,tid,inroot): if tid not in self.node_to_remove: todis = self.__is_displayed(tid) curdis = self.is_displayed(tid) if todis: #if the task was not displayed previously but now should #we add it. if not curdis: | 463,679 |
def __init__(self, requester): gtk.GenericTreeModel.__init__(self) self.req = requester self.tree = self.req.get_tag_tree() self.workview = False | def __init__(self, requester): gtk.GenericTreeModel.__init__(self) self.req = requester self.tree = self.req.get_tag_tree() self.workview = False | 463,680 |
def update_tags_for_task(self, tid): task = self.req.get_task(tid) if task: for t in task.get_tags(): path = self.tree.get_path_for_node(t) iter = self.get_iter(path) self.row_changed(path, iter) | def update_tags_for_task(self, task_id): task = self.req.get_task(task_id) if task: for t in task.get_tags(): path = self.tree.get_path_for_node(t) iter = self.get_iter(path) self.row_changed(path, iter) | 463,681 |
def update_tags_for_task(self, tid): task = self.req.get_task(tid) if task: for t in task.get_tags(): path = self.tree.get_path_for_node(t) iter = self.get_iter(path) self.row_changed(path, iter) | def update_tags_for_task(self, tid): task = self.req.get_task(tid) if task: for t in task.get_tags(): path = self.tree.get_path_for_node(t) iter = self.get_iter(path) self.row_changed(path, iter) | 463,682 |
def add_tag(self, sender, tname): Log.debug("add tag %s" % (tname)) | def add_tag(self, sender, tname): Log.debug("add tag %s" % (tname)) | 463,683 |
def update_tag_task_added(self, sender, task_id): ''' This method handles the adding of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' self._update_tag_from_name(self.req.get_alltag_tag().get_name()) self._update_tag_from_name(self.req.get_notag_tag().get_name()) task = self.req.get_task(tas... | def update_tag_task_added(self, sender, task_id): ''' This method handles the adding of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' task = self.req.get_task(task_id) for tag in task.get_tags(): self.update_tag(sender, tag.get_name()) | 463,684 |
def update_tag_task_added(self, sender, task_id): ''' This method handles the adding of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' self._update_tag_from_name(self.req.get_alltag_tag().get_name()) self._update_tag_from_name(self.req.get_notag_tag().get_name()) task = self.req.get_task(tas... | def update_tag_task_added(self, sender, task_id): ''' This method handles the adding of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' self._update_tag_from_name(self.req.get_alltag_tag().get_name()) self._update_tag_from_name(self.req.get_notag_tag().get_name()) task = self.req.get_task(tas... | 463,685 |
def update_tag_task_deleted(self, sender, task_id): ''' This method handles the deleting of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' task = self.req.get_task(task_id) for tag in task.get_tags(): tasks_count = tag.get_tasks_nbr(workview=self.workview) if tasks_count <= 1: tag_name = tag... | def update_tag_task_deleted(self, sender, task_id): ''' This method handles the deleting of tasks, updating the "All task" entry in the tag pane and the "No tags" ''' task = self.req.get_task(task_id) for tag in task.get_tags(): tasks_count = tag.get_tasks_nbr(workview=self.workview) if tasks_count <= 1: tag_name = tag... | 463,686 |
def connect_model(self): if TM_USE_SIGNALS: self.tree.connect('node-added-inview',self.__add_task) self.tree.connect('node-deleted-inview',self.__remove_task) self.tree.connect('node-modified-inview',self.__update_task) self.tree.connect('node-children-reordered',self.__reorder) else: self.tree.register_cllbck('node-ad... | def connect_model(self): if TM_USE_SIGNALS: self.tree.connect('node-added-inview',self.__add_task) self.tree.connect('node-deleted-inview',self.__remove_task) self.tree.connect('node-modified-inview',self.__update_task) self.tree.connect('node-children-reordered',self.__reorder) else: self.tree.register_cllbck('node-ad... | 463,687 |
def __reorder(self,nid,path,neworder): actual_nid = self.tree.get_node_for_path(path) if nid == actual_nid: if path: rowref = self.get_iter(path) else: rowref = None self.rows_reordered(path,rowref,neworder) else: raise Exception('path/node mismatch in reorder') | def __reorder(self, sender, nid,path,neworder): actual_nid = self.tree.get_node_for_path(path) if nid == actual_nid: if path: rowref = self.get_iter(path) else: rowref = None self.rows_reordered(path,rowref,neworder) else: raise Exception('path/node mismatch in reorder') | 463,688 |
def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | 463,689 |
def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | 463,690 |
def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | 463,691 |
def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | def on_delete_task(self, widget=None, tid=None): #If we don't have a parameter, then take the selection in the treeview if not tid: #tid_to_delete is a [project,task] tuple self.tids_todelete = self.get_selected_tasks() else: self.tids_todelete = [tid] #We must at least have something to delete ! if len(self.tids_todel... | 463,692 |
def on_get_iter(self, path): #We have to return None if there's no node on that path iter = None | def on_get_iter(self, path): #We have to return None if there's no node on that path iter = None | 463,693 |
def create_data_files(): data_files = [] # icons icons = create_icon_list() data_files.extend(icons) # gtg .desktop icon data_files.append(('share/icons/hicolor/16x16/apps', \ ['data/icons/hicolor/16x16/apps/gtg.png'])) data_files.append(('share/icons/hicolor/22x22/apps', \ ['data/icons/hicolor/22x22/apps/gtg.png'])) d... | def create_data_files(): data_files = [] # icons icons = create_icon_list() data_files.extend(icons) # gtg .desktop icon data_files.append(('share/icons/hicolor/16x16/apps', \ ['data/icons/hicolor/16x16/apps/gtg.png'])) data_files.append(('share/icons/hicolor/22x22/apps', \ ['data/icons/hicolor/22x22/apps/gtg.png'])) d... | 463,694 |
def add_tasks(self): #self.lock = True while len(self.tasks_to_add) > 0: tid = self.tasks_to_add.pop() task = self.tree.get_node(tid) if task: node_paths = self.tree.get_paths_for_node(task) for node_path in node_paths: node_iter = self.get_iter(node_path) self.row_inserted(node_path, node_iter) #following is mandatory... | def add_tasks(self): #self.lock = True while len(self.tasks_to_add) > 0: tid = self.tasks_to_add.pop() task = self.tree.get_node(tid) if task: node_paths = self.tree.get_paths_for_node(task) for node_path in node_paths: node_iter = self.get_iter(node_path) self.row_inserted(node_path, node_iter) #following is mandatory... | 463,695 |
def add_menu_task(self, tid, task = None): """Adds a task in the menu""" if task == None: task = self.plugin_api.get_task(tid) menu_item = gtk.ImageMenuItem(task.get_title()) menu_item.connect('activate', self.open_task, tid) self.menu.append(menu_item) self.tasks_in_menu[tid] = menu_item | def add_menu_task(self, tid, task = None): """Adds a task in the menu, trimming the title if necessary""" if task == None: task = self.plugin_api.get_task(tid) menu_item = gtk.ImageMenuItem(task.get_title()) menu_item.connect('activate', self.open_task, tid) self.menu.append(menu_item) self.tasks_in_menu[tid] = menu_it... | 463,696 |
def add_menu_task(self, tid, task = None): """Adds a task in the menu""" if task == None: task = self.plugin_api.get_task(tid) menu_item = gtk.ImageMenuItem(task.get_title()) menu_item.connect('activate', self.open_task, tid) self.menu.append(menu_item) self.tasks_in_menu[tid] = menu_item | def add_menu_task(self, tid, task = None): """Adds a task in the menu""" if task == None: task = self.plugin_api.get_task(tid) title = task.get_title()[0:self.MAX_TITLE_LEN] if len(title)== self.MAX_TITLE_LEN: title = title + "..." menu_item = gtk.ImageMenuItem(title) menu_item.connect('activate', self.open_task, tid) ... | 463,697 |
def deactivate(self, plugin_api): self.statusicon.set_visible(False) self.plugin_api.get_browser().start_minimized = False plugin_api.unregister_filter_cb(self.doable_tasks_filter) | def deactivate(self, plugin_api): self.statusicon.set_visible(False) self.plugin_api.get_browser().start_minimized = False | 463,698 |
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager. | 463,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.