rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
req.perm.assert_permission('WIKI_VIEW')
|
def _render_view(self, req, db, page): req.perm.assert_permission('WIKI_VIEW')
|
8d9762d62c1c8b51c8391bef29a67cdb00e53c42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8d9762d62c1c8b51c8391bef29a67cdb00e53c42/web_ui.py
|
|
sql.append("SELECT time,id,'','new',summary,reporter"
|
sql.append("SELECT time,id,'','new',summary,reporter,summary"
|
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = []
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
sql.append("SELECT t1.time,t1.ticket,'','reopened',t2.newvalue,t1.author "
|
sql.append("SELECT t1.time,t1.ticket,'','reopened',t2.newvalue, " " t1.author,t.summary "
|
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = []
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
"t3.newvalue,t1.author"
|
" t3.newvalue,t1.author,t.summary"
|
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = []
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
for t,id,resolution,type,message,author in cursor:
|
for t,id,resolution,type,message,author,summary in cursor:
|
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = []
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
title = 'Ticket <em> id, verbs[type], util.escape(author))
|
title = 'Ticket <em title="%s"> util.escape(summary), id, verbs[type], util.escape(author))
|
def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = []
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
cursor.execute("SELECT tc.time, tc.ticket, " " tc.field, tc.oldvalue, tc.newvalue, tc.author "
|
cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary "
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
for time,id,field,oldvalue,newvalue,author in cursor:
|
for time,id,field,oldvalue,newvalue,author,summary in cursor: this_summary = summary
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
updates.append((previous_update,field_changes,comment))
|
updates.append((previous_update,field_changes,comment, this_summary))
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
updates.append((previous_update,field_changes,comment))
|
updates.append((previous_update,field_changes,comment, this_summary))
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
for (t,id,author),field_changes,comment in updates:
|
for (t,id,author),field_changes,comment,summary in updates:
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
title = 'Ticket <em> % (id, util.escape(author))
|
title = 'Ticket <em title="%s"> % (util.escape(summary), id, util.escape(author))
|
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>=%s AND tc.time<=%s ORDER BY tc.time" % (start, stop)) previous_update = None updates = [] for time,id,field,oldvalue,newvalue,author in cursor: if (time,id,author) != previous_update: if previous_update: updates.append((previous_update,field_changes,comment)) field_changes = [] comment = '' previous_update = (time,id,author) if field == 'comment': comment = newvalue else: field_changes.append(field) if previous_update: updates.append((previous_update,field_changes,comment))
|
3f8ebe11ae78c26fccce599155ca7391f969fb44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f8ebe11ae78c26fccce599155ca7391f969fb44/Ticket.py
|
def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor)
|
def print_doc(self, docs): if not docs: return for cmd, doc in docs: print cmd print '\n\t-- %s\n' % doc
|
def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor)
|
2d161d49087eb53b87fc18a287d0874bacb983fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2d161d49087eb53b87fc18a287d0874bacb983fa/admin.py
|
self.print_doc (doc)
|
self.print_doc(doc)
|
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 + self._help_upgrade + self._help_wiki +
|
2d161d49087eb53b87fc18a287d0874bacb983fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2d161d49087eb53b87fc18a287d0874bacb983fa/admin.py
|
self.print_doc (docs)
|
self.print_doc(docs)
|
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 + self._help_upgrade + self._help_wiki +
|
2d161d49087eb53b87fc18a287d0874bacb983fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2d161d49087eb53b87fc18a287d0874bacb983fa/admin.py
|
'%s:%s
|
'%s:%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:%s' % (module, args), 1 else: return self.href.wiki(args), '%s:%s' % (module, args), 0 elif module == 'report': return self.href.report(args), '%s:%s' % (module, args), 0 elif module == 'changeset': return self.href.changeset(args), '%s:%s' % (module, args), 0 elif module in ['source', 'repos', 'browser']: rev = None match = re.search('([^#]+)#(.+)', args) if match: args = match.group(1) rev = match.group(2) if rev: return self.href.browser(args, rev), \ '%s:%s#%s' % (module, args, rev) else: return self.href.browser(args), '%s:%s' % (module, args), 0 else: return None, None, 0
|
affd3ff51f55a6c541185e7a3d41ec88c01b57ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/affd3ff51f55a6c541185e7a3d41ec88c01b57ad/Wiki.py
|
self.authz.assert_permission(os.path.join(self.scope, path))
|
self.authz.assert_permission(posixpath.join(self.scope, path))
|
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]
|
c4558858367bdbb42bab5c65c45740dc94663d2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c4558858367bdbb42bab5c65c45740dc94663d2e/svn_fs.py
|
event = {'kind': kind, 'title': title, 'author': author, 'href': href, 'time': time.strftime('%H:%M', t), 'date': time.strftime('%x', t), 'message': message}
|
event = {'kind': kind, 'title': title, 'author': author or 'anonymous', 'href': href, 'date': time.strftime('%x', t), 'time': time.strftime('%H:%M', t), 'message': message}
|
def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW)
|
1948ca6d871032fdee163e5f0e26fe948a8b9871 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1948ca6d871032fdee163e5f0e26fe948a8b9871/Timeline.py
|
if author.find('@') != -1: event['author.email'] = author elif author in email_map.keys(): event['author.email'] = email_map[author]
|
if author: if author.find('@') != -1: event['author.email'] = author elif author in email_map.keys(): event['author.email'] = email_map[author]
|
def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW)
|
1948ca6d871032fdee163e5f0e26fe948a8b9871 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1948ca6d871032fdee163e5f0e26fe948a8b9871/Timeline.py
|
if idx > 0:
|
if idx + 1 < len(self.history):
|
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
|
2fb8de4db57c76b9210af8ff7dbff465687b07ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2fb8de4db57c76b9210af8ff7dbff465687b07ec/svn_fs.py
|
ldepth = len(fullmatch.group('ldepth').replace('\t', ' '*8)) match = match.replace('\t', ' '*8)
|
ldepth = len(fullmatch.group('ldepth')) match = match
|
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_ = ('arabiczero', None, 'lowerroman', 'upperroman')[idx] elif listid.isdigit(): start = match[ldepth:match.find('.')] elif listid.islower(): class_ = 'loweralpha' elif listid.isupper(): class_ = 'upperalpha' self._set_list_depth(ldepth, type_, class_, start) return ''
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
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_ = ('arabiczero', None, 'lowerroman', 'upperroman')[idx] elif listid.isdigit(): start = match[ldepth:match.find('.')] elif listid.islower(): class_ = 'loweralpha' elif listid.isupper(): class_ = 'upperalpha' self._set_list_depth(ldepth, type_, class_, start) return ''
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
||
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
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
||
self.close_indentation()
|
self.close_indentation()
|
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>')
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
idepth = len(fullmatch.group('idepth').replace('\t', ' '*8))
|
idepth = len(fullmatch.group('idepth'))
|
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 '' elif idepth <= ldepth + (ltype == 'ol' and 3 or 2): self.in_list_item = True return '' if not self.in_def_list: self._set_quote_depth(idepth) return ''
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
if depth > 0: self.in_quote = True
|
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_paragraph() self._quote_stack.pop() self.out.write('</blockquote>' + os.linesep) if depth > self._get_quote_depth(): open_quote(depth) else: while self._quote_stack: deepest_offset = self._quote_stack[-1] if depth >= deepest_offset: break close_quote() if depth > 0: if self._quote_stack: old_offset = self._quote_stack[-1] if old_offset != depth: # adjust last depth self._quote_stack[-1] = depth else: open_quote(depth)
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
|
if depth > self._get_quote_depth(): open_quote(depth)
|
quote_depth = self._get_quote_depth() if depth > quote_depth: self._set_tab(depth) tabstops = self._tabstops[::-1] while tabstops: tab = tabstops.pop() if tab > quote_depth: open_quote(tab)
|
def close_quote(): self.close_table() self.close_paragraph() self._quote_stack.pop() self.out.write('</blockquote>' + os.linesep)
|
7e43017e3b3a44da9976c41cca30877eb4cf89f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e43017e3b3a44da9976c41cca30877eb4cf89f1/formatter.py
|
sql = 'SELECT ' + ', '.join(['ticket.%s AS %s' % (header, header) for header in headers])
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
|
if [k for k in constraints.keys() if k in custom_fields]: sql += ", ticket_custom.name AS name, " \ "ticket_custom.value AS value " \ "FROM ticket LEFT OUTER JOIN ticket_custom ON id = ticket" else: sql += " FROM ticket" sql += " INNER JOIN (SELECT name AS priority_name, value AS priority_value " \ " FROM enum WHERE type = 'priority') AS p" \ " ON priority_name = priority"
|
for k in [k for k in constraints.keys() if k in custom_fields]: sql.append(", %s.value AS %s" % (k, k)) sql.append(" FROM ticket") for k in [k for k in constraints.keys() if k in custom_fields]: sql.append(" LEFT OUTER JOIN ticket_custom AS %s ON " \ "(id=%s.ticket AND %s.name='%s')" % (k, k, k, k)) for col in [c for c in ['status', 'resolution', 'priority', 'severity'] if c in cols]: sql.append(" INNER JOIN (SELECT name AS %s_name, value AS %s_value " \ "FROM enum WHERE type='%s')" \ " ON %s_name=%s" % (col, col, col, col, col))
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
clause = [] col = k if not col in Ticket.std_fields: col = 'value'
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
|
clause.append("%s IN (%s)" % (col, ", ".join(inlist)))
|
clauses.append("%s IN (%s)" % (k, ",".join(inlist)))
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
clause.append("%s LIKE '%%%s%%'" % (col, util.sql_escape(v[0]))) else: clause.append("%s = '%s'" % (col, util.sql_escape(v[0]))) if not k in Ticket.std_fields: clauses.append("(name='%s' AND (" % k + " OR ".join(clause) + "))") else: clauses.append(" OR ".join(clause))
|
clauses.append("%s LIKE '%%%s%%'" % (k, util.sql_escape(v[0]))) else: clauses.append("%s='%s'" % (k, util.sql_escape(v[0])))
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
sql += " WHERE " + " AND ".join(clauses) if order in ['priority', 'severity']: sql += " ORDER BY %s_value" % order
|
sql.append(" WHERE " + " AND ".join(clauses)) if order in ['status', 'resolution', 'priority', 'severity']: sql.append(" ORDER BY %s_value" % order)
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
sql += " ORDER BY " + order
|
sql.append(" ORDER BY " + order)
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
sql += " DESC"
|
sql.append(" DESC") sql = "".join(sql)
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
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'))
|
a3a62640366abf5edeb894dec067a0e76c4eaec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a3a62640366abf5edeb894dec067a0e76c4eaec1/Query.py
|
||
if field['type'] == 'select' or field['name'] == 'owner':
|
if field['type'] == 'select' and field['name'] != 'milestone' \ or field['name'] == 'owner':
|
def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view'
|
64df00cea848352a86df55264aff45b9bf7378bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/64df00cea848352a86df55264aff45b9bf7378bc/Milestone.py
|
by = req.args.get('by', 'component')
|
if component_group_available: by = req.args.get('by', 'component') else: by = req.args.get('by', available_groups[0]['name'])
|
def _render_view(self, req, db, milestone): req.hdf['title'] = 'Milestone %s' % milestone.name req.hdf['milestone.mode'] = 'view'
|
64df00cea848352a86df55264aff45b9bf7378bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/64df00cea848352a86df55264aff45b9bf7378bc/Milestone.py
|
from docutils.__init__ import __version__
|
from docutils import __version__
|
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.3': raise TracError, 'Docutils version >= %s required, %s found' \ % ('0.3.3', __version__)
|
4f58ce999c68863296c1f6a9dc21124e6f3b6a09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4f58ce999c68863296c1f6a9dc21124e6f3b6a09/rst.py
|
if __version__ < '0.3.3':
|
if StrictVersion(__version__) < StrictVersion('0.3.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 __version__ < '0.3.3': raise TracError, 'Docutils version >= %s required, %s found' \ % ('0.3.3', __version__)
|
4f58ce999c68863296c1f6a9dc21124e6f3b6a09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4f58ce999c68863296c1f6a9dc21124e6f3b6a09/rst.py
|
def get_info (self, id):
|
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 self.sql_sub_vars(sql, args) def get_info(self, id, args):
|
def get_info (self, id): cursor = self.db.cursor()
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
def get_info (self, id): cursor = self.db.cursor()
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
||
sql = row[1]
|
sql = self.sql_sub_vars(row[1], args)
|
def get_info (self, id): cursor = self.db.cursor()
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
def render_report_list(self, id):
|
def render_report_list(self, id, args={}):
|
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.REPORT_MODIFY): self.cgi.hdf.setValue('report.edit_href', href.report(id, 'edit')) if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.copy_href', href.report(id, 'copy')) if self.perm.has_permission(perm.REPORT_DELETE): self.cgi.hdf.setValue('report.delete_href', href.report(id, 'delete'))
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
[self.cols, self.rows, title] = self.get_info(id)
|
[self.cols, self.rows, title] = self.get_info(id, args) self.error = None
|
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.REPORT_MODIFY): self.cgi.hdf.setValue('report.edit_href', href.report(id, 'edit')) if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.copy_href', href.report(id, 'copy')) if self.perm.has_permission(perm.REPORT_DELETE): self.cgi.hdf.setValue('report.delete_href', href.report(id, 'delete'))
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
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_chars_re, val) if m: raise ValueError("The character '%s' is not allowed " " in variable data." % m.group()) report_args[arg] = val if hasattr(self,'authname'): report_args['USER'] = self.authname return report_args
|
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.REPORT_MODIFY): self.cgi.hdf.setValue('report.edit_href', href.report(id, 'edit')) if self.perm.has_permission(perm.REPORT_CREATE): self.cgi.hdf.setValue('report.copy_href', href.report(id, 'copy')) if self.perm.has_permission(perm.REPORT_DELETE): self.cgi.hdf.setValue('report.delete_href', href.report(id, 'delete'))
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
|
self.render_report_list(id)
|
self.render_report_list(id, report_args)
|
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')
|
6fbde2a321355430c86a21b8b3c6625f0eeae1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6fbde2a321355430c86a21b8b3c6625f0eeae1a2/Report.py
|
@param interface: the `Interface` class that defines the protocol for the extension point
|
@param interface: the `Interface` subclass that defines the protocol for the extension point
|
def __init__(self, interface): """Create the extension point. @param interface: the `Interface` class that defines the protocol for the extension point """ self.interface = interface
|
a5dc3a344d225d508d643c9f48e6b9cbd9acd356 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5dc3a344d225d508d643c9f48e6b9cbd9acd356/core.py
|
def __get__(self, instance, owner):
|
def extensions(self, component):
|
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
|
a5dc3a344d225d508d643c9f48e6b9cbd9acd356 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5dc3a344d225d508d643c9f48e6b9cbd9acd356/core.py
|
if instance: extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [instance.compmgr[cls] for cls in extensions]) return self
|
extensions = ComponentMeta._registry.get(self.interface, []) return filter(None, [component.compmgr[cls] for cls in extensions])
|
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
|
a5dc3a344d225d508d643c9f48e6b9cbd9acd356 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5dc3a344d225d508d643c9f48e6b9cbd9acd356/core.py
|
field = [field for field in self.fields if field['name'] == name] if not field: return field = field[0]
|
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): # Changed field self._old[name] = self.values.get(name) elif self._old[name] == value: # Change of field reverted del self._old[name] if value and field['type'] != 'textarea': value = value.strip() self.values[name] = value
|
75030c339df92433a43ba1e10ed878ede3621cd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/75030c339df92433a43ba1e10ed878ede3621cd7/model.py
|
|
if value and field['type'] != 'textarea': value = value.strip()
|
if value: field = [field for field in self.fields if field['name'] == name] if field and field[0].get('type') != 'textarea': value = value.strip()
|
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): # Changed field self._old[name] = self.values.get(name) elif self._old[name] == value: # Change of field reverted del self._old[name] if value and field['type'] != 'textarea': value = value.strip() self.values[name] = value
|
75030c339df92433a43ba1e10ed878ede3621cd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/75030c339df92433a43ba1e10ed878ede3621cd7/model.py
|
chg = wrap('%s => %s' % (old, new), self.COLS-l,'', l*' ', CRLF)
|
chg = wrap('%s => %s' % (old, new), self.COLS - l, '', l * ' ', CRLF)
|
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(ticket.id) self.hdf['email.ticket_props'] = self.format_props() self.hdf['email.ticket_body_hdr'] = self.format_hdr() self.hdf['ticket'] = self.ticket.values self.hdf['ticket.new'] = self.newticket subject = self.format_subj() if not self.newticket: subject = 'Re: ' + subject self.hdf['email.subject'] = subject changes = '' if not self.newticket and modtime: # Ticket change changelog = ticket.get_changelog(modtime) for date, author, field, old, new in changelog: self.hdf['ticket.change.author'] = author pfx = 'ticket.change.%s' % field newv = '' if field == 'comment': newv = wrap(new, self.COLS, ' ', ' ', CRLF) elif field == 'description': new_descr = wrap(new, self.COLS, ' ', ' ', CRLF) old_descr = wrap(old, self.COLS, '> ', '> ', CRLF) old_descr = old_descr.replace(2*CRLF, CRLF + '>' + CRLF) cdescr = CRLF cdescr += 'Old description:' + 2*CRLF + old_descr + 2*CRLF cdescr += 'New description:' + 2*CRLF + new_descr + CRLF self.hdf['email.changes_descr'] = cdescr else: newv = new l = 7 + len(field) chg = wrap('%s => %s' % (old, new), self.COLS-l,'', l*' ', CRLF) changes += ' * %s: %s%s' % (field, chg, CRLF) if newv: self.hdf['%s.oldvalue' % pfx] = old self.hdf['%s.newvalue' % pfx] = newv if field == 'cc': self.prev_cc += old and self.parse_cc(old) or [] self.hdf['%s.author' % pfx] = author if changes: self.hdf['email.changes_body'] = changes NotifyEmail.notify(self, ticket.id, subject)
|
3d1032bee3c9bf4495912205a22ef56bc2445920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d1032bee3c9bf4495912205a22ef56bc2445920/Notify.py
|
i = 1
|
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') > -1: continue idx = 2 * (i % 2) if len(f) > width[idx]: width[idx] = len(f) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval) format = ('%%%is: %%-%is | ' % (width[0], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) i = 1 l = (width[0] + width[1] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big = [] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), fval)) else: txt += format[i % 2] % (f.capitalize(), fval) if not i % 2: txt += CRLF if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt
|
3d1032bee3c9bf4495912205a22ef56bc2445920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d1032bee3c9bf4495912205a22ef56bc2445920/Notify.py
|
|
sep = l*'-' + '+' + (self.COLS-l)*'-'
|
sep = l * '-' + '+' + (self.COLS - l) * '-'
|
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') > -1: continue idx = 2 * (i % 2) if len(f) > width[idx]: width[idx] = len(f) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval) format = ('%%%is: %%-%is | ' % (width[0], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) i = 1 l = (width[0] + width[1] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big = [] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), fval)) else: txt += format[i % 2] % (f.capitalize(), fval) if not i % 2: txt += CRLF if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt
|
3d1032bee3c9bf4495912205a22ef56bc2445920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d1032bee3c9bf4495912205a22ef56bc2445920/Notify.py
|
big = [] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue
|
big = [f for f in tkt.fields if f['type'] == 'textarea' and f['name'] != 'description'] i = 0 for f in [f['name'] for f in fields]: if not tkt.values.has_key(f): continue
|
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') > -1: continue idx = 2 * (i % 2) if len(f) > width[idx]: width[idx] = len(f) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval) format = ('%%%is: %%-%is | ' % (width[0], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) i = 1 l = (width[0] + width[1] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big = [] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), fval)) else: txt += format[i % 2] % (f.capitalize(), fval) if not i % 2: txt += CRLF if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt
|
3d1032bee3c9bf4495912205a22ef56bc2445920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d1032bee3c9bf4495912205a22ef56bc2445920/Notify.py
|
big.append((f.capitalize(), fval))
|
big.append((f.capitalize(), CRLF.join(fval.splitlines())))
|
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') > -1: continue idx = 2 * (i % 2) if len(f) > width[idx]: width[idx] = len(f) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval) format = ('%%%is: %%-%is | ' % (width[0], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) i = 1 l = (width[0] + width[1] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big = [] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), fval)) else: txt += format[i % 2] % (f.capitalize(), fval) if not i % 2: txt += CRLF if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt
|
3d1032bee3c9bf4495912205a22ef56bc2445920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d1032bee3c9bf4495912205a22ef56bc2445920/Notify.py
|
content = content_to_unicode(self.env, content, mimetype) content = content.encode('utf-8')
|
def code_block(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): """ Create a code-block directive for docutils.
|
4710b1ee154b9033dd1535b3d222820d617dd24a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4710b1ee154b9033dd1535b3d222820d617dd24a/rst.py
|
|
distributions.scan([os.path.join(env.path, 'plugins')])
|
distributions.scan([plugins_dir])
|
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' % (value, path or 'default path')) if path: path = [path] try: load_component(value, path) except ImportError, e: env.log.error('Component module %s not found', value, exc_info=True) # Load components from the environment plugins directory if pkg_resources is not None: # But only if setuptools is installed! distributions = pkg_resources.AvailableDistributions() distributions.scan([os.path.join(env.path, 'plugins')]) for name in distributions: egg = distributions[name][0] if egg.metadata.has_metadata(TRAC_META): egg.install_on() # Put the egg on sys.path for module in egg.metadata.get_metadata_lines(TRAC_META): if module not in loaded_components: try: __import__(module) loaded_components.append(module) except ImportError, e: env.log.error('Component module %s not found', module, exc_info=True) elif os.listdir(os.path.join(env.path, 'plugins')): self.env.warning('setuptools is required for plugin deployment') # Load default components from trac.db_default import default_components for module in default_components: if not module in loaded_components: load_component(module)
|
43345aa46b343a84e983bf82ed4b43a15c66642d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/43345aa46b343a84e983bf82ed4b43a15c66642d/loader.py
|
elif os.listdir(os.path.join(env.path, 'plugins')): self.env.warning('setuptools is required for plugin deployment')
|
elif os.path.exists(plugins_dir) and os.listdir(plugins_dir): env.log.warning('setuptools is required for plugin deployment')
|
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' % (value, path or 'default path')) if path: path = [path] try: load_component(value, path) except ImportError, e: env.log.error('Component module %s not found', value, exc_info=True) # Load components from the environment plugins directory if pkg_resources is not None: # But only if setuptools is installed! distributions = pkg_resources.AvailableDistributions() distributions.scan([os.path.join(env.path, 'plugins')]) for name in distributions: egg = distributions[name][0] if egg.metadata.has_metadata(TRAC_META): egg.install_on() # Put the egg on sys.path for module in egg.metadata.get_metadata_lines(TRAC_META): if module not in loaded_components: try: __import__(module) loaded_components.append(module) except ImportError, e: env.log.error('Component module %s not found', module, exc_info=True) elif os.listdir(os.path.join(env.path, 'plugins')): self.env.warning('setuptools is required for plugin deployment') # Load default components from trac.db_default import default_components for module in default_components: if not module in loaded_components: load_component(module)
|
43345aa46b343a84e983bf82ed4b43a15c66642d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/43345aa46b343a84e983bf82ed4b43a15c66642d/loader.py
|
list = filter(None, self.path.split('/'))
|
links = [''] + filter(None, self.path.split('/'))
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(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) req.hdf.setValue('log.path.%d.url' % i, url) if i == len(list) - 1: self.add_link('up', url, 'Parent directory')
|
e657a410e187a3e9e4f1a8b92259fb8cc38e4855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e657a410e187a3e9e4f1a8b92259fb8cc38e4855/Log.py
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(path))
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(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) req.hdf.setValue('log.path.%d.url' % i, url) if i == len(list) - 1: self.add_link('up', url, 'Parent directory')
|
e657a410e187a3e9e4f1a8b92259fb8cc38e4855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e657a410e187a3e9e4f1a8b92259fb8cc38e4855/Log.py
|
|
for part in list[:-1]: i = i + 1
|
for part in links:
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(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) req.hdf.setValue('log.path.%d.url' % i, url) if i == len(list) - 1: self.add_link('up', url, 'Parent directory')
|
e657a410e187a3e9e4f1a8b92259fb8cc38e4855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e657a410e187a3e9e4f1a8b92259fb8cc38e4855/Log.py
|
req.hdf.setValue('log.path.%d' % i, part)
|
req.hdf.setValue('log.path.%d' % i, part or 'root')
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(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) req.hdf.setValue('log.path.%d.url' % i, url) if i == len(list) - 1: self.add_link('up', url, 'Parent directory')
|
e657a410e187a3e9e4f1a8b92259fb8cc38e4855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e657a410e187a3e9e4f1a8b92259fb8cc38e4855/Log.py
|
if i == len(list) - 1:
|
if i == len(links) - 1:
|
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.browser(path, rev)) else: req.hdf.setValue('log.path.0.url', self.env.href.browser(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) req.hdf.setValue('log.path.%d.url' % i, url) if i == len(list) - 1: self.add_link('up', url, 'Parent directory')
|
e657a410e187a3e9e4f1a8b92259fb8cc38e4855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e657a410e187a3e9e4f1a8b92259fb8cc38e4855/Log.py
|
options = field['options'][:] for option in field['options']: if Milestone(self.env, option, db=db).is_completed: options.remove(option)
|
options = [opt for opt in field['options'] if not Milestone(self.env, opt, db=db).is_completed]
|
def process_newticket_request(self, req): req.perm.require('TICKET_CREATE') data = {} db = self.env.get_db_cnx()
|
3970dd4a7a555e1d3c8bb04e19885b42e9301e7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3970dd4a7a555e1d3c8bb04e19885b42e9301e7c/web_ui.py
|
name = field['name']
|
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
|
3970dd4a7a555e1d3c8bb04e19885b42e9301e7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3970dd4a7a555e1d3c8bb04e19885b42e9301e7c/web_ui.py
|
|
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
|
c6f3b6c5ccafff9c6f4d03ca41c33c880fbf7ab3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c6f3b6c5ccafff9c6f4d03ca41c33c880fbf7ab3/perm.py
|
|
if self._old.items() != self.items():
|
if self._old != self:
|
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
|
65eedb1a845760bedc1e31848f0ccb57dbb68cff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/65eedb1a845760bedc1e31848f0ccb57dbb68cff/session.py
|
self.session.save()
|
if self.session: self.session.save()
|
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.startswith('https://'): # Make sure the URL is absolute url = absolute_url(self, url) self.send_header('Location', url) self.send_header('Content-Type', 'text/plain') self.send_header('Pragma', 'no-cache') self.send_header('Cache-control', 'no-cache') self.send_header('Expires', 'Fri, 01 Jan 1999 00:00:00 GMT') cookies = self.outcookie.output(header='') for cookie in cookies.splitlines(): self.send_header('Set-Cookie', cookie.strip()) self.end_headers() self.write('Redirecting...') raise RequestDone()
|
f89afe534018c2f403b5379f4d099cb56801629a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f89afe534018c2f403b5379f4d099cb56801629a/main.py
|
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) })
|
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)})
|
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
|
304dd4bf8e213af2fc5d50550012062a558f1fb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/304dd4bf8e213af2fc5d50550012062a558f1fb2/util.py
|
cnx.db.execute("BEGIN")
|
cursor = cnx.cursor() cursor.execute("UPDATE system SET name=NULL WHERE name IS NULL")
|
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) print 'OK' except Exception, err: print err # Unlock database cnx.db.execute("ROLLBACK")
|
1a5c9ee288859fe530603f4fb55d552e95bce8c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1a5c9ee288859fe530603f4fb55d552e95bce8c0/admin.py
|
cnx.db.execute("ROLLBACK")
|
cnx.rollback()
|
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) print 'OK' except Exception, err: print err # Unlock database cnx.db.execute("ROLLBACK")
|
1a5c9ee288859fe530603f4fb55d552e95bce8c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1a5c9ee288859fe530603f4fb55d552e95bce8c0/admin.py
|
'subject': self.newticket and subject or 'Re: ' + subject,
|
'subject': subject,
|
def notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
|
d3a7ec83ce37e009158d86cfb2f62449827d0ebe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d3a7ec83ce37e009158d86cfb2f62449827d0ebe/notification.py
|
self.out.write('<h%d id="%s">%s</h%d>' % (depth, anchor.encode('utf-8'),
|
self.out.write('<h%d id="%s">%s</h%d>' % (depth, anchor,
|
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()
|
969528ae44455e5e07461c03f613349593aed5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/969528ae44455e5e07461c03f613349593aed5c5/formatter.py
|
% (path, revision), 'Not such file or directory')
|
% (path, revision), 'No such file or directory')
|
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)
|
f038fcc67fdd336078cf659f327aa7dd06098ec4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f038fcc67fdd336078cf659f327aa7dd06098ec4/Browser.py
|
next_href = req.href.changeset(next_rev, path)
|
if repos.has_node(path, next_rev): next_href = req.href.changeset(next_rev, path) else: next_href = req.href.changeset(next_rev)
|
def _changeset_title(rev): if restricted: return 'Changeset %s for %s' % (rev, path) else: return 'Changeset %s' % rev
|
26ac401acb1ad08daca72a1a9aa3119b5bdc8b31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/26ac401acb1ad08daca72a1a9aa3119b5bdc8b31/changeset.py
|
'href': query.get_href(order=col, desc=(col == query.order))
|
'href': query.get_href(order=col, desc=(col == query.order and not query.desc))
|
def display_html(self, req, query): req.hdf['title'] = 'Custom Query' add_stylesheet(req, 'common/css/report.css')
|
0afb24d58efbb29c0dd4937413011b3a4c1cf20f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0afb24d58efbb29c0dd4937413011b3a4c1cf20f/query.py
|
if 'q' in req.args: query = orig_query = req.args.get('q')
|
query = req.args.get('q') if query:
|
def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW')
|
23bca424dc9cb65b248f03baa913c5d4159c7cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/23bca424dc9cb65b248f03baa913c5d4159c7cb3/Search.py
|
req.hdf['search.q'] = orig_query.replace('"', "&
|
req.hdf['search.q'] = req.args.get('q').replace('"', "&
|
def process_request(self, req): req.perm.assert_permission('SEARCH_VIEW')
|
23bca424dc9cb65b248f03baa913c5d4159c7cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/23bca424dc9cb65b248f03baa913c5d4159c7cb3/Search.py
|
from trac.wiki.formatter import wiki_to_html
|
from trac.wiki.formatter import wiki_to_html, system_message
|
def render_macro(self, req, name, content): from trac.wiki.formatter import wiki_to_html from trac.wiki import WikiSystem wiki = WikiSystem(self.env)
|
34f53d9d296c0eaf756523c2c1b7e2e3412e9af4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/34f53d9d296c0eaf756523c2c1b7e2e3412e9af4/macros.py
|
descr = macro_provider.get_macro_description(macro_name) yield (macro_name, descr or '')
|
try: descr = macro_provider.get_macro_description(macro_name) descr = wiki_to_html(descr or '', self.env, req) except Exception, e: descr = Markup(system_message( "Error: Can't get description for macro %s" \ % macro_name, e)) yield (macro_name, descr)
|
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 '')
|
34f53d9d296c0eaf756523c2c1b7e2e3412e9af4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/34f53d9d296c0eaf756523c2c1b7e2e3412e9af4/macros.py
|
html.DD[wiki_to_html(description, self.env, req)])
|
html.DD[description])
|
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 '')
|
34f53d9d296c0eaf756523c2c1b7e2e3412e9af4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/34f53d9d296c0eaf756523c2c1b7e2e3412e9af4/macros.py
|
"WHERE type=%s AND value=%s", (self.name, self.value, self.type, self._old_value))
|
"WHERE type=%s AND name=%s", (self.name, self.value, self.type, self._old_name))
|
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
|
c815765ee307a6af8eb82a2569c1f4ea0859d552 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c815765ee307a6af8eb82a2569c1f4ea0859d552/model.py
|
obj.name = name obj.value = value
|
obj.name = obj._old_name = name obj.value = obj._old_value = value
|
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
|
c815765ee307a6af8eb82a2569c1f4ea0859d552 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c815765ee307a6af8eb82a2569c1f4ea0859d552/model.py
|
_rules = [r"""(?P<svnimg>(source|repos):([^ ]+)(\.png|\.jpg|\.jpeg|\.gif))"""] + \
|
_rules = [r"""(?P<svnimg>(source|repos):([^ ]+)\.(PNG|png|JPG|jpg|JPEG|jpeg|GIF|gif))"""] + \
|
def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules
|
6dbb61eaad1b376102b2e1b4e224451b147b73b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6dbb61eaad1b376102b2e1b4e224451b147b73b4/Wiki.py
|
r"""(?P<imgurl>([a-z]+://[^ ]+)(\.png|\.jpg|\.jpeg|\.gif)(\\?[^\s])*)""",
|
r"""(?P<imgurl>([a-z]+://[^ ]+)\.(PNG|png|JPG|jpg|JPEG|jpeg|GIF|gif)(\\?[^\s])*)""",
|
def format(self, text, out): if not text: return self.out = out self._open_tags = [] rules = self._compiled_rules
|
6dbb61eaad1b376102b2e1b4e224451b147b73b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6dbb61eaad1b376102b2e1b4e224451b147b73b4/Wiki.py
|
print mimeviewer, exists, name
|
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() == '}}}': self.in_code_block -= 1 if self.in_code_block == 0 and self.code_processor: self.close_paragraph() self.close_table() self.out.write(self.code_processor(self.hdf, self.code_text, self.env)) else: self.code_text += line + os.linesep elif not self.code_processor: match = Formatter._processor_re.search(line) if match: name = match.group(1) if Formatter.builtin_processors.has_key(name): self.code_processor = Formatter.builtin_processors[name] else: try: self.code_processor = self.load_macro(name) except Exception, e: mimeviewer, exists = self.env.mimeview.get_viewer(name) print mimeviewer, exists, name if exists != -1: self.mime_type = name self.code_processor = self.mime_processor else: self.code_text += line + os.linesep self.code_processor = Formatter.builtin_processors['default'] self.out.write('<div class="error">Failed to load processor macro %s: %s t %s</div>' % (name, line, e)) else: self.code_text += line + os.linesep self.code_processor = Formatter.builtin_processors['default'] else: self.code_text += line + os.linesep
|
a45a37f722836eebeb662ee3750860041b820571 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a45a37f722836eebeb662ee3750860041b820571/WikiFormatter.py
|
|
print version, latest_version
|
def process_request(self, req): action = req.args.get('action', 'view') pagename = req.args.get('page', 'WikiStart') version = req.args.get('version')
|
7e9b65058c8c05c29b8f8fe309c5939aefe40d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e9b65058c8c05c29b8f8fe309c5939aefe40d5a/web_ui.py
|
|
quoted_re = re.compile("^(?:&
|
quoted_re = re.compile("^(?:\";|')(.*)(?:\";|')$")
|
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.compile('^[0-9]+%?$') align_re = re.compile('^(?:left|right|top|bottom)$') keyval_re = re.compile('^([-a-z0-9]+)([=:])(.*)') quoted_re = re.compile("^(?:"|')(.*)(?:"|')$") attr = {} style = {} nolink = False for arg in args[1:]: arg = arg.strip() if size_re.search(arg): # 'width' keyword attr['width'] = arg continue if align_re.search(arg): # 'align' keyword attr['align'] = arg continue if arg == 'nolink': nolink = True continue match = keyval_re.search(arg) if match: key = match.group(1) sep = match.group(2) val = match.group(3) m = quoted_re.search(val) # unquote " character " if m: val = m.group(1) if sep == '=': attr[key] = val; elif sep == ':': style[key] = val
|
9cad83244e0dc6c3fa33247aef62ecb2a91396ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9cad83244e0dc6c3fa33247aef62ecb2a91396ca/macros.py
|
m = quoted_re.search(val)
|
m = quoted_re.search(val)
|
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.compile('^[0-9]+%?$') align_re = re.compile('^(?:left|right|top|bottom)$') keyval_re = re.compile('^([-a-z0-9]+)([=:])(.*)') quoted_re = re.compile("^(?:"|')(.*)(?:"|')$") attr = {} style = {} nolink = False for arg in args[1:]: arg = arg.strip() if size_re.search(arg): # 'width' keyword attr['width'] = arg continue if align_re.search(arg): # 'align' keyword attr['align'] = arg continue if arg == 'nolink': nolink = True continue match = keyval_re.search(arg) if match: key = match.group(1) sep = match.group(2) val = match.group(3) m = quoted_re.search(val) # unquote " character " if m: val = m.group(1) if sep == '=': attr[key] = val; elif sep == ':': style[key] = val
|
9cad83244e0dc6c3fa33247aef62ecb2a91396ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9cad83244e0dc6c3fa33247aef62ecb2a91396ca/macros.py
|
return ('', 'text/plain;charset=utf-8')
|
return ('', 'text/plain;charset=utf-8', '.txt')
|
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')
|
76cc6ddbf0445d108e6f4e3e2203ecf65dcf00fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/76cc6ddbf0445d108e6f4e3e2203ecf65dcf00fc/api.py
|
cr_re = re.compile('\r$', re.MULTILINE)
|
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[p] = allprops[p] except IndexError: pass except (KeyError, AttributeError): err = "No SilverCity lexer found for mime-type '%s'." % mimetype raise Exception, err
|
de04d40e538050affafc40c5bea0d27e5a7d6a36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/de04d40e538050affafc40c5bea0d27e5a7d6a36/silvercity.py
|
|
r"""(?P<begintt>\{\{\{)""", r"""(?P<endtt>\}\}\})""",
|
r"""(?P<inlinecode>\{\{\{(?P<inline>.*)\}\}\})""",
|
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
|
79f037dc1a45ad31c8543afffec2cc8ebcd5c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/79f037dc1a45ad31c8543afffec2cc8ebcd5c637/Wiki.py
|
r"""(?P<wikilink>(^|(?<=[^A-Za-z]))[A-Z][a-z/]*(?:[A-Z][a-z/]+)+)""",
|
r"""(?P<wikilink>(^|(?<=[^A-Za-z]))[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)""",
|
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
|
79f037dc1a45ad31c8543afffec2cc8ebcd5c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/79f037dc1a45ad31c8543afffec2cc8ebcd5c637/Wiki.py
|
def _begintt_formatter(self, match, fullmatch): return '<tt>' def _endtt_formatter(self, match, fullmatch): return '</tt>'
|
def _inlinecode_formatter(self, match, fullmatch): return '<tt>%s</tt>' % fullmatch.group('inline')
|
def _begintt_formatter(self, match, fullmatch): return '<tt>'
|
79f037dc1a45ad31c8543afffec2cc8ebcd5c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/79f037dc1a45ad31c8543afffec2cc8ebcd5c637/Wiki.py
|
'linkname', 'macroname', 'macroargs')
|
'linkname', 'macroname', 'macroargs', 'inline')
|
def format(self, text, out): if not text: return '' self.out = out self._open_tags = [] rules = self._compiled_rules
|
79f037dc1a45ad31c8543afffec2cc8ebcd5c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/79f037dc1a45ad31c8543afffec2cc8ebcd5c637/Wiki.py
|
env.log.debug('Loading plugin %s from %s', name,
|
env.log.debug('Loading egg plugin %s from %s', name,
|
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_resources.VersionConflict, e: env.log.error('Skipping "%s" (version conflict: "%s")', dist, e)
|
42ac7772c042fe373f965030fcbfecd4d5430aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/42ac7772c042fe373f965030fcbfecd4d5430aed/loader.py
|
if os.path.dirname(egg.location) == plugins_dir:
|
if os.path.dirname(egg.location) == plugins_dirs[0]:
|
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_resources.VersionConflict, e: env.log.error('Skipping "%s" (version conflict: "%s")', dist, e)
|
42ac7772c042fe373f965030fcbfecd4d5430aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/42ac7772c042fe373f965030fcbfecd4d5430aed/loader.py
|
'path': path, 'rev': node.rev,
|
'path': path, 'rev': node.rev, 'stickyrev': rev,
|
def process_request(self, req): path = req.args.get('path', '/') rev = req.args.get('rev') or None
|
bf1d50ac479a1a6f11e57debc84a84af720c4670 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bf1d50ac479a1a6f11e57debc84a84af720c4670/browser.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.