bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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,500
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,501
def selecter(treemodelsort, path, iter, self): self.__last_quick_added_tid_event.wait() treeview = self.vtree_panes['active'] liblarch_path = treemodelsort.convert_path_to_child_path(path) tid = self.activetree.get_node_for_path(liblarch_path) if self.__last_quick_added_tid == tid: #this is the correct task treemodelso...
def selecter(treemodelsort, path, iter, self): self.__last_quick_added_tid_event.wait() treeview = self.vtree_panes['active'] liblarch_path = treemodelsort.convert_path_to_child_path(path) tid = self.activetree.get_node_for_path(liblarch_path) if self.__last_quick_added_tid == tid: #this is the correct task treemodelso...
463,502
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return an empty list if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node retur...
463,503
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return toretur...
463,504
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
463,505
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
def get_paths_for_node(self, node): """ Return a list of paths for a given node Return None if no path for that Node. """ toreturn = [] if node: tid = node.get_id() #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): #print "not displayed %s" %node return None #T...
463,506
def onTaskOpened(self, plugin_api): # add button button = gtk.ToolButton() button.set_label("Start") button.set_icon_name('hamster-applet') button.set_tooltip_text(_("Start a new activity in Hamster Time " + \ " Tracker based on this task")) button.connect('clicked', self.task_cb, plugin_api) button.show() self.taskbut...
def onTaskOpened(self, plugin_api): # add button button = gtk.ToolButton() button.set_label("Start") button.set_icon_name('hamster-applet') button.set_tooltip_text(_("Start a new activity in Hamster Time " + \ " Tracker based on this task")) button.connect('clicked', self.task_cb, plugin_api) button.show() self.taskbut...
463,507
def plugin_markup(column, cell, store, iter): """Callback to set the content of a PluginTree cell. See PreferencesDialog._init_plugin_tree(). """ name = store.get_value(iter, PLUGINS_COL_NAME) desc = store.get_value(iter, PLUGINS_COL_DESC) cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc)) cell.set_property(...
def plugin_markup(column, cell, store, iter): """Callback to set the content of a PluginTree cell. See PreferencesDialog._init_plugin_tree(). """ name = store.get_value(iter, PLUGINS_COL_NAME) desc = store.get_value(iter, PLUGINS_COL_SHORT_DESC) cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc)) cell.set_pro...
463,508
def is_actively_used(self): toreturn = False for task in self.tasks: if self.req.get_task(task).get_status() == "Active": toreturn = True return toreturn
def is_actively_used(self): toreturn = False for tid in self.tasks: task = self.req.get_task(tid) if task and task.get_status() == "Active": toreturn = True return toreturn
463,509
def deactivate(self, plugin_api): plugin_api.remove_menu_item(self.menu_item) plugin_api.remove_toolbar_item(self.tb_button) plugin_api.remove_toolbar_item(self.separator) self.txtImport = None
def deactivate(self, plugin_api): plugin_api.remove_menu_item(self.menu_item) plugin_api.remove_task_toolbar_item(self.tb_button) plugin_api.remove_task_toolbar_item(self.separator) self.txtImport = None
463,510
def refresh(self,sender=None,tid=None): if tid: task = self.req.get_task(tid) if task: for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
def refresh(self,sender=None,tid=None): if tid: task = self.req.get_task(tid) if task: for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
463,511
def core_main_init(options = None, args = None): ''' Part of the main function prior to the UI initialization. ''' # Debugging subsystem initialization if options.debug: Log.setLevel(logging.DEBUG) Log.debug("Debug output enabled.") Log.set_debugging_mode(True) config = CoreConfig() check_instance(config.get_data_dir()...
def core_main_init(options = None, args = None): ''' Part of the main function prior to the UI initialization. ''' # Debugging subsystem initialization if options.debug: Log.setLevel(logging.DEBUG) Log.debug("Debug output enabled.") Log.set_debugging_mode(True) config = CoreConfig() check_instance(config.get_data_dir()...
463,512
def core_main_quit(config, ds): ''' Last bits of code executed in GTG, after the UI has been shut off. Currently, it's just saving everything. ''' # Ideally we should load window geometry configuration from a config. # backend like gconf at some point, and restore the appearance of the # application as the user last ex...
def core_main_quit(config, ds): ''' Last bits of code executed in GTG, after the UI has been shut off. Currently, it's just saving everything. ''' # Ideally we should load window geometry configuration from a config. # backend like gconf at some point, and restore the appearance of the # application as the user last ex...
463,513
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,514
def _set_tags(self, tags): other_tags = [] for tag in tags: if tag[0] != '@': tag = '@' + tag other_tags.append(tag) gtg_tags = self._gtg_task.get_tags() gtg_tags_lower = [t.get_name().lower() for t in gtg_tags] gtg_tags_set = set(gtg_tags_lower) other_tags_set = set([t.lower() for t in other_tags]) #tags to remove for...
def _set_tags(self, tags): other_tags = [] for tag in tags: tag = '@' + tag other_tags.append(tag) gtg_tags = self._gtg_task.get_tags() gtg_tags_lower = [t.get_name().lower() for t in gtg_tags] gtg_tags_set = set(gtg_tags_lower) other_tags_set = set([t.lower() for t in other_tags]) #tags to remove for tag in gtg_tags_s...
463,515
def __init__(self, requester, vmanager, task, plugins, taskconfig = None, plugin_apis = None, thisisnew = False, clipboard = None) : self.req = requester self.vmanager = vmanager self.config = taskconfig self.p_apis = plugin_apis self.time = None self.clipboard = clipboard self.builder = gtk.Builder() self.builder.add_...
def __init__(self, requester, vmanager, task, plugins, taskconfig = None, plugin_apis = None, thisisnew = False, clipboard = None) : self.req = requester self.vmanager = vmanager self.config = taskconfig self.p_apis = plugin_apis self.time = None self.clipboard = clipboard self.builder = gtk.Builder() self.builder.add_...
463,516
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,517
def move_tag(self, parent, child): Log.debug("Moving %s below %s" % (child, parent)) # Get child child_tag = self.get_value(child, COL_OBJ) child_path = self.get_path(child) # Get old parent old_par = self.iter_parent(child) if old_par: old_par_tag = self.get_value(old_par, COL_OBJ) old_par_n_children = self.iter_n_c...
def move_tag(self, parent, child): Log.debug("Moving %s below %s" % (child, parent)) # Get child child_tag = self.get_value(child, COL_OBJ) child_path = self.get_path(child) # Get old parent old_par = self.iter_parent(child) if old_par: old_par_tag = self.get_value(old_par, COL_OBJ) old_par_n_children = self.iter_n_c...
463,518
def __emit(self, signal_name, tid,path=None,state_id=None,neworder=None,): for k in self.__cllbcks.get(signal_name,[]): f = self.__cllbcks[signal_name][k] if neworder: f(tid,path,neworder,state_id) elif state_id: f(tid,path,state_id) else: f(tid,path) if signal_name.endswith('-inview'): self.emit(signal_name, tid,path)...
def __emit(self, signal_name, tid,path=None,state_id=None,neworder=None,): for k in self.__cllbcks.get(signal_name, {}).copy(): f = self.__cllbcks[signal_name][k] if neworder: f(tid,path,neworder,state_id) elif state_id: f(tid,path,state_id) else: f(tid,path) if signal_name.endswith('-inview'): self.emit(signal_name, t...
463,519
def strtodate(stri) : if stri == _("now"): return NOW elif stri == _("soon"): return SOON elif stri == _("later"): return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[1] d = zedate[2] if...
def strtodate(stri) : if stri == _("now") or stri == "now": return NOW elif stri == _("soon"): return SOON elif stri == _("later"): return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[1]...
463,520
def strtodate(stri) : if stri == _("now"): return NOW elif stri == _("soon"): return SOON elif stri == _("later"): return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[1] d = zedate[2] if...
def strtodate(stri) : if stri == _("now"): return NOW elif stri == _("soon") or stri == "soon": return SOON elif stri == _("later"): return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[1...
463,521
def strtodate(stri) : if stri == _("now"): return NOW elif stri == _("soon"): return SOON elif stri == _("later"): return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[1] d = zedate[2] if...
def strtodate(stri) : if stri == _("now"): return NOW elif stri == _("soon"): return SOON elif stri == _("later") or stri == "later": return LATER toreturn = None zedate = [] if stri : if '-' in stri : zedate = stri.split('-') elif '/' in stri : zedate = stri.split('/') if len(zedate) == 3 : y = zedate[0] m = zedate[...
463,522
def __init__(self, requester, config, logger=None):
def __init__(self, requester, config, logger=None):
463,523
def on_colorchooser_activate(self, widget): #TODO: Color chooser should be refactorized in its own class. Well, in #fact we should have a TagPropertiesEditor (like for project) Also, #color change should be immediate. There's no reason for a Ok/Cancel dialog = gtk.ColorSelectionDialog('Choose color') colorsel = dialog....
def on_colorchooser_activate(self, widget): #TODO: Color chooser should be refactorized in its own class. Well, in #fact we should have a TagPropertiesEditor (like for project) Also, #color change should be immediate. There's no reason for a Ok/Cancel dialog = gtk.ColorSelectionDialog('Choose color') colorsel = dialog....
463,524
def on_tag_treeview_button_press_event(self, treeview, event): if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612 treeview.grab_focus() # The location we want the cursor t...
def on_tag_treeview_button_press_event(self, treeview, event): if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612 treeview.grab_focus() # The location we want the cursor t...
463,525
def reset_cursor(self): """ Returns the cursor to the tag that was selected prior to any right click action. Should be used whenever we're done working with any tag through a right click menu action. """ if self.tag_active: path, col = self.previous_cursor self.tags_tv.set_cursor(path, col, 0) self.tag_active = False
def reset_cursor(self): """ Returns the cursor to the tag that was selected prior to any right click action. Should be used whenever we're done working with any tag through a right click menu action. """ if self.tag_active: path, col = self.previous_cursor self.tags_tv.set_cursor(path, col, 0)
463,526
def set_target_cursor(self): """ Selects the last tag to be right clicked. We need this because the context menu will deactivate (and in turn, call reset_cursor()) before, for example, the color picker dialog begins. Should be used at the beginning of any tag editing function to remind the user which tag they're worki...
def set_target_cursor(self): """ Selects the last tag to be right clicked. We need this because the context menu will deactivate (and in turn, call reset_cursor()) before, for example, the color picker dialog begins. Should be used at the beginning of any tag editing function to remind the user which tag they're worki...
463,527
def update_start_date(self, widget, new_start_date): task_to_scroll_to = None tasks_uid = filter(lambda uid: uid != None, self.get_selected_tasks()) if len(tasks_uid) == 0: return tasks = [self.req.get_task(uid) for uid in tasks_uid] tasks_status = [task.get_status() for task in tasks] for uid, task, status in zip(task...
def update_start_date(self, widget, new_start_date): tasks_uid = filter(lambda uid: uid != None, self.get_selected_tasks()) if len(tasks_uid) == 0: return tasks = [self.req.get_task(uid) for uid in tasks_uid] tasks_status = [task.get_status() for task in tasks] for uid, task, status in zip(tasks_uid, tasks, tasks_statu...
463,528
def update_start_date(self, widget, new_start_date): task_to_scroll_to = None tasks_uid = filter(lambda uid: uid != None, self.get_selected_tasks()) if len(tasks_uid) == 0: return tasks = [self.req.get_task(uid) for uid in tasks_uid] tasks_status = [task.get_status() for task in tasks] for uid, task, status in zip(task...
def update_start_date(self, widget, new_start_date): task_to_scroll_to = None tasks_uid = filter(lambda uid: uid != None, self.get_selected_tasks()) if len(tasks_uid) == 0: return tasks = [self.req.get_task(uid) for uid in tasks_uid] tasks_status = [task.get_status() for task in tasks] for uid, task, status in zip(task...
463,529
def on_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_from_name(tag.get_name())
def on_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_from_name(tag.get_name())
463,530
def __init__(self): #task editor widget self.vbox = None self.button=gtk.ToolButton() self.menu_item = gtk.MenuItem(_("Start task in Hamster")) self.taskbutton = None self.separator = gtk.SeparatorToolItem() self.task_separator = None
def __init__(self): #task editor widget self.vbox = None self.button=gtk.ToolButton() self.menu_item = gtk.MenuItem(_("Start task in Hamster")) self.taskbutton = None
463,531
def activate(self, plugin_api): self.plugin_api = plugin_api self.hamster=dbus.SessionBus().get_object('org.gnome.Hamster', '/org/gnome/Hamster') # add menu item self.menu_item.connect('activate', self.browser_cb, plugin_api) plugin_api.add_menu_item(self.menu_item) # and button self.button.set_label(_("Start in Hams...
def activate(self, plugin_api): self.plugin_api = plugin_api self.hamster=dbus.SessionBus().get_object('org.gnome.Hamster', '/org/gnome/Hamster') # add menu item self.menu_item.connect('activate', self.browser_cb, plugin_api) plugin_api.add_menu_item(self.menu_item) # and button self.button.set_label(_("Start in Hams...
463,532
def onTaskOpened(self, plugin_api): # add button button = gtk.ToolButton() button.set_label("Start") button.set_icon_name('hamster-applet') button.set_tooltip_text(_("Start a new activity in Hamster Time " + \ " Tracker based on this task")) button.connect('clicked', self.task_cb, plugin_api) self.task_separator = plug...
def onTaskOpened(self, plugin_api): # add button button = gtk.ToolButton() button.set_label("Start") button.set_icon_name('hamster-applet') button.set_tooltip_text(_("Start a new activity in Hamster Time " + \ " Tracker based on this task")) button.connect('clicked', self.task_cb, plugin_api) button.show() self.taskbut...
463,533
def deactivate(self, plugin_api): plugin_api.remove_menu_item(self.menu_item) plugin_api.remove_toolbar_item(self.button) plugin_api.remove_toolbar_item(self.separator) plugin_api.remove_task_toolbar_item(self.task_separator) plugin_api.remove_task_toolbar_item(self.taskbutton) plugin_api.remove_widget_from_taskeditor(...
def deactivate(self, plugin_api): plugin_api.remove_menu_item(self.menu_item) plugin_api.remove_toolbar_item(self.button) plugin_api.remove_toolbar_item(self.taskbutton) plugin_api.remove_widget_from_taskeditor(self.vbox)
463,534
def browser_cb(self, widget, plugin_api): self.sendTask(plugin_api.get_selected_task())
def browser_cb(self, widget, plugin_api): task_id = plugin_api.get_ui().get_selected_task() self.sendTask(plugin_api.get_requester().get_task(task_id))
463,535
def task_cb(self, widget, plugin_api): self.sendTask(plugin_api.get_task())
def task_cb(self, widget, plugin_api): task = plugin_api.get_ui().get_task() self.sendTask(task)
463,536
def configure_dialog(self, plugin_apis, manager_dialog): self.preferences_load() self.preferences_dialog.set_transient_for(manager_dialog) def pref_to_dialog(pref): self.builder.get_object(pref+"_"+self.preferences[pref]) \ .set_active(True) pref_to_dialog("activity") pref_to_dialog("category") pref_to_dialog("descri...
def configure_dialog(self, manager_dialog): self.preferences_load() self.preferences_dialog.set_transient_for(manager_dialog) def pref_to_dialog(pref): self.builder.get_object(pref+"_"+self.preferences[pref]) \ .set_active(True) pref_to_dialog("activity") pref_to_dialog("category") pref_to_dialog("description") pref_...
463,537
def on_tag_treeview_button_press_event(self, treeview, event): if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612 treeview.grab_focus() # The location we want the cursor t...
def on_tag_treeview_button_press_event(self, treeview, event): if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612 treeview.grab_focus() # The location we want the cursor t...
463,538
def node_nth_child(self, node, n): """ Retrieves the nth child of the node. @param node: The parent node, or None to look at children of the virtual_root. """ #we return the nth good children ! if not node: if len(self.virtual_root) > n: to_id = self.virtual_root[n] toreturn = self.get_node(to_id)
def node_nth_child(self, node, n): """ Retrieves the nth child of the node. @param node: The parent node, or None to look at children of the virtual_root. """ #we return the nth good children ! if not node: if len(self.virtual_root) > n: to_id = self.virtual_root[n] toreturn = self.get_node(to_id)
463,539
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xml...
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): Log.debug("Something happened to the tags file. Using backup") os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xmlproject = emptydoc(root) newfile = ...
463,540
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xml...
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xml...
463,541
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xml...
def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): Log.debug("Something happened to the tags file. Using backup") os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xmlproject = emptydoc(root) newfile = ...
463,542
def _init_tag_completion(self): self.tag_completion = gtk.EntryCompletion() self.tag_completion.set_model(self.tag_model) self.tag_completion.set_text_column(2) self.tag_completion.set_inline_completion(True) self.tag_completion.set_inline_selection(True)
def _init_tag_completion(self): self.tag_completion = gtk.EntryCompletion() self.tag_completion.set_model(self.tag_model) self.tag_completion.set_text_column(1) self.tag_completion.set_match_func(self.tag_match_func, 1) self.tag_completion.set_inline_completion(True) self.tag_completion.set_inline_selection(True)
463,543
def tag_sort_func(self, model, iter1, iter2, user_data=None): order = self.tags_tv.get_model().get_sort_column_id()[1] t1 = model.get_value(iter1, tagtree.COL_OBJ) t2 = model.get_value(iter2, tagtree.COL_OBJ) t1_sp = t1.get_attribute("special") t2_sp = t2.get_attribute("special") t1_name = locale.strxfrm(t1.get_name())...
def tag_sort_func(self, model, iter1, iter2, user_data=None): order = self.tags_tv.get_model().get_sort_column_id()[1] t1 = model.get_value(iter1, tagtree.COL_OBJ) t2 = model.get_value(iter2, tagtree.COL_OBJ) t1_sp = t1.get_attribute("special") t2_sp = t2.get_attribute("special") t1_name = locale.strxfrm(t1.get_name())...
463,544
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,545
def on_add_subtask(self, widget): uid = self.get_selected_task() if uid: zetask = self.req.get_task(uid) tags = zetask.get_tags() task = self.req.new_task(tags=tags, newtask=True) task.add_parent(uid) zetask.add_child(task.get_id()) self.vmanager.open_task(task.get_id(),thisisnew=True) #self.do_refresh()
def on_add_subtask(self, widget): uid = self.get_selected_task() if uid: zetask = self.req.get_task(uid) tags = zetask.get_tags() task = self.req.new_task(tags=tags, newtask=True) zetask.add_child(task.get_id()) self.vmanager.open_task(task.get_id(),thisisnew=True) #self.do_refresh()
463,546
def __init__(self,requester): Tree.__init__(self) self.req = requester ### building the initial tags # Build the "all tasks tag" self.alltag_tag = self.new_tag("gtg-tags-all") self.alltag_tag.set_attribute("special","all") self.alltag_tag.set_attribute("label","<span weight='bold'>%s</span>"\ % _("All tasks")) self.al...
def __init__(self,requester): Tree.__init__(self) self.req = requester ### building the initial tags # Build the "all tasks tag" self.alltag_tag = self.new_tag("gtg-tags-all") self.alltag_tag.set_attribute("special","all") self.alltag_tag.set_attribute("label","<span weight='bold'>%s</span>"\ % _("All tasks")) self.al...
463,547
def save(self): doc, xmlroot = cleanxml.emptydoc(XMLROOT) tags = self.get_all_tags() already_saved = [] #We avoid saving the same tag twice #we don't save tags with no attributes #It saves space and allow the saved list growth to be controlled for t in tags: attr = t.get_all_attributes(butname=True) if "special" in att...
def save(self): doc, xmlroot = cleanxml.emptydoc(XMLROOT) tags = self.get_all_tags() already_saved = [] #We avoid saving the same tag twice #we don't save tags with no attributes #It saves space and allow the saved list growth to be controlled for t in tags: attr = t.get_all_attributes(butname = True, withparent = True...
463,548
def get_all_attributes(self, butname=False): """Return a list of all attribute names.
def get_all_attributes(self, butname=False, withparent = False): """Return a list of all attribute names.
463,549
def on_delete_confirm(self, widget): """if we pass a tid as a parameter, we delete directly otherwise, we will look which tid is selected""" for tid in self.tids_todelete: task = self.req.get_task(tid) if task: task.delete() else: print "trying to delete task already deleted" self.tids_todelete = []
def on_delete_confirm(self, widget): """if we pass a tid as a parameter, we delete directly otherwise, we will look which tid is selected""" for tid in self.tids_todelete: task = self.req.delete_task(tid) self.tids_todelete = []
463,550
def refresh(self,sender=None,tid=None): if tid: task = self.req.get_task(tid) for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
def refresh(self,sender=None,tid=None): if tid: task = self.req.get_task(tid) for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
463,551
def on_iter_children(self, rowref): return self.on_iter_nth_child(rowref,0)
def on_iter_children(self, rowref): nid = rowref.get_node() if self.tree.node_n_children(nid) > 0: return self.on_iter_nth_child(rowref,0) else: return None
463,552
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.") text1 += "\n\n" text1 += _("In GTG, everything is a task. From building a bridge over the Pacific Ocean to changing a l...
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.") text1 += "\n\n" text1 += _("In GTG, everything is a task. From building a bridge over the Pacific Ocean to changing a l...
463,553
def tag_added(self, tagname): "Add a tag. Does not add '@tag' to the contents. See insert_tag" t = self.req.new_tag(tagname.encode("UTF-8")) t.add_task(self.get_id()) #Do not add the same tag twice if not t in self.tags: self.tags.append(t) for child in self.get_subtasks(): if child.can_be_deleted: child.tag_added(tagn...
def tag_added(self, tagname): "Add a tag. Does not add '@tag' to the contents. See insert_tag" t = self.req.new_tag(tagname.encode("UTF-8")) t.add_task(self.get_id()) #Do not add the same tag twice if not t in self.tags: self.tags.append(t) for child in self.get_subtasks(): child.add_tag(tagname) return True
463,554
def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(task.get_title()) return #trimm...
def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(title) return #trimming of the ...
463,555
def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(task.get_title()) return #trimm...
def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(task.get_title()) return #trimm...
463,556
def __init__(self, requester, view_manager, taskeditor = None): """ Construct a PluginAPI object.
def __init__(self, requester, view_manager, taskeditor = None): """ Construct a PluginAPI object.
463,557
def on_date_pressed(self, widget,data): """Called when the due button is clicked.""" self.__opened_date = data self._mark_today_in_bold() if self.__opened_date == "due" : toset = self.task.get_due_date() self.calendar_fuzzydate_btns.show() elif self.__opened_date == "start" : toset = self.task.get_start_date() self.ca...
def on_date_pressed(self, widget,data): """Called when the due button is clicked.""" self.__opened_date = data if self.__opened_date == "due" : toset = self.task.get_due_date() self.calendar_fuzzydate_btns.show() elif self.__opened_date == "start" : toset = self.task.get_start_date() self.calendar_fuzzydate_btns.hide(...
463,558
def on_tag_treeview_button_press_event(self, treeview, event): Log.debug("Received button event #%d at %d,%d" %(event.button, event.x, event.y)) if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #p...
def on_tag_treeview_button_press_event(self, treeview, event): Log.debug("Received button event #%d at %d,%d" %(event.button, event.x, event.y)) if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #p...
463,559
def delete_old_closed_tasks(self, widget = None): self.__log("Starting deletion of old tasks") today = date_today() requester = self.plugin_api.get_requester() closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED, Task.STA_DONE]) closed_tasks = [requester.get_task(tid) for tid in closed_tids] to_remove =...
def delete_old_closed_tasks(self, widget = None): self.__log("Starting deletion of old tasks") today = datetime.datetime.now().date() requester = self.plugin_api.get_requester() closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED, Task.STA_DONE]) closed_tasks = [requester.get_task(tid) for tid in closed...
463,560
def delete_old_closed_tasks(self, widget = None): self.__log("Starting deletion of old tasks") today = date_today() requester = self.plugin_api.get_requester() closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED, Task.STA_DONE]) closed_tasks = [requester.get_task(tid) for tid in closed_tids] to_remove =...
def delete_old_closed_tasks(self, widget = None): self.__log("Starting deletion of old tasks") today = date_today() requester = self.plugin_api.get_requester() closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED, Task.STA_DONE]) closed_tasks = [requester.get_task(tid) for tid in closed_tids] delta = da...
463,561
def _get_title(self): if hasattr(self.task,"name"): return self.task.name else: if self.logger: self.logger.debug ("rtm task has no title") return ""
def _get_title(self): if hasattr(self.task,"name"): return self.task.name else: self.__log("rtm task has no title: " + str(self.task)) return ""
463,562
def __get_rtm_task_attribute(self, attr): if hasattr(self.task, 'task'): if type(self.task.task) == type(list): return getattr(self.task.task[0], attr) else: return getattr(self.task.task, attr) else: return getattr(self.task, attr)
def __get_rtm_task_attribute(self, attr): if hasattr(self.task, 'task'): if hasattr(self.task.task, 'list'): self.__log("getting a rtm task attribute(1): " + \ str(self.task.task)) return getattr(self.task.task.list, attr) else: self.__log("getting a rtm task attribute(2): " + \ str(self.task.task)) return getattr(self...
463,563
def add_node(self, node, parent_id=None): id = node.get_id() if self.nodes.has_key(id): print "Error : A node with this id %s already exists" %id return False else: #We add the node node.set_tree(self) if not parent_id: parent_id = 'root' #we build the relationship before adding the node ! #That's crucial, else, the no...
defadd_node(self,node,parent_id=None):id=node.get_id()ifself.nodes.has_key(id):print"Error:Anodewiththisid%salreadyexists"%idreturnFalseelse:#Weaddthenodenode.set_tree(self)ifnotparent_id:parent_id='root'#webuildtherelationshipbeforeaddingthenode!#That'scrucial,else,thenodewillexistwhile#childrenmightnotbeyetawareofthe...
463,564
def add_node(self, node, parent_id=None): id = node.get_id() if self.nodes.has_key(id): print "Error : A node with this id %s already exists" %id return False else: #We add the node node.set_tree(self) if not parent_id: parent_id = 'root' #we build the relationship before adding the node ! #That's crucial, else, the no...
def add_node(self, node, parent_id=None): id = node.get_id() if self.nodes.has_key(id): print "Error : A node with this id %s already exists" %id return False else: #We add the node node.set_tree(self) if not parent_id: parent_id = 'root' #we build the relationship before adding the node ! #That's crucial, else, the no...
463,565
def new_relationship(self,parent_id,child_id): #Genealogic search is a function we use to build a list of every #ancestor of a node def genealogic_search(nid): if nid not in genealogy: genealogy.append(nid) if self.has_node(nid): node = self.get_node(nid) for par in node.get_parents(): genealogic_search(par) Log.debug(...
def new_relationship(self,parent_id,child_id,refresh_nodes=True): #Genealogic search is a function we use to build a list of every #ancestor of a node def genealogic_search(nid): if nid not in genealogy: genealogy.append(nid) if self.has_node(nid): node = self.get_node(nid) for par in node.get_parents(): genealogic_sea...
463,566
def genealogic_search(nid): if nid not in genealogy: genealogy.append(nid) if self.has_node(nid): node = self.get_node(nid) for par in node.get_parents(): genealogic_search(par)
def genealogic_search(nid): if nid not in genealogy: genealogy.append(nid) if self.has_node(nid): node = self.get_node(nid) for par in node.get_parents(): genealogic_search(par)
463,567
def _setup_signal_connections(self, builder): ''' Creates some GTK signals connections
def _setup_signal_connections(self, builder): ''' Creates some GTK signals connections
463,568
def on_get_iter(self, path): #print "on_get_iter: %s" % str(path) return self.tree.get_node_for_path(path)
def on_get_iter(self, path): #print "on_get_iter: %s" % str(path) return self.tree.get_node_for_path(path)
463,569
def on_iter_next(self, node): if node.has_parent(): parent_node = get_parents()[0] next_idx = parent_node.get_child_index(node.get_id()) + 1 if parent_node.get_n_children()-1 < next_idx: return None else: return parent_node.get_nth_child(next_idx) else: return None
def on_iter_next(self, node): if node.has_parent(): parent_node = get_parents()[0] next_idx = parent_node.get_child_index(node.get_id()) + 1 if parent_node.get_n_children()-1 < next_idx: return None else: return parent_node.get_nth_child(next_idx) else: return None
463,570
def add_tag(self, sender, tname):
def add_tag(self, sender, tname):
463,571
def add_node(self, node, parent=None): #print "*************adding node %s %s" %(node, parent) id = node.get_id() if self.nodes.get(id): print "Error : A node with this id %s already exists" %id return False else: #We add the node node.set_tree(self) if parent:# node.set_parent(parent) parent.add_child(id) else: self.r...
def add_node(self, node, parent=None): #print "*************adding node %s %s" %(node, parent) id = node.get_id() if self.nodes.get(id): print "Error : A node with this id %s already exists" %id return False else: #We add the node node.set_tree(self) if parent:# node.set_parent(parent.get_id()) parent.add_child(id) els...
463,572
def set_column(self,index,col): self.__columns[index] = col
def set_column(self,index,col): self.__columns[index] = col
463,573
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,574
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
463,575
def node_nth_child(self, node, n): """ Retrieves the nth child of the node. @param node: The parent node, or None to look at children of the virtual_root. """ #we return the nth good children ! if not node: if len(self.virtual_root) > n: to_id = self.virtual_root[n] toreturn = self.get_node(to_id)
def node_nth_child(self, node, n): """ Retrieves the nth child of the node. @param node: The parent node, or None to look at children of the virtual_root. """ #we return the nth good children ! if not node: if len(self.virtual_root) > n: to_id = self.virtual_root[n] toreturn = self.get_node(to_id)
463,576
def __root_update(self,tid,inroot): if inroot: if tid not in self.virtual_root: self.virtual_root.append(tid) #We will also update the children of that node if not self.flat: node = self.get_node(tid) nc = self.node_n_children(node) i = 0 while i < nc: ch = self.node_nth_child(node,i) chid = ch.get_id() if chid in self...
def __root_update(self,tid,inroot): if inroot: if tid not in self.virtual_root: self.virtual_root.append(tid) #We will also update the children of that node if not self.flat: node = self.get_node(tid) nc = self.node_n_children(node) i = 0 while i < nc: ch = self.node_nth_child(node,i) chid = ch.get_id() if chid in self...
463,577
def __root_update(self,tid,inroot): if inroot: if tid not in self.virtual_root: self.virtual_root.append(tid) #We will also update the children of that node if not self.flat: node = self.get_node(tid) nc = self.node_n_children(node) i = 0 while i < nc: ch = self.node_nth_child(node,i) chid = ch.get_id() if chid in self...
def __root_update(self,tid,inroot): if inroot: if tid not in self.virtual_root: self.virtual_root.append(tid) #We will also update the children of that node if not self.flat: node = self.get_node(tid) nc = self.node_n_children(node) i = 0 while i < nc: ch = self.node_nth_child(node,i) chid = ch.get_id() if chid in self...
463,578
def lp_login(): cachedir = os.path.expanduser('~/.cache/launchpadlib/') if not os.path.isdir(cachedir): os.makedirs(cachedir) creddir = os.path.expanduser("~/.cache/lp_credentials") if not os.path.isdir(creddir): os.makedirs(creddir) os.chmod(creddir, 0700) try: credfile = open(os.path.join(creddir, 'close_launchpad_bu...
def lp_login(): cachedir = os.path.expanduser('~/.cache/launchpadlib/') if not os.path.isdir(cachedir): os.makedirs(cachedir) creddir = os.path.expanduser("~/.cache/lp_credentials") if not os.path.isdir(creddir): os.makedirs(creddir) os.chmod(creddir, 0700) try: credfile = open(os.path.join(creddir, 'close_launchpad_bu...
463,579
def text_label_size_allocate(widget, rect): """Lets label resize correctly while wrapping text.""" widget.set_size_request(rect.width, -1)
def text_label_size_allocate(widget, rect): """Lets label resize correctly while wrapping text.""" widget.set_size_request(rect.width, -1)
463,580
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
463,581
def add_child(self, tid): """Add a subtask to this task
def add_child(self, tid): """Add a subtask to this task
463,582
def test_add_parent(self): view = self.tree.get_viewtree(refresh = True) node = DummyNode('temp') node.add_color('blue')
def test_add_parent(self): view = self.tree.get_viewtree(refresh = True) node = DummyNode('temp') node.add_color('blue')
463,583
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,584
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,585
def set_complex_title(self,text,tags=[]): due_date = no_date defer_date = no_date if text: # 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.amk.ca/python/howto/regex/regex.html # ~~~~Invernizzi for match in re.findall(...
def set_complex_title(self,text,tags=[]): due_date = no_date defer_date = no_date if text: # 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.amk.ca/python/howto/regex/regex.html # ~~~~Invernizzi for match in re.findall(...
463,586
def set_complex_title(self,text,tags=[]): due_date = no_date defer_date = no_date if text: # 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.amk.ca/python/howto/regex/regex.html # ~~~~Invernizzi for match in re.findall(...
def set_complex_title(self,text,tags=[]): due_date = no_date defer_date = no_date if text: # 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.amk.ca/python/howto/regex/regex.html # ~~~~Invernizzi for match in re.findall(...
463,587
def get_selected_tasks(self, tv=None): """Returns a list of 'uids' of the selected tasks, and the corresponding iters
def get_selected_tasks(self, tv=None): """Returns a list of 'uids' of the selected tasks, and the corresponding iters
463,588
def node_nth_child(self, nid, n): toreturn = None if self.static: node = self.__get_static_node(nid) if node: toreturn = node.get_nth_child(n) else: toreturn = self.__ft.node_nth_child(nid,n) return toreturn
def node_nth_child(self, nid, n): toreturn = None if self.static: node = self.__get_static_node(nid) if node and node.get_n_children() > n: toreturn = node.get_nth_child(n) else: toreturn = self.__ft.node_nth_child(nid,n) return toreturn
463,589
def node_nth_child(self, nid, n): toreturn = None if self.static: node = self.__get_static_node(nid) if node: toreturn = node.get_nth_child(n) else: toreturn = self.__ft.node_nth_child(nid,n) return toreturn
def node_nth_child(self, nid, n): toreturn = None if self.static: node = self.__get_static_node(nid) if node: toreturn = node.get_nth_child(n) else: raise ValueError("node %s has less than %s nodes" %(nid,n)) else: if self.__ft.node_n_children(nid) <= n: raise ValueError("viewtree has less than %s nodes" %n) toreturn =...
463,590
def _internal_flush_all_tasks(): backend = self.backends[backend_id] for task_id in self.requester.get_all_tasks_list(): if backend.should_task_id_be_stored(task_id): backend.queue_set_task(None, task_id) else: backend.queue_remove_task(None, task_id)
def _internal_flush_all_tasks(): backend = self.backends[backend_id] for task_id in self.requester.get_all_tasks_list(): if backend.should_task_id_be_stored(task_id): backend.queue_set_task(None, task_id) else: backend.queue_remove_task(None, task_id)
463,591
def _celldatafunction(self, column, cell, model, iter): col = None if self.bg_color_enable: bgcolor = column.get_tree_view().get_style().base[gtk.STATE_NORMAL] if iter: value = model.get_value(iter, COL_TAGS) if value: col = colors.background_color(value, bgcolor) cell.set_property("cell-background", col)
def _celldatafunction(self, column, cell, model, iter): col = None if self.bg_color_enable: bgcolor = column.get_tree_view().get_style().base[gtk.STATE_NORMAL] if iter and model.iter_is_valid(iter): value = model.get_value(iter, COL_TAGS) if value: col = colors.background_color(value, bgcolor) cell.set_property("cell-b...
463,592
def test_get_canonical_date(self): ''' Tests for "get_canonical_date" ''' for str in ["1985-03-29", "now", "soon", "later", ""]: date = get_canonical_date(str) self.assertEqual(date.__str__(), str)
def test_get_canonical_date(self): ''' Tests for "get_canonical_date" ''' for str in ["1985-03-29", "now", "soon", "later", ""]: date = get_canonical_date(str) self.assertEqual(date.__str__(), str)
463,593
def __init__(self, req, view_manager): # Attach the object to D-Bus self.bus = dbus.SessionBus() bus_name = dbus.service.BusName(BUSNAME, bus=self.bus) dbus.service.Object.__init__(self, bus_name, BUSFACE) self.req = req self.view_manager = view_manager
def __init__(self, req, view_manager): # Attach the object to D-Bus self.bus = dbus.SessionBus() bus_name = dbus.service.BusName(BUSNAME, bus=self.bus) dbus.service.Object.__init__(self, bus_name, BUSFACE) self.req = req self.view_manager = view_manager
463,594
def get_tasks(self): # Retrieve a list of task data dicts return [self.get_task(id) for id in self.get_task_ids()]
def get_tasks(self): # Retrieve a list of task data dicts return [self.get_task(id) for id in self.get_task_ids()]
463,595
def selecter(treemodelsort, path, iter, self): self.__last_quick_added_tid_event.wait() treeview = self.vtree_panes['active'] liblarch_path = treemodelsort.convert_path_to_child_path(path) tid = self.activetree.get_node_for_path(liblarch_path) if self.__last_quick_added_tid == tid: #this is the correct task treemodelso...
def selecter(treemodelsort, path, iter, self): self.__last_quick_added_tid_event.wait() treeview = self.vtree_panes['active'] liblarch_path = treemodelsort.convert_path_to_child_path(path) tid = self.activetree.get_node_for_path(liblarch_path) if self.__last_quick_added_tid == tid: #this is the correct task treemodelso...
463,596
def on_quickadd_activate(self, widget): text = unicode(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. ht...
def on_quickadd_activate(self, widget): text = unicode(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. ht...
463,597
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,598
def get(self,node,path): key = self.__key(node,path) toreturn = None deleted = False if node and self.__store.has_key(key): stored_iter = self.__store[key] stored_node = stored_iter.get_node() if stored_node == node: toreturn = stored_iter elif stored_node: print "path %s is now %s (and it was %s)" %(str(path),node.get...
def get(self,node,path): key = self.__key(node,path) toreturn = None deleted = False if node and self.__store.has_key(key): stored_iter = self.__store[key] stored_node = stored_iter.get_node() if stored_node == node: toreturn = stored_iter elif stored_node: print "path %s is now %s (and it was %s)" %(str(path),node.get...
463,599