bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _render_view(self, req, db, page): req.perm.assert_permission('WIKI_VIEW') | def _render_view(self, req, db, page): req.perm.assert_permission('WIKI_VIEW') | 25,900 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 25,901 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 25,902 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 25,903 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 25,904 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 25,905 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 25,906 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | 25,907 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | 25,908 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | 25,909 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | 25,910 |
def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND tc.time... | 25,911 |
def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor) | def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor) | 25,912 |
def do_help(self, line=None): arg = self.arg_tokenize(line) if arg[0]: try: doc = getattr(self, "_help_" + arg[0]) self.print_doc (doc) except AttributeError: print "No documentation found for '%s'" % arg[0] else: docs = (self._help_about + self._help_help + self._help_initenv + self._help_hotcopy + self._help_resync +... | def do_help(self, line=None): arg = self.arg_tokenize(line) if arg[0]: try: doc = getattr(self, "_help_" + arg[0]) self.print_doc(doc) except AttributeError: print "No documentation found for '%s'" % arg[0] else: docs = (self._help_about + self._help_help + self._help_initenv + self._help_hotcopy + self._help_resync + ... | 25,913 |
def do_help(self, line=None): arg = self.arg_tokenize(line) if arg[0]: try: doc = getattr(self, "_help_" + arg[0]) self.print_doc (doc) except AttributeError: print "No documentation found for '%s'" % arg[0] else: docs = (self._help_about + self._help_help + self._help_initenv + self._help_hotcopy + self._help_resync +... | def do_help(self, line=None): arg = self.arg_tokenize(line) if arg[0]: try: doc = getattr(self, "_help_" + arg[0]) self.print_doc (doc) except AttributeError: print "No documentation found for '%s'" % arg[0] else: docs = (self._help_about + self._help_help + self._help_initenv + self._help_hotcopy + self._help_resync +... | 25,914 |
def _expand_module_link(self, text): sep = text.find(':') if sep == -1: return None, None module = text[:sep] args = text[sep+1:] if module in ['bug', 'ticket']: return self.href.ticket(args), '%s:%s' % (module, args), 0 elif module == 'wiki': if not self.env._wiki_pages.has_key(args): return self.href.wiki(args), '%s:... | def _expand_module_link(self, text): sep = text.find(':') if sep == -1: return None, None module = text[:sep] args = text[sep+1:] if module in ['bug', 'ticket']: return self.href.ticket(args), '%s:%s' % (module, args), 0 elif module == 'wiki': if not self.env._wiki_pages.has_key(args): return self.href.wiki(args), '%s:... | 25,915 |
def get_node(self, path, rev=None): self.authz.assert_permission(os.path.join(self.scope, path)) if path and path[-1] == '/': path = path[:-1] | def get_node(self, path, rev=None): self.authz.assert_permission(posixpath.join(self.scope, path)) if path and path[-1] == '/': path = path[:-1] | 25,916 |
def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW) | def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW) | 25,917 |
def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW) | def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW) | 25,918 |
def previous_rev(self, rev): rev = int(rev) if rev == 0: return None if self.scope == '/': return rev - 1 idx = self.history.index(rev) if idx > 0: return self.history[idx + 1] return None | def previous_rev(self, rev): rev = int(rev) if rev == 0: return None if self.scope == '/': return rev - 1 idx = self.history.index(rev) if idx + 1 < len(self.history): return self.history[idx + 1] return None | 25,919 |
def _list_formatter(self, match, fullmatch): ldepth = len(fullmatch.group('ldepth').replace('\t', ' '*8)) match = match.replace('\t', ' '*8) listid = match[ldepth] self.in_list_item = True class_ = start = None if listid in '-*': type_ = 'ul' else: type_ = 'ol' idx = '01iI'.find(listid) if idx >= 0: class_ = ('arabicze... | def _list_formatter(self, match, fullmatch): ldepth = len(fullmatch.group('ldepth')) match = match listid = match[ldepth] self.in_list_item = True class_ = start = None if listid in '-*': type_ = 'ul' else: type_ = 'ol' idx = '01iI'.find(listid) if idx >= 0: class_ = ('arabiczero', None, 'lowerroman', 'upperroman')[idx... | 25,920 |
def _list_formatter(self, match, fullmatch): ldepth = len(fullmatch.group('ldepth').replace('\t', ' '*8)) match = match.replace('\t', ' '*8) listid = match[ldepth] self.in_list_item = True class_ = start = None if listid in '-*': type_ = 'ul' else: type_ = 'ol' idx = '01iI'.find(listid) if idx >= 0: class_ = ('arabicze... | def _list_formatter(self, match, fullmatch): ldepth = len(fullmatch.group('ldepth').replace('\t', ' '*8)) match = match.replace('\t', ' '*8) listid = match[ldepth] self.in_list_item = True class_ = start = None if listid in '-*': type_ = 'ul' else: type_ = 'ol' idx = '01iI'.find(listid) if idx >= 0: class_ = ('arabicze... | 25,921 |
def _get_list_depth(self): """Return the space offset associated to the deepest opened list.""" return self._list_stack and self._list_stack[-1][1] or 0 | def _get_list_depth(self): """Return the space offset associated to the deepest opened list.""" return self._list_stack and self._list_stack[-1][1] or 0 | 25,922 |
def open_list(): self.close_table() self.close_paragraph() self.close_indentation() self._list_stack.append((new_type, depth)) class_attr = list_class and ' class="%s"' % list_class or '' start_attr = start and ' start="%s"' % start or '' self.out.write('<'+new_type+class_attr+start_attr+'><li>') | def open_list(): self.close_table() self.close_paragraph() self.close_indentation() self._list_stack.append((new_type, depth)) class_attr = list_class and ' class="%s"' % list_class or '' start_attr = start and ' start="%s"' % start or '' self.out.write('<'+new_type+class_attr+start_attr+'><li>') | 25,923 |
def _indent_formatter(self, match, fullmatch): idepth = len(fullmatch.group('idepth').replace('\t', ' '*8)) if self._list_stack: ltype, ldepth = self._list_stack[-1] if idepth < ldepth: for _, ldepth in self._list_stack: if idepth > ldepth: self.in_list_item = True self._set_list_depth(idepth, None, None, None) return ... | def _indent_formatter(self, match, fullmatch): idepth = len(fullmatch.group('idepth')) if self._list_stack: ltype, ldepth = self._list_stack[-1] if idepth < ldepth: for _, ldepth in self._list_stack: if idepth > ldepth: self.in_list_item = True self._set_list_depth(idepth, None, None, None) return '' elif idepth <= lde... | 25,924 |
def _set_quote_depth(self, depth): if depth > 0: self.in_quote = True def open_quote(depth): self.close_table() self.close_paragraph() self.close_list() def open_one_quote(d): self._quote_stack.append(d) self.out.write('<blockquote>' + os.linesep) open_one_quote(depth) def close_quote(): self.close_table() self.close_p... | def _set_quote_depth(self, depth): def open_quote(depth): self.close_table() self.close_paragraph() self.close_list() def open_one_quote(d): self._quote_stack.append(d) self.out.write('<blockquote>' + os.linesep) open_one_quote(depth) def close_quote(): self.close_table() self.close_paragraph() self._quote_stack.pop() ... | 25,925 |
def close_quote(): self.close_table() self.close_paragraph() self._quote_stack.pop() self.out.write('</blockquote>' + os.linesep) | def close_quote(): self.close_table() self.close_paragraph() self._quote_stack.pop() self.out.write('</blockquote>' + os.linesep) | 25,926 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,927 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,928 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,929 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,930 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,931 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,932 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,933 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 25,934 |
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | def_render_results(self,constraints,order,desc):self.req.hdf.setValue('title','CustomQuery')self.req.hdf.setValue('query.edit_href',self.env.href.query(constraints,order,desc,action='edit')) | 25,935 |
def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view' | def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view' | 25,936 |
def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view' | def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view' | 25,937 |
def render(self, req, mimetype, content, filename=None, rev=None): try: from docutils import nodes from docutils.core import publish_string from docutils.parsers import rst from docutils.__init__ import __version__ except ImportError: raise TrarError, 'Docutils >= %s not found' % docutils_required if __version__ < '0.3... | def render(self, req, mimetype, content, filename=None, rev=None): try: from docutils import nodes from docutils.core import publish_string from docutils.parsers import rst from docutils import __version__ except ImportError: raise TrarError, 'Docutils >= %s not found' % docutils_required if __version__ < '0.3.3': rais... | 25,938 |
def render(self, req, mimetype, content, filename=None, rev=None): try: from docutils import nodes from docutils.core import publish_string from docutils.parsers import rst from docutils.__init__ import __version__ except ImportError: raise TrarError, 'Docutils >= %s not found' % docutils_required if __version__ < '0.3... | def render(self, req, mimetype, content, filename=None, rev=None): try: from docutils import nodes from docutils.core import publish_string from docutils.parsers import rst from docutils.__init__ import __version__ except ImportError: raise TrarError, 'Docutils >= %s not found' % docutils_required if StrictVersion(__ve... | 25,939 |
def get_info (self, id): cursor = self.db.cursor() | def sql_sub_vars(self, sql, args): m = re.search(dynvars_re, sql) if not m: return sql aname=m.group()[1:] try: arg = args[aname] except KeyError: raise Exception("Dynamic variable '$%s' not defined." % aname) self.cgi.hdf.setValue('report.var.'+aname , arg) sql = m.string[:m.start()] + arg + m.string[m.end():] return ... | 25,940 |
def get_info (self, id): cursor = self.db.cursor() | def get_info (self, id): cursor = self.db.cursor() | 25,941 |
def get_info (self, id): cursor = self.db.cursor() | def get_info (self, id): cursor = self.db.cursor() | 25,942 |
def render_report_list(self, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.create_href', href.report(None, 'new')) if id != -1: if self.perm.has_permission(perm.R... | def render_report_list(self, id, args={}): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.create_href', href.report(None, 'new')) if id != -1: if self.perm.has_permissi... | 25,943 |
def render_report_list(self, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.create_href', href.report(None, 'new')) if id != -1: if self.perm.has_permission(perm.R... | def render_report_list(self, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.create_href', href.report(None, 'new')) if id != -1: if self.perm.has_permission(perm.R... | 25,944 |
def render_report_list(self, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.create_href', href.report(None, 'new')) if id != -1: if self.perm.has_permission(perm.R... | def def get_var_args(self): report_args = {} for arg in self.args.keys(): if not arg == arg.upper(): continue m = re.search(dynvars_disallowed_var_chars_re, arg) if m: raise ValueError("The character '%s' is not allowed " " in variable names." % m.group()) val = self.args[arg] m = re.search(dynvars_disallowed_value_cha... | 25,945 |
def render(self): self.perm.assert_permission(perm.REPORT_VIEW) # did the user ask for any special report? id = int(self.args.get('id', -1)) action = self.args.get('action', 'list') | def render(self): self.perm.assert_permission(perm.REPORT_VIEW) # did the user ask for any special report? id = int(self.args.get('id', -1)) action = self.args.get('action', 'list') | 25,946 |
def __init__(self, interface): """Create the extension point. @param interface: the `Interface` class that defines the protocol for the extension point """ self.interface = interface | def __init__(self, interface): """Create the extension point. @param interface: the `Interface` subclass that defines the protocol for the extension point """ self.interface = interface | 25,947 |
def __get__(self, instance, owner): """Return a list of components that declare to implement the extension point interface.""" if instance: extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [instance.compmgr[cls] for cls in extensions]) return self | def extensions(self, component): """Return a list of components that declare to implement the extension point interface.""" if instance: extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [instance.compmgr[cls] for cls in extensions]) return self | 25,948 |
def __get__(self, instance, owner): """Return a list of components that declare to implement the extension point interface.""" if instance: extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [instance.compmgr[cls] for cls in extensions]) return self | def __get__(self, instance, owner): """Return a list of components that declare to implement the extension point interface.""" if instance: extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [instance.compmgr[cls] for cls in extensions]) return self | 25,949 |
def __setitem__(self, name, value): """Log ticket modifications so the table ticket_change can be updated""" if self.values.has_key(name) and self.values[name] == value: return field = [field for field in self.fields if field['name'] == name] if not field: return field = field[0] if not self._old.has_key(name): # Chang... | def __setitem__(self, name, value): """Log ticket modifications so the table ticket_change can be updated""" if self.values.has_key(name) and self.values[name] == value: return if not self._old.has_key(name): # Changed field self._old[name] = self.values.get(name) elif self._old[name] == value: # Change of field revert... | 25,950 |
def __setitem__(self, name, value): """Log ticket modifications so the table ticket_change can be updated""" if self.values.has_key(name) and self.values[name] == value: return field = [field for field in self.fields if field['name'] == name] if not field: return field = field[0] if not self._old.has_key(name): # Chang... | def __setitem__(self, name, value): """Log ticket modifications so the table ticket_change can be updated""" if self.values.has_key(name) and self.values[name] == value: return field = [field for field in self.fields if field['name'] == name] if not field: return field = field[0] if not self._old.has_key(name): # Chang... | 25,951 |
def notify(self, ticket, newticket=True, modtime=0): self.ticket = ticket self.modtime = modtime self.newticket = newticket self.ticket['description'] = wrap(self.ticket.values.get('description', ''), self.COLS, initial_indent=' ', subsequent_indent=' ', linesep=CRLF) self.ticket['link'] = self.env.abs_href.ticket(tick... | def notify(self, ticket, newticket=True, modtime=0): self.ticket = ticket self.modtime = modtime self.newticket = newticket self.ticket['description'] = wrap(self.ticket.values.get('description', ''), self.COLS, initial_indent=' ', subsequent_indent=' ', linesep=CRLF) self.ticket['link'] = self.env.abs_href.ticket(tick... | 25,952 |
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | 25,953 |
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | 25,954 |
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | 25,955 |
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ... | 25,956 |
def code_block(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): """ Create a code-block directive for docutils. | defcontent = content_to_unicode(self.env, content, mimetype) content = content.encode('utf-8') code_block(name,content = content_to_unicode(self.env, content, mimetype) content = content.encode('utf-8') arguments,content = content_to_unicode(self.env, content, mimetype) content = content.encode('utf-8') options,content... | 25,957 |
def load_components(env): loaded_components = [] # Load configured modules for section in env.config.sections(): for name, value in env.config.options(section): if name == 'module': loaded_components.append(value) path = env.config.get(section, 'path') or None env.log.debug('Loading component module %s from %s' % (val... | def load_components(env): loaded_components = [] # Load configured modules for section in env.config.sections(): for name, value in env.config.options(section): if name == 'module': loaded_components.append(value) path = env.config.get(section, 'path') or None env.log.debug('Loading component module %s from %s' % (val... | 25,958 |
def load_components(env): loaded_components = [] # Load configured modules for section in env.config.sections(): for name, value in env.config.options(section): if name == 'module': loaded_components.append(value) path = env.config.get(section, 'path') or None env.log.debug('Loading component module %s from %s' % (val... | def load_components(env): loaded_components = [] # Load configured modules for section in env.config.sections(): for name, value in env.config.options(section): if name == 'module': loaded_components.append(value) path = env.config.get(section, 'path') or None env.log.debug('Loading component module %s from %s' % (val... | 25,959 |
def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | def generate_path_links(self, req, rev, rev_specified): links = [''] + filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env... | 25,960 |
def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' i = 0 for part in list[:-1]: i = i + 1 path = path + part + '/' req.hdf.setValue('log.path.%d' % i, part) url = '' if rev_specified: url = self.env.href.browser(path, rev) else: url = self.env.href.browser(path)... | 25,961 |
def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | 25,962 |
def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | 25,963 |
def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | def generate_path_links(self, req, rev, rev_specified): list = filter(None, self.path.split('/')) path = '/' req.hdf.setValue('log.filename', list[-1]) req.hdf.setValue('log.href' , self.env.href.log(self.path)) req.hdf.setValue('log.path.0', 'root') if rev_specified: req.hdf.setValue('log.path.0.url', self.env.href.br... | 25,964 |
def process_newticket_request(self, req): req.perm.require('TICKET_CREATE') data = {} db = self.env.get_db_cnx() | def process_newticket_request(self, req): req.perm.require('TICKET_CREATE') data = {} db = self.env.get_db_cnx() | 25,965 |
def _insert_ticket_data(self, req, db, ticket, data, reporter_id): """Insert ticket data into the hdf""" replyto = req.args.get('replyto') data['replyto'] = replyto | def _insert_ticket_data(self, req, db, ticket, data, reporter_id): """Insert ticket data into the hdf""" replyto = req.args.get('replyto') data['replyto'] = replyto | 25,966 |
def revoke_permission(self, username, action): """Revokes the permission of the specified user to perform an action.""" # TODO: Validate that this permission does in fact exist if action.isupper() and action not in self.get_actions(): raise TracError, '%s is not a valid action.' % action | def revoke_permission(self, username, action): """Revokes the permission of the specified user to perform an action.""" # TODO: Validate that this permission does in fact exist if action.isupper() and action not in self.get_actions(): raise TracError, '%s is not a valid action.' % action | 25,967 |
def save(self): if not self._old and not self.items(): # The session doesn't have associated data, so there's no need to # persist it return | def save(self): if not self._old and not self.items(): # The session doesn't have associated data, so there's no need to # persist it return | 25,968 |
def redirect(self, url): """ Send a redirect to the client, forwarding to the specified URL. The `url` may be relative or absolute, relative URLs will be translated appropriately. """ self.session.save() # has to be done before the redirect is sent self.send_response(302) if not url.startswith('http://') and not url.st... | def redirect(self, url): """ Send a redirect to the client, forwarding to the specified URL. The `url` may be relative or absolute, relative URLs will be translated appropriately. """ if self.session: self.session.save() # has to be done before the redirect is sent self.send_response(302) if not url.startswith('http://... | 25,969 |
def get_path_links(href, path, rev): links = [] parts = path.split('/') if not parts[-1]: parts.pop() path = '/' for part in parts: path = path + part + '/' links.append({ 'name': part or 'root', 'href': href.browser(path, rev=rev) }) return links | def get_path_links(href, fullpath, rev): links = [{'name': 'root', 'href': href.browser(rev=rev)}] path = '' for part in [p for p in fullpath.split('/') if p]: path += part + '/' links.append({'name': part, 'href': href.browser(path, rev=rev)}) return links | 25,970 |
def do_hotcopy(self, line): arg = self.arg_tokenize(line) if arg[0]: dest = arg[0] else: self.do_help('hotcopy') return cnx = self.db_open() # Lock the database while copying files cnx.db.execute("BEGIN") print 'Hotcopying %s to %s ...' % (self.__env.path, dest), try: shutil.copytree(self.__env.path, dest, symlinks=1) ... | def do_hotcopy(self, line): arg = self.arg_tokenize(line) if arg[0]: dest = arg[0] else: self.do_help('hotcopy') return cnx = self.db_open() # Lock the database while copying filescursor = cnx.cursor() cursor.execute("UPDATE system SET name=NULL WHERE name IS NULL") print 'Hotcopying %s to %s ...' % (self.__env.path, ... | 25,971 |
def do_hotcopy(self, line): arg = self.arg_tokenize(line) if arg[0]: dest = arg[0] else: self.do_help('hotcopy') return cnx = self.db_open() # Lock the database while copying files cnx.db.execute("BEGIN") print 'Hotcopying %s to %s ...' % (self.__env.path, dest), try: shutil.copytree(self.__env.path, dest, symlinks=1) ... | def do_hotcopy(self, line): arg = self.arg_tokenize(line) if arg[0]: dest = arg[0] else: self.do_help('hotcopy') return cnx = self.db_open() # Lock the database while copying files cnx.db.execute("BEGIN") print 'Hotcopying %s to %s ...' % (self.__env.path, dest), try: shutil.copytree(self.__env.path, dest, symlinks=1) ... | 25,972 |
def notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket | def notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket | 25,973 |
def _heading_formatter(self, match, fullmatch): match = match.strip() self.close_table() self.close_paragraph() self.close_indentation() self.close_list() self.close_def_list() | def _heading_formatter(self, match, fullmatch): match = match.strip() self.close_table() self.close_paragraph() self.close_indentation() self.close_list() self.close_def_list() | 25,974 |
def get_info(self, path, revision, rev_specified): """ Extracts information for a given path and revision """ try: root = fs.revision_root(self.fs_ptr, revision, self.pool) except core.SubversionException: raise TracError('Invalid revision number: %d' % revision) | def get_info(self, path, revision, rev_specified): """ Extracts information for a given path and revision """ try: root = fs.revision_root(self.fs_ptr, revision, self.pool) except core.SubversionException: raise TracError('Invalid revision number: %d' % revision) | 25,975 |
def _changeset_title(rev): if restricted: return 'Changeset %s for %s' % (rev, path) else: return 'Changeset %s' % rev | def _changeset_title(rev): if restricted: return 'Changeset %s for %s' % (rev, path) else: return 'Changeset %s' % rev | 25,976 |
def display_html(self, req, query): req.hdf['title'] = 'Custom Query' add_stylesheet(req, 'common/css/report.css') | def display_html(self, req, query): req.hdf['title'] = 'Custom Query' add_stylesheet(req, 'common/css/report.css') | 25,977 |
def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW') | def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW') | 25,978 |
def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW') | def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW') | 25,979 |
def render_macro(self, req, name, content): from trac.wiki.formatter import wiki_to_html from trac.wiki import WikiSystem wiki = WikiSystem(self.env) | def render_macro(self, req, name, content): from trac.wiki.formatter import wiki_to_html, system_message from trac.wiki import WikiSystem wiki = WikiSystem(self.env) | 25,980 |
def get_macro_descr(): for macro_provider in wiki.macro_providers: for macro_name in macro_provider.get_macros(): if content and macro_name != content: continue descr = macro_provider.get_macro_description(macro_name) yield (macro_name, descr or '') | def get_macro_descr(): for macro_provider in wiki.macro_providers: for macro_name in macro_provider.get_macros(): if content and macro_name != content: continue descr = macro_provider.get_macro_description(macro_name) yield (macro_name, descr or '') | 25,981 |
def get_macro_descr(): for macro_provider in wiki.macro_providers: for macro_name in macro_provider.get_macros(): if content and macro_name != content: continue descr = macro_provider.get_macro_description(macro_name) yield (macro_name, descr or '') | def get_macro_descr(): for macro_provider in wiki.macro_providers: for macro_name in macro_provider.get_macros(): if content and macro_name != content: continue descr = macro_provider.get_macro_description(macro_name) yield (macro_name, descr or '') | 25,982 |
def update(self, db=None): assert self.exists, 'Cannot update non-existent %s' % self.type assert self.name, 'Cannot update %s with no name' % self.type if not db: db = self.env.get_db_cnx() handle_ta = True else: handle_ta = False | def update(self, db=None): assert self.exists, 'Cannot update non-existent %s' % self.type assert self.name, 'Cannot update %s with no name' % self.type if not db: db = self.env.get_db_cnx() handle_ta = True else: handle_ta = False | 25,983 |
def select(cls, env, db=None): if not db: db = env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT name,value FROM enum WHERE type=%s " "ORDER BY value", (cls.type,)) for name, value in cursor: obj = cls(env) obj.name = name obj.value = value yield obj | def select(cls, env, db=None): if not db: db = env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT name,value FROM enum WHERE type=%s " "ORDER BY value", (cls.type,)) for name, value in cursor: obj = cls(env) obj.name = obj._old_name = name obj.value = obj._old_value = value yield obj | 25,984 |
def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules | def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules | 25,985 |
def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules | def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules | 25,986 |
def handle_code_block(self, line): if line.strip() == '{{{': self.in_code_block += 1 if self.in_code_block == 1: self.code_processor = None self.code_text = '' else: self.code_text += line + os.linesep if not self.code_processor: self.code_processor = Formatter.builtin_processors['default'] elif line.strip() == '}}}': ... | def handle_code_block(self, line): if line.strip() == '{{{': self.in_code_block += 1 if self.in_code_block == 1: self.code_processor = None self.code_text = '' else: self.code_text += line + os.linesep if not self.code_processor: self.code_processor = Formatter.builtin_processors['default'] elif line.strip() == '}}}': ... | 25,987 |
def process_request(self, req): action = req.args.get('action', 'view') pagename = req.args.get('page', 'WikiStart') version = req.args.get('version') | def process_request(self, req): action = req.args.get('action', 'view') pagename = req.args.get('page', 'WikiStart') version = req.args.get('version') | 25,988 |
def render_macro(self, req, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args[0] size_re = re.co... | def render_macro(self, req, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args[0] size_re = re.co... | 25,989 |
def render_macro(self, req, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args[0] size_re = re.co... | def render_macro(self, req, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args[0] size_re = re.co... | 25,990 |
def convert_content(self, req, mimetype, content, key, filename=None, url=None): """Convert the given content to the target MIME type represented by `key`, which can be either a MIME type or a key. Returns a tuple of (content, output_mime_type, extension).""" if not content: return ('', 'text/plain;charset=utf-8') | def convert_content(self, req, mimetype, content, key, filename=None, url=None): """Convert the given content to the target MIME type represented by `key`, which can be either a MIME type or a key. Returns a tuple of (content, output_mime_type, extension).""" if not content: return ('', 'text/plain;charset=utf-8') | 25,991 |
def render(self, req, mimetype, content, filename=None, rev=None): import SilverCity try: typelang = types[mimetype] lang = typelang[0] module = getattr(SilverCity, lang) generator = getattr(module, lang + "HTMLGenerator") try: allprops = typelang[1] propset = SilverCity.PropertySet() for p in allprops.keys(): propset[... | def render(self, req, mimetype, content, filename=None, rev=None): import SilverCity try: typelang = types[mimetype] lang = typelang[0] module = getattr(SilverCity, lang) generator = getattr(module, lang + "HTMLGenerator") try: allprops = typelang[1] propset = SilverCity.PropertySet() for p in allprops.keys(): propset[... | 25,992 |
def populate_page_dict(db): """Extract wiki page names. This is used to detect broken wiki-links""" global page_dict page_dict = {'TitleIndex': 1} cursor = db.cursor() cursor.execute('SELECT DISTINCT name FROM wiki') while 1: row = cursor.fetchone() if not row: break page_dict[row[0]] = 1 | def populate_page_dict(db): """Extract wiki page names. This is used to detect broken wiki-links""" global page_dict page_dict = {'TitleIndex': 1} cursor = db.cursor() cursor.execute('SELECT DISTINCT name FROM wiki') while 1: row = cursor.fetchone() if not row: break page_dict[row[0]] = 1 | 25,993 |
def populate_page_dict(db): """Extract wiki page names. This is used to detect broken wiki-links""" global page_dict page_dict = {'TitleIndex': 1} cursor = db.cursor() cursor.execute('SELECT DISTINCT name FROM wiki') while 1: row = cursor.fetchone() if not row: break page_dict[row[0]] = 1 | def populate_page_dict(db): """Extract wiki page names. This is used to detect broken wiki-links""" global page_dict page_dict = {'TitleIndex': 1} cursor = db.cursor() cursor.execute('SELECT DISTINCT name FROM wiki') while 1: row = cursor.fetchone() if not row: break page_dict[row[0]] = 1 | 25,994 |
def _begintt_formatter(self, match, fullmatch): return '<tt>' | def _begintt_formatter(self, match, fullmatch): return '<tt>' | 25,995 |
def format(self, text, out): if not text: return '' self.out = out self._open_tags = [] rules = self._compiled_rules | def format(self, text, out): if not text: return '' self.out = out self._open_tags = [] rules = self._compiled_rules | 25,996 |
def flatten(dists): for dist in dists: if dist in memo: continue memo.add(dist) try: predecessors = ws.resolve([dist.as_requirement()]) for predecessor in flatten(predecessors): yield predecessor yield dist except pkg_resources.DistributionNotFound, e: env.log.error('Skipping "%s" ("%s" not found)', dist, e) except pkg... | def flatten(dists): for dist in dists: if dist in memo: continue memo.add(dist) try: predecessors = ws.resolve([dist.as_requirement()]) for predecessor in flatten(predecessors): yield predecessor yield dist except pkg_resources.DistributionNotFound, e: env.log.error('Skipping "%s" ("%s" not found)', dist, e) except pkg... | 25,997 |
def flatten(dists): for dist in dists: if dist in memo: continue memo.add(dist) try: predecessors = ws.resolve([dist.as_requirement()]) for predecessor in flatten(predecessors): yield predecessor yield dist except pkg_resources.DistributionNotFound, e: env.log.error('Skipping "%s" ("%s" not found)', dist, e) except pkg... | def flatten(dists): for dist in dists: if dist in memo: continue memo.add(dist) try: predecessors = ws.resolve([dist.as_requirement()]) for predecessor in flatten(predecessors): yield predecessor yield dist except pkg_resources.DistributionNotFound, e: env.log.error('Skipping "%s" ("%s" not found)', dist, e) except pkg... | 25,998 |
def process_request(self, req): path = req.args.get('path', '/') rev = req.args.get('rev') or None | def process_request(self, req): path = req.args.get('path', '/') rev = req.args.get('rev') or None | 25,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.