rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
date = "%i-%i-%i" % (t.year, t.month, t.day)
date = t.isoformat()
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...
21386f519458bd40a8acbcc922fbfc77d264ee07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/21386f519458bd40a8acbcc922fbfc77d264ee07/browser.py
if date == no_date:
if date == str(no_date):
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...
21386f519458bd40a8acbcc922fbfc77d264ee07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/21386f519458bd40a8acbcc922fbfc77d264ee07/browser.py
thread = threading.Thread(target = selecter, args = (treemodelsort, path, iter, self)) thread.setDaemon(True) thread.start()
gobject.idle_add(selecter,treemodelsort, path, iter, self)
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...
f7cb6f570bb62ee0b8c34a964fd9d4aa37c03c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/f7cb6f570bb62ee0b8c34a964fd9d4aa37c03c58/browser.py
Return None if no path for that Node.
Return an empty list if no path for that Node.
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...
e33ac6b8a1de18be78faa870aa9bac113a505e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e33ac6b8a1de18be78faa870aa9bac113a505e1c/filteredtree.py
return None
return toreturn
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...
e33ac6b8a1de18be78faa870aa9bac113a505e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e33ac6b8a1de18be78faa870aa9bac113a505e1c/filteredtree.py
toreturn = None
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...
e33ac6b8a1de18be78faa870aa9bac113a505e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e33ac6b8a1de18be78faa870aa9bac113a505e1c/filteredtree.py
if len(toreturn) == 0: return None else: return toreturn
return toreturn
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...
e33ac6b8a1de18be78faa870aa9bac113a505e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e33ac6b8a1de18be78faa870aa9bac113a505e1c/filteredtree.py
task = plugin_api.get_task()
task = plugin_api.get_ui().get_task()
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...
dfd87ad1d24fb79f33748d3fc0f46eb449fecfd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/dfd87ad1d24fb79f33748d3fc0f46eb449fecfd0/hamster.py
desc = store.get_value(iter, PLUGINS_COL_DESC)
desc = store.get_value(iter, PLUGINS_COL_SHORT_DESC)
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(...
9dab4bfafede334838a016c37e2a65dd78337a62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/9dab4bfafede334838a016c37e2a65dd78337a62/preferences.py
for task in self.tasks: if self.req.get_task(task).get_status() == "Active":
for tid in self.tasks: task = self.req.get_task(tid) if task and task.get_status() == "Active":
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
1530ca3a6e1130f258e22483e49504d0ac51a2d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/1530ca3a6e1130f258e22483e49504d0ac51a2d6/tagstore.py
plugin_api.remove_toolbar_item(self.tb_button) plugin_api.remove_toolbar_item(self.separator)
plugin_api.remove_task_toolbar_item(self.tb_button) plugin_api.remove_task_toolbar_item(self.separator)
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
47f670a07ff8c64059e0488c6107126785cebec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/47f670a07ff8c64059e0488c6107126785cebec4/import_json.py
self.tagrefresh(sender=sender,tagname=tag.get_name())
if tag: 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())
044138c71c031fcd68a856b33374ba800028cd65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/044138c71c031fcd68a856b33374ba800028cd65/tagtree.py
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()...
f9e7604833bed40ad14d215fd642f9b55cbc8448 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/f9e7604833bed40ad14d215fd642f9b55cbc8448/gtg.py
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...
f9e7604833bed40ad14d215fd642f9b55cbc8448 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/f9e7604833bed40ad14d215fd642f9b55cbc8448/gtg.py
'GTG.plugins.rtm_sync': ['rtm.ui', 'pyrtm/rtm.py',
'GTG.plugins.rtm_sync': ['rtm.ui', 'pyrtm/rtm.py','pyrtm/__init__.py',
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
33c6aade8d52042b7e01a899dcddefebff38ee9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/33c6aade8d52042b7e01a899dcddefebff38ee9d/setup.py
if tag[0] != '@': tag = '@' + tag
tag = '@' + tag
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...
1f3b3d407b6db6d4874635746e2361af77ae271b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/1f3b3d407b6db6d4874635746e2361af77ae271b/gtgTask.py
browser = None,
view_manager = None,
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_...
ce317d939bd56caa13068f5b7e27e4d7e8096d50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/ce317d939bd56caa13068f5b7e27e4d7e8096d50/editor.py
destination_tid = model.get_value(destination_iter, COL_TID)
if destination_iter: destination_tid = model.get_value(destination_iter, COL_TID) else: destination_tid = None
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...
098135de5d9a84f4fc6bf973d0a1efcf8d66c05b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/098135de5d9a84f4fc6bf973d0a1efcf8d66c05b/tasktree.py
if new_par_tag: self._update_tag_from_name(new_par_tag.get_name()) if old_par_tag: tasks_count = old_par_tag.get_tasks_nbr() if tasks_count > 0: self._update_tag_from_name(old_par_tag.get_name()) else: self.row_deleted(self.tree.get_path_for_node(old_par_tag))
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...
2e35d386e09e04bb1dd266f526e7bc5ac12306a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/2e35d386e09e04bb1dd266f526e7bc5ac12306a5/tagtree.py
for k in self.__cllbcks.get(signal_name,[]):
for k in self.__cllbcks.get(signal_name, {}).copy():
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)...
def3a694e857728f29d6aa1cadc7060cf9bd3bac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/def3a694e857728f29d6aa1cadc7060cf9bd3bac/__init__.py
if stri == _("now"):
if stri == _("now") or stri == "now":
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...
d4bb8c5640e754a91caa95ae7274bb727ec79759 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/d4bb8c5640e754a91caa95ae7274bb727ec79759/dates.py
elif stri == _("soon"):
elif stri == _("soon") or stri == "soon":
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...
d4bb8c5640e754a91caa95ae7274bb727ec79759 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/d4bb8c5640e754a91caa95ae7274bb727ec79759/dates.py
elif stri == _("later"):
elif stri == _("later") or stri == "later":
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...
d4bb8c5640e754a91caa95ae7274bb727ec79759 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/d4bb8c5640e754a91caa95ae7274bb727ec79759/dates.py
self.color_active = False
def __init__(self, requester, config, logger=None):
59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py
self.set_target_cursor()
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....
59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py
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...
59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py
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) self.tag_active = False
59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py
self.tag_active = True
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...
59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py
task_to_scroll_to = None
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...
268b77a22f21dc21916365ceced213ecabad6d85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/268b77a22f21dc21916365ceced213ecabad6d85/browser.py
task_to_scroll_to = uid if task_to_scroll_to != None: gobject.idle_add(self.ctask_tv.scroll_to_task, task_to_scroll_to)
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...
268b77a22f21dc21916365ceced213ecabad6d85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/268b77a22f21dc21916365ceced213ecabad6d85/browser.py
task = self.req.get_task(task_id) for tag in task.get_tags(): self._update_tag_from_name(tag.get_name())
self._update_all_tasks_and_no_tags() self.update_tags_for_task(task_id)
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())
6ffd3ae35c1e4a2ce044394c205d138b6a089988 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/6ffd3ae35c1e4a2ce044394c205d138b6a089988/tagtree.py
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 self.separator = gtk.SeparatorToolItem() self.task_separator = None
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
plugin_api.add_toolbar_item(self.separator)
self.button.show()
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...
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
self.task_separator = plugin_api.add_task_toolbar_item(gtk.SeparatorToolItem()) self.taskbutton = plugin_api.add_task_toolbar_item(button)
button.show() self.taskbutton = plugin_api.add_toolbar_item(button)
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...
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
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_toolbar_item(self.taskbutton)
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(...
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
self.sendTask(plugin_api.get_selected_task())
task_id = plugin_api.get_ui().get_selected_task() self.sendTask(plugin_api.get_requester().get_task(task_id))
def browser_cb(self, widget, plugin_api): self.sendTask(plugin_api.get_selected_task())
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
self.sendTask(plugin_api.get_task())
task = plugin_api.get_ui().get_task() self.sendTask(task)
def task_cb(self, widget, plugin_api): self.sendTask(plugin_api.get_task())
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
def configure_dialog(self, plugin_apis, manager_dialog):
def configure_dialog(self, manager_dialog):
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...
5e6fb402fb33286aae28aa13494dec55cd437832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5e6fb402fb33286aae28aa13494dec55cd437832/hamster.py
self.tag_active = True
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...
95af6a0cb4dff6ed554c79458c71a588ce968610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/95af6a0cb4dff6ed554c79458c71a588ce968610/browser.py
self.__root_update(curn,False)
self.__root_update(cid,False)
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)
d08ba8d098db9929944527c67a5ef309ebab16cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/d08ba8d098db9929944527c67a5ef309ebab16cf/filteredtree.py
print "Something happened last time we tried to write file. Temp file found, using it as normal."
Log.debug("Something happened to the tags file. Using backup")
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...
826009aff16714bb6387cc1fa9478b0a5fd3f23b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/826009aff16714bb6387cc1fa9478b0a5fd3f23b/cleanxml.py
print "Error parsing XML file %s: %s" %(zefile, msg)
Log.debug("Error parsing XML file %s: %s" %(zefile, msg))
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...
826009aff16714bb6387cc1fa9478b0a5fd3f23b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/826009aff16714bb6387cc1fa9478b0a5fd3f23b/cleanxml.py
print "Something happened last time we tried to write file. Temp file found, using it as normal."
Log.debug("Something happened to the tags file. Using backup")
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...
826009aff16714bb6387cc1fa9478b0a5fd3f23b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/826009aff16714bb6387cc1fa9478b0a5fd3f23b/cleanxml.py
self.tag_completion.set_text_column(2)
self.tag_completion.set_text_column(1) self.tag_completion.set_match_func(self.tag_match_func, 1)
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)
96a72610e4d493c36c8f7ce06d745f32907f71ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/96a72610e4d493c36c8f7ce06d745f32907f71ff/browser.py
return cmp(t2_order, t1_order)
return cmp(t2_order, t1_order) def tag_match_func(self, completion, key, iter, column): model = completion.get_model() text = model.get_value(iter, column) text = text.lower() if text == "tg-tags-all" or text == "tg-tags-sep" or \ text =="tg-tags-none": return False elif text.startswith(key): return True else: re...
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())...
96a72610e4d493c36c8f7ce06d745f32907f71ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/96a72610e4d493c36c8f7ce06d745f32907f71ff/browser.py
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]
96a72610e4d493c36c8f7ce06d745f32907f71ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/96a72610e4d493c36c8f7ce06d745f32907f71ff/browser.py
task.add_parent(uid)
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()
b202d86567910a6151a0c43fb793f37342a163f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/b202d86567910a6151a0c43fb793f37342a163f5/browser.py
parent = tag.get_attribute('parent') if parent: pnode=self.new_tag(parent) tag.set_parent(pnode)
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...
429e68e84fd839a9025a07e2c34ba00b5cf70a52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/429e68e84fd839a9025a07e2c34ba00b5cf70a52/tagstore.py
attr = t.get_all_attributes(butname=True)
attr = t.get_all_attributes(butname = True, withparent = True)
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...
429e68e84fd839a9025a07e2c34ba00b5cf70a52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/429e68e84fd839a9025a07e2c34ba00b5cf70a52/tagstore.py
def get_all_attributes(self, butname=False):
def get_all_attributes(self, butname=False, withparent = False):
def get_all_attributes(self, butname=False): """Return a list of all attribute names.
429e68e84fd839a9025a07e2c34ba00b5cf70a52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/429e68e84fd839a9025a07e2c34ba00b5cf70a52/tagstore.py
task = self.req.get_task(tid) if task: task.delete() else: print "trying to delete task already deleted"
task = self.req.delete_task(tid)
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 = []
d968784f3250143537a8403a7f3b5540eccf5d58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/d968784f3250143537a8403a7f3b5540eccf5d58/delete_dialog.py
for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
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) for tag in task.get_tags(): self.tagrefresh(sender=sender,tagname=tag.get_name())
1a2c9465cf3aa04be19ffe9f9fa2a79d52e01664 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/1a2c9465cf3aa04be19ffe9f9fa2a79d52e01664/tagtree.py
return self.on_iter_nth_child(rowref,0)
nid = rowref.get_node() if self.tree.node_n_children(nid) > 0: return self.on_iter_nth_child(rowref,0) else: return None
def on_iter_children(self, rowref): return self.on_iter_nth_child(rowref,0)
25accf45853d3ad320eb897bdb0332e9bf7143d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/25accf45853d3ad320eb897bdb0332e9bf7143d8/treemodel.py
text5 += _("You can find the Plugin Manager by selecting Plugins > Plugin Preferences on the menu.")
text5 += _("You can find the Plugin Manager by selecting Edit in the Menu Bar, then clicking Preferences. You will then see a tab labeled Plugins.")
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...
b87a376b9ae0db0cf91cab039ac7526817eb5ecc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/b87a376b9ae0db0cf91cab039ac7526817eb5ecc/firstrun_tasks.py
if child.can_be_deleted: child.tag_added(tagname)
child.add_tag(tagname)
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...
79f59ae03359af0219af8d33af0379ab63beac7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/79f59ae03359af0219af8d33af0379ab63beac7d/task.py
menu_item.get_children()[0].set_label(task.get_title())
menu_item.get_children()[0].set_label(title)
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...
5ff5914b85a49c1326c31c9073f84ad78d4ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5ff5914b85a49c1326c31c9073f84ad78d4ae722/notification_area.py
title = task.get_title()[0:self.MAX_TITLE_LEN] if len(title)== self.MAX_TITLE_LEN: title = title + "..."
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...
5ff5914b85a49c1326c31c9073f84ad78d4ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5ff5914b85a49c1326c31c9073f84ad78d4ae722/notification_area.py
self.__toolbar = self.__builder.get_object('task_tb')
self.__toolbar = self.__builder.get_object('task_toolbar') print "TASKBROW", self.__toolbar
def __init__(self, requester, view_manager, taskeditor = None): """ Construct a PluginAPI object.
52093110b50e0d3bd684063209af0693a97d847e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/52093110b50e0d3bd684063209af0693a97d847e/api.py
self._mark_today_in_bold()
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...
360c7afcd965fcb916ce58abbba11b9f0e7d048e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/360c7afcd965fcb916ce58abbba11b9f0e7d048e/editor.py
selected_tags = self.get_selected_tags()[0]
selected_tags = self.get_selected_tags()
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...
97495bcbc21cd28c372e999fa4ee213282158099 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/97495bcbc21cd28c372e999fa4ee213282158099/browser.py
today = date_today()
today = datetime.datetime.now().date()
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 =...
04a28387f90180bd118e1191697be093a66f7fa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/04a28387f90180bd118e1191697be093a66f7fa2/reaper.py
to_remove = filter(lambda t: t.get_closed_date() < today, closed_tasks)
delta = datetime.timedelta(days = self.preferences["max_days"]) to_remove = filter(lambda t: t.get_closed_date().to_py_date() < today -delta,\ closed_tasks)
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 =...
04a28387f90180bd118e1191697be093a66f7fa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/04a28387f90180bd118e1191697be093a66f7fa2/reaper.py
if self.logger: self.logger.debug ("rtm task has no title")
self.__log("rtm task has no title: " + str(self.task))
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 ""
385896725749bda32bc586423d32c76bc4ffee02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/385896725749bda32bc586423d32c76bc4ffee02/rtmTask.py
if type(self.task.task) == type(list): return getattr(self.task.task[0], attr) else:
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))
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)
385896725749bda32bc586423d32c76bc4ffee02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/385896725749bda32bc586423d32c76bc4ffee02/rtmTask.py
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...
390884d8a7ede5c01c4231f95453224fbbeba30c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/390884d8a7ede5c01c4231f95453224fbbeba30c/tree.py
self.new_relationship(rel[0],rel[1])
self.new_relationship(rel[0],rel[1],refresh_nodes=False)
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...
390884d8a7ede5c01c4231f95453224fbbeba30c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/390884d8a7ede5c01c4231f95453224fbbeba30c/tree.py
def new_relationship(self,parent_id,child_id):
def new_relationship(self,parent_id,child_id,refresh_nodes=True):
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(...
390884d8a7ede5c01c4231f95453224fbbeba30c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/390884d8a7ede5c01c4231f95453224fbbeba30c/tree.py
if toreturn:
if refresh_nodes and toreturn:
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)
390884d8a7ede5c01c4231f95453224fbbeba30c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/390884d8a7ede5c01c4231f95453224fbbeba30c/tree.py
'on_quit_button_clicked': self.on_close,
'on_close_button_clicked': self.on_close,
def _setup_signal_connections(self, builder): ''' Creates some GTK signals connections
157477ec15a6b62d07e58cf24abf7a1cac560331 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/157477ec15a6b62d07e58cf24abf7a1cac560331/__init__.py
def on_get_iter(self, path): #print "on_get_iter: %s" % str(path) return self.tree.get_node_for_path(path)
0d9a60cdedf2bb32d131e67f724fed6636c192d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/0d9a60cdedf2bb32d131e67f724fed6636c192d4/tagtree.py
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
if node: tid = node.get_id() parent_node = node.get_parent() if not parent_node: parent_node = self.tree.get_root() try: idx = parent_node.get_child_index(tid) + 1 nextnode = parent_node.get_nth_child(idx) except ValueError: nextnode = None else: nextnode = root return nextnode
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
0d9a60cdedf2bb32d131e67f724fed6636c192d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/0d9a60cdedf2bb32d131e67f724fed6636c192d4/tagtree.py
self.row_inserted(tag_path, tag_iter)
self.tree.print_tree()
def add_tag(self, sender, tname):
0d9a60cdedf2bb32d131e67f724fed6636c192d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/0d9a60cdedf2bb32d131e67f724fed6636c192d4/tagtree.py
node.set_parent(parent)
node.set_parent(parent.get_id())
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...
552bcf3ba4e2ebf0694d3c3d95bad462531f9d2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/552bcf3ba4e2ebf0694d3c3d95bad462531f9d2b/tree.py
class ActiveTaskTreeView(TaskTreeView): """TreeView for display of a list of task. Handles DnD primitives too.""" DND_TARGETS = [ ('gtg/task-iter-str', gtk.TARGET_SAME_WIDGET, 0) ] def __init__(self, requester): TaskTreeView.__init__(self, requester) self._init_tree_view() self.get_selection().set_mode(gtk.SELECTIO...
def set_column(self,index,col): self.__columns[index] = col
1f0ed5e60d735d3c9287abbc412b4e17e5fabcb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/1f0ed5e60d735d3c9287abbc412b4e17e5fabcb6/tasktree.py
print "*** iter %s" %iter
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...
1f0ed5e60d735d3c9287abbc412b4e17e5fabcb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/1f0ed5e60d735d3c9287abbc412b4e17e5fabcb6/tasktree.py
task = self.plugin_api.get_requester().new_task(pid=None, tags=None, newtask=False) task.title = title task.content = "<content>%s</content>" % (reference)
task = self.plugin_api.get_requester().new_task(pid=None, tags=None, newtask=True) task.set_title(title) task.set_text(reference) task.sync()
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
e8c2a30465f707e5185f93da672c9961de758c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e8c2a30465f707e5185f93da672c9961de758c64/import_json.py
if cid in self.virtual_root: print "*** children %s of task %s is also in VR" \ %(cid,node.get_id()) print " we will correct that error now" self.__root_update(cid,False)
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)
39624ee69bcee91680d3114ab673257dbfb4ddc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/39624ee69bcee91680d3114ab673257dbfb4ddc2/filteredtree.py
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.virtual_root: self.__root_update(chid,False) i += 1
children_update = True
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...
39624ee69bcee91680d3114ab673257dbfb4ddc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/39624ee69bcee91680d3114ab673257dbfb4ddc2/filteredtree.py
else: children_update = True if not self.flat and children_update: node = self.get_node(tid) nc = self.node_n_children(node) if tid in DEBUG_TID: print "updating %s childrens of node %s" %(nc,tid) i = 0 while i < nc: ch = self.node_nth_child(node,i) chid = ch.get_id() if chid in self.virtual_root: if tid in DEBUG_...
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...
39624ee69bcee91680d3114ab673257dbfb4ddc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/39624ee69bcee91680d3114ab673257dbfb4ddc2/filteredtree.py
bug = launchpad.bugs[bugno] for task in bug.bug_tasks: if task.bug_target_name == 'gtg' and task.status == 'Fix Committed': task.status = 'Fix Released' task.lp_save() print 'Bug %s marked as Fix Released' % bugno
try: bug = launchpad.bugs[bugno] for task in bug.bug_tasks: if task.bug_target_name == 'gtg' and task.status == 'Fix Committed': print task.status task.status = 'Fix Released' task.lp_save() print 'Bug %s marked as Fix Released' % bugno except: print 'UNABLE TO PROCESS BUG pass
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...
264361e08bfad382fa7d39cbac9831fe905ad36e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/264361e08bfad382fa7d39cbac9831fe905ad36e/close_launchpad_bugs.py
dialog.get_content_area().pack_start(expander, False)
expander.connect('activate', on_expanded) dialog.get_content_area().pack_start(expander, True)
def text_label_size_allocate(widget, rect): """Lets label resize correctly while wrapping text.""" widget.set_size_request(rect.width, -1)
601eb5d6da746c447fb7680e6bd0b73d09850ad1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/601eb5d6da746c447fb7680e6bd0b73d09850ad1/gtkcrashhandler.py
task.content = reference
task.content = "<content>%s</content>" % (reference)
def import_tasks(self, widget): username = self.usernames[self.select_username.get_active()] re_dehtml = re.compile(r'<.*?>')
6bf620a3e7675b77b2c2056bef20c436ea12f5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/6bf620a3e7675b77b2c2056bef20c436ea12f5b5/import_json.py
return True else:
self.sync() child.sync() return True else: Log.debug("child addition failed")
def add_child(self, tid): """Add a subtask to this task
79a2df0977d9da6f3117de3977fe65b30e7ebd0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/79a2df0977d9da6f3117de3977fe65b30e7ebd0d/task.py
self.tree.add_node(node, parent_id = '0')
self.assertSignal(self.view, \ 'node-modified-inview', \ self.tree.add_node, 2)(node, parent_id = '0') self.assert_(('temp',) in self.recorded_signals['node-modified-inview']) self.assert_(('0',) in self.recorded_signals['node-modified-inview'])
def test_add_parent(self): view = self.tree.get_viewtree(refresh = True) node = DummyNode('temp') node.add_color('blue')
c073ff4667160cf47c0c01dcc56265e0e4f9e5cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/c073ff4667160cf47c0c01dcc56265e0e4f9e5cd/test_liblarch.py
self.donebutton.set_label(GnomeConfig.MARK_DONE) self.donebutton.set_tooltip_text(GnomeConfig.MARK_DONE_TOOLTIP)
def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view.
3a339781c8f494d9f853cee37b851aae1baaf64c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/3a339781c8f494d9f853cee37b851aae1baaf64c/browser.py
self.donebutton.set_icon_name("gtg-task-undone")
self.dismiss_mi.set_label(GnomeConfig.MARK_DISMISS)
def on_taskdone_cursor_changed(self, selection=None): """Called when selection changes in closed task view.
3a339781c8f494d9f853cee37b851aae1baaf64c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/3a339781c8f494d9f853cee37b851aae1baaf64c/browser.py
tags.append(GTG.core.tagstore.Tag(match, self.req))
tags.append(match)
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(...
330f3d0ae5af754bb15672d99c8036780aebe1bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/330f3d0ae5af754bb15672d99c8036780aebe1bc/task.py
tags.append(GTG.core.tagstore.Tag(tag, self.req))
tags.append(tag)
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(...
330f3d0ae5af754bb15672d99c8036780aebe1bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/330f3d0ae5af754bb15672d99c8036780aebe1bc/task.py
ids = [None]
ids = []
def get_selected_tasks(self, tv=None): """Returns a list of 'uids' of the selected tasks, and the corresponding iters
73e16e180f5b6a993f42dc635f6dee4f6b67557f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/73e16e180f5b6a993f42dc635f6dee4f6b67557f/browser.py
if node:
if node and node.get_n_children() > n:
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
161ab217adcbfc6fc628b674d568d093c4baab0b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/161ab217adcbfc6fc628b674d568d093c4baab0b/__init__.py
else:
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)
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
161ab217adcbfc6fc628b674d568d093c4baab0b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/161ab217adcbfc6fc628b674d568d093c4baab0b/__init__.py
if backend.should_task_id_be_stored(task_id): backend.queue_set_task(None, task_id) else: backend.queue_remove_task(None, task_id)
backend.queue_set_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)
fe2120027151b4147edd0963cb3cf7a7a05ed9fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/fe2120027151b4147edd0963cb3cf7a7a05ed9fe/datastore.py
if iter:
if iter and model.iter_is_valid(iter):
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)
0ed38945157f41b26bfa0309e52c905e4e1ab86d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/0ed38945157f41b26bfa0309e52c905e4e1ab86d/tasktree.py
for str in ["1985-03-29", "now", "soon", "later", ""]: date = get_canonical_date(str) self.assertEqual(date.__str__(), str)
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" ''' for str in ["1985-03-29", "now", "soon", "later", ""]: date = get_canonical_date(str) self.assertEqual(date.__str__(), str)
996764d23efe551bbd47c44ee64e595407afb2fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/996764d23efe551bbd47c44ee64e595407afb2fc/test_dates.py
@dbus.service.method(BUSNAME,in_signature="s") def get_task_ids(self, status_string): status = [s.strip() for s in status_string.split(',')] status = [unicodedata.normalize('NFKD', s).encode('ascii','ignore') \ for s in status] return self.req.get_tasks_list(status = status)
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
3b56c1efd797a6f7c9b6ff86740418a4df901d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/3b56c1efd797a6f7c9b6ff86740418a4df901d7d/dbuswrapper.py
return [self.get_task(id) for id in self.get_task_ids()]
return self.get_tasks_filtered(['all'])
def get_tasks(self): # Retrieve a list of task data dicts return [self.get_task(id) for id in self.get_task_ids()]
3b56c1efd797a6f7c9b6ff86740418a4df901d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/3b56c1efd797a6f7c9b6ff86740418a4df901d7d/dbuswrapper.py
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...
9a1b477c783a844b4792c84274c66e17a3d82444 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/9a1b477c783a844b4792c84274c66e17a3d82444/browser.py
task = self.req.new_task(tags=[t.get_name() for t in tags], newtask=True)
task = self.req.new_task( newtask=True) for tag in tags: task.add_tag(tag.get_name())
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...
c14dd3b1fe84bad6d4cc7ea0b6b33cd2a1f2611d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/c14dd3b1fe84bad6d4cc7ea0b6b33cd2a1f2611d/browser.py
label = self.builder.get_object("label1")
label = self.builder.get_object("label1")
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...
200069c9f8fc25f4f212f86f35aaaf0a4cb138ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/200069c9f8fc25f4f212f86f35aaaf0a4cb138ef/browser.py
self.__model.add_task(None,deleted.get_id())
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...
845d9e7d9924df2f13203db97f51bfc66aa0b000 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/845d9e7d9924df2f13203db97f51bfc66aa0b000/tasktree.py