bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _set_padding(self, val): old_padding = self.padding
def _set_padding(self, val): old_padding = self.padding
463,400
def default_filter(kw1): kw = {} for (k,v) in kw1.items(): if type(v) == type(()): if v[0] != v[1]: kw[k] = v[0] else: kw[k] = v return kw
def default_filter(kw1): kw = {} for (k,v) in kw1.items(): if type(v) == type(()): if v[0] != v[1]: kw[k] = v[0] else: kw[k] = v return kw
463,401
def __init__(self, size): basecore2d.GraphicsContextBase.__init__(self) self.size = size self._height = size[1] self.contents = cStringIO.StringIO() self._clipmap = {} self.clip_id = None
def __init__(self, size): basecore2d.GraphicsContextBase.__init__(self) self.size = size self._height = size[1] self.contents = cStringIO.StringIO() self._clipmap = {} self.clip_id = None
463,402
def clear(self, size): # TODO: clear the contents pass
def clear(self): # TODO: clear the contents pass
463,403
def save(self, filename): f = open(filename, 'w') ext = os.path.splitext(filename)[1] if ext == '.svg': template = xmltemplate height, width = self.size contents = self.contents.getvalue().replace("<svg:", "<").replace("</svg:", "</") elif ext == '.html': height, width = self.size[0]*3, self.size[1]*3 contents = self.c...
def save(self, filename): f = open(filename, 'w') ext = os.path.splitext(filename)[1] if ext == '.svg': template = xmltemplate width, height = self.size contents = self.contents.getvalue().replace("<svg:", "<").replace("</svg:", "</") elif ext == '.html': height, width = self.size[0]*3, self.size[1]*3 contents = self.c...
463,404
def save(self, filename): f = open(filename, 'w') ext = os.path.splitext(filename)[1] if ext == '.svg': template = xmltemplate height, width = self.size contents = self.contents.getvalue().replace("<svg:", "<").replace("</svg:", "</") elif ext == '.html': height, width = self.size[0]*3, self.size[1]*3 contents = self.c...
def save(self, filename): f = open(filename, 'w') ext = os.path.splitext(filename)[1] if ext == '.svg': template = xmltemplate height, width = self.size contents = self.contents.getvalue().replace("<svg:", "<").replace("</svg:", "</") elif ext == '.html': width, height = self.size[0]*3, self.size[1]*3 contents = self.c...
463,405
def set_font(self, font): if font.face_name == '': font.face_name = 'Arial' self.face_name = font_face_map.get(font.face_name, font.face_name) self.font = pdfmetrics.Font(self.face_name, self.face_name, pdfmetrics.defaultEncoding) self.font_size = font.size
def set_font(self, font): if font.face_name == '': font.face_name = 'Arial' self.face_name = font_face_map.get(font.face_name, font.face_name) self.font = pdfmetrics.Font(self.face_name, self.face_name, pdfmetrics.defaultEncoding) self.font_size = font.size
463,406
def _draw_inset_border(self, gc, view_bounds=None, mode="default"): """ Draws the border of a component. Unlike the default Enable border, this one is drawn on the inside of the plot instead of around it. """ if not self.border_visible: return border_width = self.border_width gc.save_state() gc.set_line_width(border_...
def _draw_inset_border(self, gc, view_bounds=None, mode="default"): """ Draws the border of a component. Unlike the default Enable border, this one is drawn on the inside of the plot instead of around it. """ if not self.border_visible: return border_width = self.border_width gc.save_state() gc.set_line_width(border_...
463,407
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"): text_color = self.text_color_ highlight_color = self.highlight_color_ highlight_bgcolor = self.highlight_bgcolor_ padding = self.cell_padding
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"): text_color = self.text_color_ highlight_color = self.highlight_color_ highlight_bgcolor = self.highlight_bgcolor_ padding = self.cell_padding
463,408
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"): text_color = self.text_color_ highlight_color = self.highlight_color_ highlight_bgcolor = self.highlight_bgcolor_ padding = self.cell_padding
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"): text_color = self.text_color_ highlight_color = self.highlight_color_ highlight_bgcolor = self.highlight_bgcolor_ padding = self.cell_padding
463,409
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
463,410
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
463,411
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
def _draw_grid_lines(self, gc): gc.set_stroke_color(self.cell_border_color_) gc.set_line_dash(self.cell_border_style_) gc.set_line_width(self.cell_border_width)
463,412
def _compute_positions(self):
def _compute_positions(self):
463,413
def _update_bounds(self): if self.string_array is not None and len(self.string_array.shape) == 2: rows, cols = self.string_array.shape margin = 2*self.cell_padding + self.cell_border_width width, height = self._get_actual_cell_size() self.bounds = [ cols * (width + margin),# - self.cell_border_width, rows * (height + m...
def _update_bounds(self): if self.string_array is not None and len(self.string_array.shape) == 2: rows, cols = self.string_array.shape margin = 2*self.cell_padding + self.cell_border_width width, height = self._get_actual_cell_size() self.bounds = [ cols * (width + margin),# - self.cell_border_width, rows * (height + m...
463,414
def _set_focus ( self ): "Sets the keyboard focus to this window" if self.control == self.control.GetCapture(): self.control.SetFocus() return
def _set_focus ( self ): "Sets the keyboard focus to this window" self.control.SetFocus() return
463,415
def __init__(self, *args, **kwds): super(SuperTuple, self).__init__(*args, **kwds) for i, attr in enumerate(self.__class__.__names__): setattr(self, attr, self[i])
def __new__(cls, *args, **kwds): self = tuple.__new__(cls, *args, **kwds) for i, attr in enumerate(cls.__names__): setattr(self, attr, self[i])
463,416
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
463,417
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
463,418
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
463,419
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self)
463,420
def update_sub_results(self, new): if new is None: return self.caller_results.total_time = new.cum_time self.caller_results.records = new.callers self.callee_results._resort() self.caller_results.selected_record = self.caller_results.activated_record = None
def update_sub_results(self, new): if new is None: return self.caller_results.total_time = new.cum_time self.caller_results.records = new.callers self.callee_results._resort() self.caller_results.selected_record = self.caller_results.activated_record = None
463,421
def get_text_extent(self, text): """ Returns the width and height of the rendered text """ fm = self.gc.fontMetrics() rect = fm.boundingRect(text) return rect.width(), rect.height()
def get_text_extent(self, text): """ Returns the bounding rect of the rendered text """ fm = self.gc.fontMetrics() rect = fm.boundingRect(text) return rect.width(), rect.height()
463,422
def get_text_extent(self, text): """ Returns the width and height of the rendered text """ fm = self.gc.fontMetrics() rect = fm.boundingRect(text) return rect.width(), rect.height()
def get_text_extent(self, text): """ Returns the width and height of the rendered text """ fm = self.gc.fontMetrics() rect = fm.boundingRect(text) return rect.width(), rect.height()
463,423
def get_full_text_extent(self, text): """ Returns the width, height, descent and leading of the rendered text. """ fm = self.gc.fontMetrics() rect = fm.boundingRect(text) return rect.width(), rect.height(), -fm.descent(), fm.leading()
def get_full_text_extent(self, text): """ Backwards compatibility API over .get_text_extent() for Enable """ x1, y1, x2, y2 = self.get_text_extent(text) return x2, y2, y1, x1
463,424
def set_fill_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setFillColorRGB(r, g, b)
def set_fill_color(self,color): """ """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setFillColorRGB(r, g, b)
463,425
def set_fill_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setFillColorRGB(r, g, b)
def set_fill_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setFillColorRGB(r, g, b, a)
463,426
def set_stroke_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setStrokeColorRGB(r, g, b)
def set_stroke_color(self,color): """ """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setStrokeColorRGB(r, g, b)
463,427
def set_stroke_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setStrokeColorRGB(r, g, b)
def set_stroke_color(self,color): """ PDF currently ignores the alpha value """ r,g,b = color[:3] try: a = color[3] except IndexError: a = 1.0 self.gc.setStrokeColorRGB(r, g, b, a)
463,428
def set_alpha(self, alpha): """ """ msg = "set_alpha not implemented on PDF yet." raise NotImplementedError, msg
def set_alpha(self, alpha): """ Sets alpha globally. Note that this will not affect draw_image because reportlab does not currently support drawing images with alpha. """ self.gc.setFillAlpha(alpha) self.gc.setStrokeAlpha(alpha) super(GraphicsContext, self).set_alpha(alpha)
463,429
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
463,430
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
463,431
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
def draw_image(self, img, rect=None): """ draw_image(img_gc, rect=(x,y,w,h)) Draws another gc into this one. If 'rect' is not provided, then the image gc is drawn into this one, rooted at (0,0) and at full pixel size. If 'rect' is provided, then the image is resized into the (w,h) given and drawn into this GC at poi...
463,432
def save_state(self): """ Save the current graphic's context state. This should always be paired with a restore_state """ self.gc.CGContextSaveGState() print "boo"
def save_state(self): """ Save the current graphic's context state. This should always be paired with a restore_state """ self.gc.CGContextSaveGState()
463,433
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
463,434
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
463,435
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: p...
463,436
def __init__(self): self.objects = [ DeckPercentageTrump({"test": ">=", "value": 33.33, "ratio": 0.8}), # le test ne fonctionne pas comme souhaiter
def __init__(self): self.objects = [ DeckPercentageTrump({"test": ">=", "value": 100/3, "ratio": 0.8}), # le test ne fonctionne pas comme souhaiter
463,437
def ratio(self,deck): ratio = 1 for ratio_object in self.objects:
def ratio(self,deck): ratio = 1 for ratio_object in self.objects:
463,438
def parse(self, line, timestamp=None): self.lineNumber += 1 tokens = line.split() iso = 0 try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" %...
def parse(self, line, timestamp=None): self.lineNumber += 1 tokens = line.split() iso = 0 try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" %...
463,439
def setProgress(self, progress): self.progress = progress if self.progressQueue: self.progressQueue.put(("Loading %s" % os.path.basename(self.filename), self.progress))
def setProgress(self, progress): if self.progressQueue: self.progressQueue.put(("Loading %s" % os.path.basename(self.filename), self.progress))
463,440
def setProgress(self, progress): self.progress = progress if self.progressQueue: self.progressQueue.put(("Loading %s" % os.path.basename(self.filename), self.progress))
def setProgress(self, progress): self.progress = progress if self.progressQueue: self.progressQueue.put(("Loading %s" % os.path.basename(self.filename), self.progress))
463,441
def __init__(self, decoderFactory): self.decoderFactory = decoderFactory self.currentConfig = 1
def __init__(self, decoderFactory): self.decoderFactory = decoderFactory self.currentConfig = 1
463,442
def detector(context): # this is required for all 'Decoder' modules dev = context.device ep = context.endpoint ifc = context.interface devi = context.devInstance
def detector(context): # this is required for all 'Decoder' modules dev = context.device ep = context.endpoint ifc = context.interface devi = context.devInstance
463,443
def __init__(self, filename, parser, progressQueue=None, tailMode=False): self.filename = filename self.parser = parser self.progressQueue = progressQueue
def __init__(self, filename, parser, progressQueue=None, tailMode=False): self.filename = filename self.parser = parser self.progressQueue = progressQueue
463,444
def parse(self, line, timestamp=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" % self.li...
def parse(self, line, timestamp=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" % self.li...
463,445
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
def parseTime(self, line): """Return a unix-style timestamp for the given line.""" if line[10] != "T": """XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ timefmt = "%b %d %H:%M:%S" stamp = line[:15] usec = line[16:19] else: timefmt = "%Y-%m-%dT%H:%M:%S"...
463,446
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! saved...
463,447
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
463,448
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
def parseTime(self, line): """Return a unix-style timestamp for the given line. XXX: This assumes the current year, so logs that straddle years will have a giant discontinuity in timestamps. """ # Cache the results of strptime. It only changes every # second, and this was taking more than 50% of our parsing time! stamp...
463,449
def __init__(self, completed): self.epoch = None self.trans = Types.Transaction() self.trans.frame = 0 self.setupData = None self.completed = completed
def __init__(self, completed): self.epoch = None self.trans = Types.Transaction() self.setupData = None self.completed = completed
463,450
def parse(self, line, timestamp=None, frame=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d...
def parse(self, line, timestamp=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" % self.li...
463,451
def parse(self, line, timestamp=None, frame=None, lineNumber=None): tokens = line.split() finished = None
def parse(self, line, timestamp=None, frame=None, lineNumber=None): tokens = line.split() finished = None
463,452
def _cacheEndpointDecoders(self): """Update the endpointDecoders dictionary using the current configuration and interface settings. """ self.endpointDecoders = {0: self.controlDecoder}
def _cacheEndpointDecoders(self): """Update the endpointDecoders dictionary using the current configuration and interface settings. """ self.endpointDecoders = {0: self.controlDecoder}
463,453
def _cacheEndpointDecoders(self): """Update the endpointDecoders dictionary using the current configuration and interface settings. """ self.endpointDecoders = {0: self.controlDecoder}
def _cacheEndpointDecoders(self): """Update the endpointDecoders dictionary using the current configuration and interface settings. """ self.endpointDecoders = {0: self.controlDecoder}
463,454
def workview(self,task,parameters=None): wv = self.active(task) and\ self.is_started(task) and\ self.is_workable(task) return wv
def workview(self,task,parameters=None): wv = self.active(task) and\ self.is_started(task) and\ self.is_workable(task) and\ self.no_disabled_tag(task) return wv
463,455
def add_task(self,tid,path,state_id): if DEBUG_MODEL: print "receiving add_task %s to state %s (current:%s)" %(tid,state_id,self.state_id) if TM_IDLE_ADD: gobject.idle_add(self.__update_task,None,tid,path,state_id,'add',priority=gobject.PRIORITY_HIGH) else: self.__update_task(None,tid,path,state_id,'add')
def add_task(self,tid,path,state_id): if DEBUG_MODEL: print "receiving add_task %s to state %s (current:%s)" %(tid,state_id,self.state_id) if TM_IDLE_ADD: gobject.idle_add(self.__update_task,None,tid,path,state_id,'add',priority=gobject.PRIORITY_HIGH) else: self.__update_task(None,tid,path,state_id,'add')
463,456
def update_task(self, tid,path,state_id,data=None): if TM_IDLE_ADD: gobject.idle_add(self.__update_task,None,tid,path,state_id,data,priority=gobject.PRIORITY_HIGH) else: self.__update_task(None,tid,path,state_id,data)
def update_task(self, tid,path,state_id,data=None): if TM_IDLE_ADD: gobject.idle_add(self.__update_task,None,tid,path,state_id,data,priority=gobject.PRIORITY_HIGH) else: self.__update_task(None,tid,path,state_id,data)
463,457
def remove_task(self,tid,path,state_id): if TM_IDLE_ADD: gobject.idle_add(self.__remove_task,None,tid,path,state_id,priority=gobject.PRIORITY_HIGH) else: self.__remove_task(None,tid,path,state_id)
def remove_task(self,tid,path,state_id): if TM_IDLE_ADD: gobject.idle_add(self.__remove_task,None,tid,path,state_id,priority=gobject.PRIORITY_HIGH) else: self.__remove_task(None,tid,path,state_id)
463,458
def reorder(self,nid,path,neworder,state_id): if state_id > self.state_id: self.state_id = state_id if TM_IDLE_ADD: gobject.idle_add(self.__reorder,None,nid,path,neworder,state_id) else: self.__reorder(None,nid,path,neworder,state_id)
def reorder(self,nid,path,neworder,state_id): gobject.idle_add(self.__reorder,None,nid,path,neworder,state_id,\ priority=gobject.PRIORITY_HIGH)
463,459
def __reorder(self, sender, nid,path,neworder,state_id): actual_nid = self.tree.get_node_for_path(path,state_id=state_id) if nid == actual_nid: if path: rowref = self.get_iter(path) else: rowref = None self.state_id = state_id self.rows_reordered(path,rowref,neworder) else: raise Exception('path/node mismatch in reorde...
def __reorder(self, sender, nid,path,neworder,state_id): actual_nid = self.tree.get_node_for_path(path,state_id=state_id) if nid == actual_nid: if path: rowref = self.get_iter(path) else: rowref = None self.rows_reordered(path,rowref,neworder) else: raise Exception('path/node mismatch in reorder')
463,460
def main(options=None, args=None): ''' Calling this starts the full GTG experience ( :-D ) ''' config, ds, req = core_main_init(options, args) # Launch task browser manager = Manager(req, config) #main loop #To be more user friendly and get the logs of crashes, we show an apport # hooked window upon crashes #with sign...
defimport sys if options.no_crash_handler == False: pass main(options=None,import sys if options.no_crash_handler == False: pass args=None):import sys if options.no_crash_handler == False: pass '''import sys if options.no_crash_handler == False: pass Callingimport sys if options.no_crash_handler == False: pas...
463,461
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,462
def new_task(self, status, title, duedate, startdate, donedate, tags, text, subtasks): # Generate a new task object and return the task data as a dict nt = self.req.new_task(tags=tags) for sub in subtasks: nt.add_subtask(sub) nt.set_status(status, donedate=dates.strtodate(donedate)) nt.set_title(title) nt.set_due_date(...
def new_task(self, status, title, duedate, startdate, donedate, tags, text, subtasks): # Generate a new task object and return the task data as a dict tags_objects = [] for t in tags: tag_object = self.req.get_tag(t) if tag_object == None: tag_object = self.req.new_tag(t) tags_objects.append(tag_object) nt = self.req....
463,463
def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=task_data["donedate"]) task.set_title(task_data["title"]) task.set_due_date(task_data["duedate"]) task.set_start_date(task_data["startdat...
def modify_task(self, tid, task_data): # Apply supplied task data to the task object with the specified ID task = self.req.get_task(tid) task.set_status(task_data["status"], donedate=task_data["donedate"]) task.set_title(task_data["title"]) task.set_due_date(dates.strtodate(task_data["duedate"])) task.set_start_date(da...
463,464
def on_quickadd_activate(self, widget): text = self.quickadd_entry.get_text() due_date = no_date defer_date = no_date if text: tags, notagonly = self.get_selected_tags() # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www....
def on_quickadd_activate(self, widget): text = 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,465
def on_quickadd_activate(self, widget): text = self.quickadd_entry.get_text() due_date = no_date defer_date = no_date if text: tags, notagonly = self.get_selected_tags() # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www....
def on_quickadd_activate(self, widget): text = self.quickadd_entry.get_text() due_date = no_date defer_date = no_date if text: tags, notagonly = self.get_selected_tags() # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www....
463,466
def onTaskOpened(self, plugin_api): # add a item (button) to the ToolBar tb_Taskbutton = gtk.ToolButton(gtk.STOCK_EXECUTE) tb_Taskbutton.set_label("Send via email") tb_Taskbutton.connect('clicked', self.onTbTaskButton, plugin_api) self.task_separator = plugin_api.add_task_toolbar_item(gtk.SeparatorToolItem()) self.tb_T...
def onTaskOpened(self, plugin_api): # add a item (button) to the ToolBar tb_Taskicon = gtk.Image() tb_Taskicon.set_from_icon_name('mail-send', 32) tb_Taskicon.show() tb_Taskbutton = gtk.ToolButton(tb_Taskicon) tb_Taskbutton.set_label("Send via email") tb_Taskbutton.connect('clicked', self.onTbTaskButton, plugin_api) se...
463,467
def test_parent(self): tree = self._build_tree(4,flat=False) tree.print_tree() mynode = tree.get_node('3@3') self.assertEqual(True,mynode.has_parent()) p = mynode.get_parents()[0] par = tree.get_node(p) self.assertEqual('2@2',par.get_id())
def test_parent(self): tree = self._build_tree(4,flat=False) mynode = tree.get_node('3@3') self.assertEqual(True,mynode.has_parent()) p = mynode.get_parents()[0] par = tree.get_node(p) self.assertEqual('2@2',par.get_id())
463,468
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,469
def __init__(self,tree,filtersbank,refresh=True): """ Construct a FilteredTree object on top of an existing task tree. @param req: The requestor object @param tree: The tree to filter from @param maintree: Whether this tree is the main tree. The requester must be used to change filters against the main tree. """ self....
def __init__(self,tree,filtersbank,refresh=True): """ Construct a FilteredTree object on top of an existing task tree. @param req: The requestor object @param tree: The tree to filter from @param maintree: Whether this tree is the main tree. The requester must be used to change filters against the main tree. """ self....
463,470
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
463,471
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
463,472
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0)
463,473
def print_from_node(self, nid, level=0,string=None): prefix = "->"*level paths = self.get_paths_for_node(nid) toprint = "%s%s (%s) " %(prefix,nid,\ str(paths)) if not string: print toprint level += 1 is_good = False for p in paths: if len(p) == level: is_good = True if not is_good: error = 'theres no path of level %...
def print_from_node(self, nid, level=0,string=None): prefix = "->"*level paths = self.get_paths_for_node(nid) toprint = "%s%s (%s) " %(prefix,nid,\ str(paths)) if not string: print toprint level += 1 is_good = False for p in paths: if len(p) == level: is_good = True if not is_good: error = 'theres no path of level %...
463,474
def __node_for_path(self,basenode_id,path): if len(path) == 0: return basenode_id elif path[0] < self.node_n_children(basenode_id): if len(path) == 1: return self.node_nth_child(basenode_id,path[0]) else: node_id = self.node_nth_child(basenode_id,path[0]) path = path[1:] return self.__node_for_path(node_id, path) else:...
def __node_for_path(self,basenode_id,path): if len(path) == 0: return basenode_id elif path[0] < self.node_n_children(basenode_id): if len(path) == 1: toreturn = self.node_nth_child(basenode_id,path[0]) else: node_id = self.node_nth_child(basenode_id,path[0]) path = path[1:] return self.__node_for_path(node_id, path) ...
463,475
def __node_for_path(self,basenode_id,path): if len(path) == 0: return basenode_id elif path[0] < self.node_n_children(basenode_id): if len(path) == 1: return self.node_nth_child(basenode_id,path[0]) else: node_id = self.node_nth_child(basenode_id,path[0]) path = path[1:] return self.__node_for_path(node_id, path) else:...
def __node_for_path(self,basenode_id,path): if len(path) == 0: return basenode_id elif path[0] < self.node_n_children(basenode_id): if len(path) == 1: return self.node_nth_child(basenode_id,path[0]) else: node_id = self.node_nth_child(basenode_id,path[0]) path = path[1:] return self.__node_for_path(node_id, path) else:...
463,476
def __next_nodes(self,nid,path): '''given a node and a path, return all the next nodes of that node for that path. The list is returned in reverse order (last next_node first) ''' error = "nextnodes %s %s\n" %(nid,str(path)) if len(path) >= 2: index = path[-1] parpath = path[:-1] par = self.get_node_for_path(parpath) p...
def __next_nodes(self,nid,path): '''given a node and a path, return all the next nodes of that node for that path. The list is returned in reverse order (last next_node first) ''' error = "nextnodes %s %s\n" %(nid,str(path)) if len(path) >= 2: index = path[-1] parpath = path[:-1] par = self.get_node_for_path(parpath) p...
463,477
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
463,478
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
463,479
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
463,480
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
def __delete_node(self,nid,paths=None): '''Delete occurence of node nid for given paths. if paths is None, then the node is removed for every paths it belongs to. Deleting a node means : 1. Deleting all the next_nodes 2. Deleting all the children. 3. Deleting the node itself. 4. Re-adding all the next_nodes ''' error =...
463,481
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) if DEBUG: self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: pa...
463,482
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,483
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,484
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,485
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += ""+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self.__get...
463,486
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,487
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,488
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
def __add_node(self,nid,paths=None): error = "Adding node %s to paths %s\n" %(nid,paths) self.trace += " "+error #we only add node that really need it. curdis = self.is_displayed(nid) newdis = self.__is_displayed(nid) #it should not be displayed, don't add it. if not newdis: return False if not paths: paths = self...
463,489
def __update_node(self,nid): '''to update a node, we: 1. take old and new paths 2. we remove all occurence that are in oldpaths and not in newpaths 3. we refresh newpaths to reflect the deletions. 4. We add the occurence in newpaths and not in oldpaths 5. we update nodes that are in both paths ''' error = " Updating no...
def __update_node(self,nid): '''to update a node, we: 1. take old and new paths 2. we remove all occurence that are in oldpaths and not in newpaths 3. we refresh newpaths to reflect the deletions. 4. We add the occurence in newpaths and not in oldpaths 5. we update nodes that are in both paths ''' error = " Updating no...
463,490
def __update_node(self,nid): '''to update a node, we: 1. take old and new paths 2. we remove all occurence that are in oldpaths and not in newpaths 3. we refresh newpaths to reflect the deletions. 4. We add the occurence in newpaths and not in oldpaths 5. we update nodes that are in both paths ''' error = " Updating no...
def __update_node(self,nid): '''to update a node, we: 1. take old and new paths 2. we remove all occurence that are in oldpaths and not in newpaths 3. we refresh newpaths to reflect the deletions. 4. We add the occurence in newpaths and not in oldpaths 5. we update nodes that are in both paths ''' error = " Updating no...
463,491
def on_autostart_toggled(self, widget): """Toggle GTG autostarting with the GNOME desktop""" autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \ self.__AUTOSTART_FILE) if widget.get_active() == False: #Disable autostart, removing the file in autostart_path if os.path.isfile(autostart_path): os.remove(autostart_...
def on_autostart_toggled(self, widget): """Toggle GTG autostarting with the GNOME desktop""" autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \ self.__AUTOSTART_FILE) if widget.get_active() == False: #Disable autostart, removing the file in autostart_path if os.path.isfile(autostart_path): os.remove(autostart_...
463,492
def on_autostart_toggled(self, widget): """Toggle GTG autostarting with the GNOME desktop""" autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \ self.__AUTOSTART_FILE) if widget.get_active() == False: #Disable autostart, removing the file in autostart_path if os.path.isfile(autostart_path): os.remove(autostart_...
def on_autostart_toggled(self, widget): """Toggle GTG autostarting with the GNOME desktop""" autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \ self.__AUTOSTART_FILE) if widget.get_active() == False: #Disable autostart, removing the file in autostart_path if os.path.isfile(autostart_path): os.remove(autostart_...
463,493
def backend_filter(self, task, tags_to_match_set): ''' Filter that checks if two tags sets intersect. It is used to check if a task should be stored inside a backend @param task: a task object @oaram tags_to_match_set: a *set* of tag names ''' all_tasks_tag = self.req.get_alltag_tag().get_name() if all_tasks_tag in tag...
def backend_filter(self, task, tags_to_match_set): ''' Filter that checks if two tags sets intersect. It is used to check if a task should be stored inside a backend @param task: a task object @oaram tags_to_match_set: a *set* of tag names ''' all_tasks_tag = self.req.get_alltag_tag().get_name() if all_tasks_tag in tag...
463,494
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() pars = self.node_parents(node) #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): return...
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() pars = self.node_parents(node) #For that node, we should convert the base_path to path if not node or not self.is_displayed(node.get_id()): return...
463,495
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,496
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,497
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,498
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,499