rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
msg = MIMEText (body)
|
msg = MIMEText(body, 'plain', 'utf-8')
|
def send(self, rcpt, mime_headers={}):
|
3f02f2ac732d18b63be45396663354e0178a2fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f02f2ac732d18b63be45396663354e0178a2fb6/Notify.py
|
msg['Subject'] = self.subject
|
msg['Subject'] = Header(self.subject, 'utf-8')
|
def send(self, rcpt, mime_headers={}):
|
3f02f2ac732d18b63be45396663354e0178a2fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f02f2ac732d18b63be45396663354e0178a2fb6/Notify.py
|
self.assertRaises(AssertionError, self.module._do_login, req)
|
self.assertRaises(TracError, self.module._do_login, req)
|
def test_login_no_username(self): req = Mock(incookie=Cookie(), href=Href('/trac.cgi'), remote_addr='127.0.0.1', remote_user=None) self.assertRaises(AssertionError, self.module._do_login, req)
|
9d7b6fd351e201ae5760f271973aca178c171e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9d7b6fd351e201ae5760f271973aca178c171e79/auth.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
|
af46c235a463f240f94203ff5eaa106197438805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/af46c235a463f240f94203ff5eaa106197438805/Wiki.py
|
r"""(?P<url>([a-z]+://[^ ]+[^\., ]))"""]
|
r"""(?P<url>([a-z]+://[^ ]+[^\., ]))""", r"""(?P<table>\|\|.*\|\|)"""]
|
def format(self, text, out): if not text: return '' self.out = out self._open_tags = [] rules = self._compiled_rules
|
af46c235a463f240f94203ff5eaa106197438805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/af46c235a463f240f94203ff5eaa106197438805/Wiki.py
|
if len(result) and not self.in_list_item:
|
if self.in_table and line[0:2] != '||': self.close_table() if len(result) and not self.in_list_item and not self.in_table:
|
def format(self, text, out): self.out = out self._open_tags = [] self._list_stack = [] self.in_pre = 0 self.indent_level = 0 self.paragraph_open = 0
|
af46c235a463f240f94203ff5eaa106197438805 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/af46c235a463f240f94203ff5eaa106197438805/Wiki.py
|
self.log.error("Failed to load wiki macro %s (%s)" % (f, e), e)
|
self.log.error('Failed to load wiki macro %s (%s)' % (f, e))
|
def get_macros(self): path = os.path.join(self.env.path, 'wiki-macros') if not os.path.exists(path): return for file in [f for f in os.listdir(path) if f.lower().endswith('.py') and not f.startswith('__')]: try: module = self._load_macro(file[:-3]) yield module.__name__ except Exception, e: self.log.error("Failed to load wiki macro %s (%s)" % (f, e), e)
|
f1f2fd0c2c9bc1c365df36c394339c92adbef0ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1f2fd0c2c9bc1c365df36c394339c92adbef0ef/macros.py
|
def notify(self, ticket, newticket=1, modtime=0):
|
def notify(self, ticket, newticket=True, modtime=0):
|
def notify(self, ticket, newticket=1, 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 self.hdf['ticket.new'] = self.newticket and '1' or '0' 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)
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
self.hdf['ticket'] = self.ticket self.hdf['ticket.new'] = self.newticket and '1' or '0'
|
self.hdf['ticket'] = self.ticket.values self.hdf['ticket.new'] = self.newticket
|
def notify(self, ticket, newticket=1, 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 self.hdf['ticket.new'] = self.newticket and '1' or '0' 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)
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
fields = [f for f in tkt.fields if f['type'] != 'textarea']
|
fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] != 'summary']
|
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea'] 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 f in tkt.values.keys(): 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[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF)) i = 1 l = (width[2] + width[3] + 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 i % 2: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
width = [0,0,0,0]
|
width = [0, 0, 0, 0]
|
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea'] 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 f in tkt.values.keys(): 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[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF)) i = 1 l = (width[2] + width[3] + 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 i % 2: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
format = ('%%%is: %%-%is | ' % (width[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF))
|
format = ('%%%is: %%-%is | ' % (width[1], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF))
|
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea'] 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 f in tkt.values.keys(): 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[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF)) i = 1 l = (width[2] + width[3] + 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 i % 2: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
l = (width[2] + width[3] + 5)
|
l = (width[0] + width[1] + 5)
|
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea'] 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 f in tkt.values.keys(): 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[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF)) i = 1 l = (width[2] + width[3] + 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 i % 2: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
if i % 2:
|
if not i % 2:
|
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea'] 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 f in tkt.values.keys(): 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[2], width[3]), ' %%%is: %%-%is%s' % (width[0], width[1], CRLF)) i = 1 l = (width[2] + width[3] + 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 i % 2: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
a22b27d0e4f761dd138cc5e194f848edcd6694d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a22b27d0e4f761dd138cc5e194f848edcd6694d1/Notify.py
|
_from = time.mktime(time.strptime(_from, '%Y-%m-%d'))
|
_from = time.mktime(time.strptime(_from, '%Y-%m-%d')) + 86399
|
def render (self): perm.assert_permission(perm.TIMELINE_VIEW) _from = dict_get_with_default(self.args, 'from', '') _daysback = dict_get_with_default(self.args, 'daysback', '')
|
123dd48f6274e99499c1dffef24b74132e4adaa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/123dd48f6274e99499c1dffef24b74132e4adaa5/Timeline.py
|
if restricted and \ not (npath.startswith(path) or path.startswith(npath)):
|
if (restricted and not (npath == path or npath.startswith(path + '/') or path.startswith(npath + '/'))):
|
def get_changes(): old_node = new_node = None for npath, kind, change, opath, orev in chgset.get_changes(): if restricted and \ not (npath.startswith(path) # npath is below or path.startswith(npath)): # npath is above continue if change != Changeset.ADD: old_node = repos.get_node(opath, orev) if change != Changeset.DELETE: new_node = repos.get_node(npath, rev) yield old_node, new_node, kind, change
|
f3d8439d603c6ddb0bc5bf763583e28334f1da24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f3d8439d603c6ddb0bc5bf763583e28334f1da24/changeset.py
|
"FROM ticket_change " "WHERE ticket=%s AND time=%s "
|
"FROM ticket_change WHERE ticket=%s AND time=%s "
|
def get_changelog(self, db, when=0): """ Returns the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue). """ cursor = db.cursor() if when: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change " "WHERE ticket=%s AND time=%s " "UNION " "SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s " "ORDER BY time", (self['id'], when, self['id'], when)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id'])) log = [] while 1: row = cursor.fetchone() if not row: break log.append((int(row[0]), row[1], row[2], row[3] or '', row[4] or '')) return log
|
1dab45eaf48ef49fc4090dae333ca224cf1daac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1dab45eaf48ef49fc4090dae333ca224cf1daac5/Ticket.py
|
"SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s "
|
"SELECT time,author,'attachment',null,filename " "FROM attachment WHERE id=%s AND time=%s " "UNION " "SELECT time,author,'comment',null,description " "FROM attachment WHERE id=%s AND time=%s "
|
def get_changelog(self, db, when=0): """ Returns the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue). """ cursor = db.cursor() if when: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change " "WHERE ticket=%s AND time=%s " "UNION " "SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s " "ORDER BY time", (self['id'], when, self['id'], when)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id'])) log = [] while 1: row = cursor.fetchone() if not row: break log.append((int(row[0]), row[1], row[2], row[3] or '', row[4] or '')) return log
|
1dab45eaf48ef49fc4090dae333ca224cf1daac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1dab45eaf48ef49fc4090dae333ca224cf1daac5/Ticket.py
|
(self['id'], when, self['id'], when))
|
(self['id'], when, self['id'], when, self['id'], when))
|
def get_changelog(self, db, when=0): """ Returns the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue). """ cursor = db.cursor() if when: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change " "WHERE ticket=%s AND time=%s " "UNION " "SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s " "ORDER BY time", (self['id'], when, self['id'], when)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id'])) log = [] while 1: row = cursor.fetchone() if not row: break log.append((int(row[0]), row[1], row[2], row[3] or '', row[4] or '')) return log
|
1dab45eaf48ef49fc4090dae333ca224cf1daac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1dab45eaf48ef49fc4090dae333ca224cf1daac5/Ticket.py
|
"SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id']))
|
"SELECT time,author,'attachment',null,filename " "FROM attachment WHERE id=%s " "UNION " "SELECT time,author,'comment',null,description " "FROM attachment WHERE id=%s " "ORDER BY time", (self['id'], self['id'], self['id']))
|
def get_changelog(self, db, when=0): """ Returns the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue). """ cursor = db.cursor() if when: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change " "WHERE ticket=%s AND time=%s " "UNION " "SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s " "ORDER BY time", (self['id'], when, self['id'], when)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id'])) log = [] while 1: row = cursor.fetchone() if not row: break log.append((int(row[0]), row[1], row[2], row[3] or '', row[4] or '')) return log
|
1dab45eaf48ef49fc4090dae333ca224cf1daac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1dab45eaf48ef49fc4090dae333ca224cf1daac5/Ticket.py
|
for category, items in chrome['nav'].items():
|
for category, items in req.chrome['nav'].items():
|
def populate_hdf(self, req): """Add chrome-related data to the HDF (deprecated).""" req.hdf['HTTP.PathInfo'] = req.path_info req.hdf['htdocs_location'] = req.chrome['htdocs_location']
|
280a7ae6656e7256af352ca2056260635647deed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/280a7ae6656e7256af352ca2056260635647deed/chrome.py
|
next_rev=lambda x: None)
|
next_rev=lambda x: None, normalize_rev=lambda rev: rev)
|
def test_get_changes(self): cursor = self.db.cursor() cursor.execute("INSERT INTO revision (rev,time,author,message) " "VALUES (0,41000,'','')") cursor.execute("INSERT INTO revision (rev,time,author,message) " "VALUES (1,42000,'joe','Import')") cursor.executemany("INSERT INTO node_change (rev,path,kind,change," "base_path,base_rev) VALUES ('1',%s,%s,%s,%s,%s)", [('trunk', 'D', 'A', None, None), ('trunk/README', 'F', 'A', None, None)])
|
e5f618d6ce5bcceffda8a8ba36d4dde2c5540883 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e5f618d6ce5bcceffda8a8ba36d4dde2c5540883/cache.py
|
self._pages[page.name] = True
|
self._index[page.name] = True
|
def wiki_page_added(self, page): if not self.has_page(page.name): self.log.debug('Adding page %s to index' % page.name) self._pages[page.name] = True
|
6016e59b4135ed3f7c6e83947b4ce4780828318b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6016e59b4135ed3f7c6e83947b4ce4780828318b/api.py
|
del self._pages[page.name]
|
del self._index[page.name]
|
def wiki_page_deleted(self, page): if self.has_page(page.name): self.log.debug('Removing page %s from index' % page.name) del self._pages[page.name]
|
6016e59b4135ed3f7c6e83947b4ce4780828318b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6016e59b4135ed3f7c6e83947b4ce4780828318b/api.py
|
if current != default:
|
if current is not False and current != default:
|
def save(self): """Write the configuration options to the primary file.""" if not self.filename: return
|
ed38126f39d53ca6a1aec88cd44d5ab21eeb3bb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ed38126f39d53ca6a1aec88cd44d5ab21eeb3bb7/config.py
|
assert req.remote_user, 'Authentication information not available.'
|
if not req.remote_user: raise TracError(html("Authentication information not available. " "Please refer to the ", html.a('installation documentation', title="Configuring Authentication", href=req.href.wiki('TracInstall') + "
|
def _do_login(self, req): """Log the remote user in.
|
398e08d339261711b1903572d6c7f20bce47246c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398e08d339261711b1903572d6c7f20bce47246c/auth.py
|
self._render_view(req, db, id)
|
resp = self._render_view(req, db, id) if not resp: return None template, content_type = resp if content_type: return resp
|
def process_request(self, req): req.perm.assert_permission(perm.REPORT_VIEW)
|
cc5a2bd4b4bfc0e8605972ba931079ff6f540765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/cc5a2bd4b4bfc0e8605972ba931079ff6f540765/report.py
|
if start != 0 and end != 0:
|
if start != 0 or end != 0:
|
def _markup_intraline_change(fromlines, tolines): from trac.versioncontrol.diff import _get_change_extent for i in xrange(len(fromlines)): fr, to = fromlines[i], tolines[i] (start, end) = _get_change_extent(fr, to) if start != 0 and end != 0: fromlines[i] = fr[:start] + '\0' + fr[start:end+len(fr)] + \ '\1' + fr[end:] tolines[i] = to[:start] + '\0' + to[start:end+len(to)] + \ '\1' + to[end:]
|
22a68462328079195e38fb69bcf74220bec71eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/22a68462328079195e38fb69bcf74220bec71eaa/patch.py
|
entry_point.load()
|
try: entry_point.load() except pkg_resources.DistributionNotFound, e: env.log.warning('Cannot load plugin %s because it ' 'requires "%s"', name, e)
|
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)
|
5341fbc7f0c27eda363c2c0337931be2a3314b7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5341fbc7f0c27eda363c2c0337931be2a3314b7d/loader.py
|
return 1
|
if mimetype.startswith('text/'): return 1 return 0
|
def get_quality_ratio(self, mimetype): return 1
|
32023f53ffb2fbb535422adcf69fec050ec2bc20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/32023f53ffb2fbb535422adcf69fec050ec2bc20/api.py
|
if is_binary(content) or mimetype in TREAT_AS_BINARY:
|
if is_binary(content):
|
def render(self, req, mimetype, content, filename=None, rev=None): if is_binary(content) or mimetype in TREAT_AS_BINARY: self.env.log.debug("Binary data; no preview available") return
|
32023f53ffb2fbb535422adcf69fec050ec2bc20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/32023f53ffb2fbb535422adcf69fec050ec2bc20/api.py
|
directory = os.path.dirname(db_name)
|
directory = os.path.dirname(db_name) or os.curdir
|
def __init__(self, db_name, create=0): if not create and not os.access(db_name, os.F_OK): raise EnvironmentError, 'Database "%s" not found.' % db_name directory = os.path.dirname(db_name) if not create and not os.access(db_name, os.R_OK + os.W_OK) or \ not os.access(directory, os.R_OK + os.W_OK): tmp = db_name db_name = None raise EnvironmentError, \ 'The web server user requires read _and_ write permission\n' \ 'to the database %s and the directory this file is located in.' % tmp self.db_name = db_name sqlite.Connection.__init__(self, db_name, timeout=10000)
|
2483a290759dc3d4a2ce70fbb4914d61800dcc78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2483a290759dc3d4a2ce70fbb4914d61800dcc78/db.py
|
return '<span class="wiki-error">Macro %s(%s) failed: %s</span' \
|
return '<span class="error">Macro %s(%s) failed: %s</span' \
|
def _macro_formatter(self, match, fullmatch): name = fullmatch.group('macroname') if name in ['br', 'BR']: return '<br />' args = fullmatch.group('macroargs') try: macro = self.load_macro(name) return macro(self.hdf, args) except Exception, e: return '<span class="wiki-error">Macro %s(%s) failed: %s</span' \ % (name, args, e)
|
7deb1ca4fe8435bf6ad7b4387d3492e71e182fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7deb1ca4fe8435bf6ad7b4387d3492e71e182fce/Wiki.py
|
ticket.update(Ticket(self.db, int(rest_id)).data)
|
ticket.update(Ticket(self.db, int(rest_id)))
|
def display_html(self, req, query): req.hdf['title'] = 'Custom Query'
|
8808237ef5804dbcfc142ad9bc7de79fdf48e618 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8808237ef5804dbcfc142ad9bc7de79fdf48e618/Query.py
|
print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname
|
print "Initenv for '%s' failed." % self.envname print "Does an environment already exist?"
|
def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None db_str = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name, db_str, repository_dir, templates_dir = returnvals elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg) return else: project_name, db_str, repository_dir, templates_dir = arg[0:3]
|
8b495b027970524ccd5fc7a72bf985cb15d1480c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8b495b027970524ccd5fc7a72bf985cb15d1480c/admin.py
|
if len(arg) == 1:
|
if len(arg) == 1 and not arg[0]:
|
def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None db_str = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name, db_str, repository_dir, templates_dir = returnvals elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg) return else: project_name, db_str, repository_dir, templates_dir = arg[0:3]
|
8b495b027970524ccd5fc7a72bf985cb15d1480c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8b495b027970524ccd5fc7a72bf985cb15d1480c/admin.py
|
elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg)
|
elif len(arg) != 4: print 'Wrong number of arguments to initenv: %d' % len(arg)
|
def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None db_str = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name, db_str, repository_dir, templates_dir = returnvals elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg) return else: project_name, db_str, repository_dir, templates_dir = arg[0:3]
|
8b495b027970524ccd5fc7a72bf985cb15d1480c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8b495b027970524ccd5fc7a72bf985cb15d1480c/admin.py
|
project_name, db_str, repository_dir, templates_dir = arg[0:3]
|
project_name, db_str, repository_dir, templates_dir = arg[:4]
|
def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None db_str = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name, db_str, repository_dir, templates_dir = returnvals elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg) return else: project_name, db_str, repository_dir, templates_dir = arg[0:3]
|
8b495b027970524ccd5fc7a72bf985cb15d1480c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8b495b027970524ccd5fc7a72bf985cb15d1480c/admin.py
|
match = re.search('^/(ticket|report)(/([0-9]+)/*)?', path_info)
|
match = re.search('^/(ticket|report)(?:/([0-9]+)/*)?', path_info)
|
def set_if_missing(fs, name, value): if not fs.has_key(name): fs.list.append(cgi.MiniFieldStorage(name, value))
|
139c1450ff08037af84034ee9b3d917e2391e8df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/139c1450ff08037af84034ee9b3d917e2391e8df/core.py
|
req.write(page.text)
|
req.write(req.hdf.getValue('wiki.page_source', ''))
|
def display_txt(self, req): req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.end_headers() req.write(page.text)
|
77159384355e3a96ab5240ac7ec7c7654335c073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/77159384355e3a96ab5240ac7ec7c7654335c073/Wiki.py
|
repos = self.env.get_repository()
|
repos = self.env.get_repository(req.authname)
|
def render(self, req): rev = req.args.get('rev') path = req.args.get('path', '/')
|
89459c9171bcb96c5e169770af27041385e9517d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/89459c9171bcb96c5e169770af27041385e9517d/Browser.py
|
repos = self.env.get_repository()
|
repos = self.env.get_repository(req.authname)
|
def render(self, req): self.perm.assert_permission(perm.LOG_VIEW)
|
89459c9171bcb96c5e169770af27041385e9517d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/89459c9171bcb96c5e169770af27041385e9517d/Browser.py
|
max_diff_bytes = self.max_diff_bytes max_diff_files = self.max_diff_files diff_bytes = diff_files = 0 if max_diff_bytes or max_diff_files: for old_node, new_node, kind, change in get_changes(): if change == Changeset.EDIT and kind == Node.FILE: diff_files += 1 diff_bytes += _estimate_changes(old_node, new_node) show_diffs = (not max_diff_files or diff_files <= max_diff_files) and \ (not max_diff_bytes or diff_bytes <= max_diff_bytes or \ diff_files == 1)
|
if req.perm.has_permission('FILE_VIEW'): diff_bytes = diff_files = 0 if self.max_diff_bytes or self.max_diff_files: for old_node, new_node, kind, change in get_changes(): if change == Changeset.EDIT and kind == Node.FILE: diff_files += 1 diff_bytes += _estimate_changes(old_node, new_node) show_diffs = (not self.max_diff_files or \ diff_files <= self.max_diff_files) and \ (not self.max_diff_bytes or \ diff_bytes <= self.max_diff_bytes or \ diff_files == 1) else: show_diffs = False
|
def _content_changes(old_node, new_node): """Returns the list of differences.
|
c99dba3495d17aa6f510db5f9a2f10970cc659ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c99dba3495d17aa6f510db5f9a2f10970cc659ce/changeset.py
|
if change != Changeset.EDIT: show_entry = True else:
|
show_entry = True if change == Changeset.EDIT and \ req.perm.has_permission('FILE_VIEW'):
|
def _content_changes(old_node, new_node): """Returns the list of differences.
|
c99dba3495d17aa6f510db5f9a2f10970cc659ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c99dba3495d17aa6f510db5f9a2f10970cc659ce/changeset.py
|
if show_files:
|
if show_files and req.perm.has_permission('BROWSER_VIEW'):
|
def get_timeline_events(self, req, start, stop, filters): if 'changeset' in filters: format = req.args.get('format') wiki_format = self.wiki_format_messages show_files = self.timeline_show_files db = self.env.get_db_cnx() repos = self.env.get_repository(req.authname) for chgset in repos.get_changesets(start, stop): message = chgset.message or '--' if wiki_format: shortlog = wiki_to_oneliner(message, self.env, db, shorten=True) else: shortlog = shorten_line(message)
|
c99dba3495d17aa6f510db5f9a2f10970cc659ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c99dba3495d17aa6f510db5f9a2f10970cc659ce/changeset.py
|
util.sql_to_hdf(self.db, "SELECT name FROM milestone ORDER BY name",
|
util.sql_to_hdf(self.db, "SELECT name FROM milestone WHERE completed=0 " "ORDER BY name",
|
def render(self, req): self.perm.assert_permission(perm.TICKET_CREATE)
|
c3f6e9ff37a236d2c1bb6cb4cfcaa6c1a4c43fc8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c3f6e9ff37a236d2c1bb6cb4cfcaa6c1a4c43fc8/Ticket.py
|
if len(path_parts) > 1 and path_parts[1] == 'login': env_name = path_parts[0]
|
base_path = environ['trac.base_path'] if len(path_parts) > len(base_path)+1 and path_parts[len(base_path)+1] == 'login': env_name = path_parts[len(base_path)]
|
def handle_one_request(self): environ = self.setup_environ() path_info = environ.get('PATH_INFO', '') path_parts = filter(None, path_info.split('/')) if len(path_parts) > 1 and path_parts[1] == 'login': env_name = path_parts[0] if env_name: auth = self.server.auths.get(env_name, self.server.auths.get('*')) if not auth: self.send_error(500, 'Authentication not enabled for %s. ' 'Please use the tracd --auth option.' % env_name) return remote_user = auth.do_auth(self) if not remote_user: return environ['REMOTE_USER'] = remote_user
|
4e86c69aadb530e875fc800c141e3a2fc3e52f9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4e86c69aadb530e875fc800c141e3a2fc3e52f9d/standalone.py
|
line = unicode(line, sys.stdin.encoding)
|
line = util.to_unicode(line, sys.stdin.encoding)
|
def onecmd(self, line): """`line` may be a `str` or an `unicode` object""" try: if isinstance(line, str): line = unicode(line, sys.stdin.encoding) rv = cmd.Cmd.onecmd(self, line) or 0 except SystemExit: raise except Exception, e: print>>sys.stderr, 'Command failed: %s' % e rv = 2 if not self.interactive: return rv
|
fd112cf9a7955fa29a885549a286a09e5eb91a4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/fd112cf9a7955fa29a885549a286a09e5eb91a4c/admin.py
|
if '\n' in fval:
|
if '\n' in str(fval):
|
def format_props(self): tkt = self.ticket tkt['id'] = '%s' % tkt['id'] t = self.modtime or tkt['time'] tkt['modified'] = time.strftime('%c', time.localtime(t)) fields = ['id', 'status', 'component', 'modified', 'severity', 'milestone', 'priority', 'version', 'owner', 'reporter'] fields.extend(filter(lambda f: f.startswith('custom_'), self.ticket.keys())) i = 1 width = [0,0,0,0] for f in fields: if not tkt.has_key(f) or str(tkt[f]).find('\n') > -1: continue fname = f.startswith('custom_') and f[7:] or f idx = 2*(i % 2) if len(fname) > width[idx]: width[idx] = len(fname) if len(tkt[f]) > width[idx+1]: width[idx+1] = len(tkt[f]) i += 1 format = (' %%%is: %%-%is%s' % (width[0], width[1], CRLF), '%%%is: %%-%is | ' % (width[2], width[3])) i = 1 l = (width[2] + width[3] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big=[] for f in fields: if not tkt.has_key(f): continue fval = tkt[f] fname = f.startswith('custom_') and f[7:] or f if '\n' in fval: big.append((fname.capitalize(), fval)) else: txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
|
d15546d3e2db496d5e9f4735f68c9076accfad26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d15546d3e2db496d5e9f4735f68c9076accfad26/Notify.py
|
cursor.execute('CREATE SCHEMA %s' % cnx.schema)
|
cursor.execute('CREATE SCHEMA "%s"' % cnx.schema)
|
def init_db(self, path, user=None, password=None, host=None, port=None, params={}): cnx = self.get_connection(path, user, password, host, port, params) cursor = cnx.cursor() if cnx.schema: cursor.execute('CREATE SCHEMA %s' % cnx.schema) cursor.execute('SET search_path TO %s', (cnx.schema,)) from trac.db_default import schema for table in schema: for stmt in self.to_sql(table): cursor.execute(stmt) cnx.commit()
|
7b3103940f071554f22886f1b004412070a13528 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7b3103940f071554f22886f1b004412070a13528/postgres_backend.py
|
+ ':' + '\\n'.join(re.split(r'[\r\n]+', value))
|
+ ':' + escape_value(value)
|
def write_prop(name, value, params={}): text = ';'.join([name] + [k + '=' + v for k, v in params.items()]) \ + ':' + '\\n'.join(re.split(r'[\r\n]+', value)) firstline = 1 while text: if not firstline: text = ' ' + text else: firstline = 0 req.write(text[:75] + CRLF) text = text[75:]
|
9d8e6ac0ff6e0d7a78bd82d39aa5877187cb46e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9d8e6ac0ff6e0d7a78bd82d39aa5877187cb46e3/roadmap.py
|
'order': 0},
|
'order': 0, 'optional': False},
|
def test_custom_field_select(self): self.env.config.set('ticket-custom', 'test', 'select') self.env.config.set('ticket-custom', 'test.label', 'Test') self.env.config.set('ticket-custom', 'test.value', '1') self.env.config.set('ticket-custom', 'test.options', 'option1|option2') fields = TicketSystem(self.env).get_custom_fields() self.assertEqual({'name': 'test', 'type': 'select', 'label': 'Test', 'value': '1', 'options': ['option1', 'option2'], 'order': 0}, fields[0])
|
07f99205bfdcc4946c40b169a9bc47814a7766fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/07f99205bfdcc4946c40b169a9bc47814a7766fd/api.py
|
for path, change in editor.changes.items(): if not (_is_path_within_scope(self.scope, path) and \ self.authz.has_permission(path)):
|
for key_path, change in editor.changes.items(): if not (_is_path_within_scope(self.scope, key_path) and \ self.authz.has_permission(key_path)):
|
def get_changes(self): pool = Pool(self.pool) tmp = Pool(pool) root = fs.revision_root(self.fs_ptr, self.rev, pool()) editor = repos.RevisionChangeCollector(self.fs_ptr, self.rev, pool()) e_ptr, e_baton = delta.make_editor(editor, pool()) repos.svn_repos_replay(root, e_ptr, e_baton, pool())
|
f18a88e153407411eec806945787cfdefaf0fb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f18a88e153407411eec806945787cfdefaf0fb05/svn_fs.py
|
deletions[base_path] = idx
|
deletions[key_path] = idx
|
def get_changes(self): pool = Pool(self.pool) tmp = Pool(pool) root = fs.revision_root(self.fs_ptr, self.rev, pool()) editor = repos.RevisionChangeCollector(self.fs_ptr, self.rev, pool()) e_ptr, e_baton = delta.make_editor(editor, pool()) repos.svn_repos_replay(root, e_ptr, e_baton, pool())
|
f18a88e153407411eec806945787cfdefaf0fb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f18a88e153407411eec806945787cfdefaf0fb05/svn_fs.py
|
req.write('-- %s\n\n' % '\n-- '.join(row[1].splitlines()))
|
req.write('-- %s\n\n' % '\n-- '.join(description.splitlines()))
|
def _render_sql(self, req, id, title, description, sql): req.perm.assert_permission(perm.REPORT_SQL_VIEW) req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.end_headers()
|
dfa0e1a7ddee96eb3a41a9a4612775bcdb08277e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/dfa0e1a7ddee96eb3a41a9a4612775bcdb08277e/report.py
|
for row in rows] or None
|
for row in rows] or []
|
def fetchmany(self, num): rows = sqlite.Cursor.fetchmany(self, num) return rows != None and [self._convert_row(row) for row in rows] or None
|
5059b72f350e0dfe8a5b16e2cda8709645b8d652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5059b72f350e0dfe8a5b16e2cda8709645b8d652/sqlite_backend.py
|
for row in rows] or None
|
for row in rows] or []
|
def fetchall(self): rows = sqlite.Cursor.fetchall(self) return rows != None and [self._convert_row(row) for row in rows] or None
|
5059b72f350e0dfe8a5b16e2cda8709645b8d652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5059b72f350e0dfe8a5b16e2cda8709645b8d652/sqlite_backend.py
|
if not vals:
|
if type(vals) is ListType: vals = map(lambda x: x.value, filter(None, vals)) elif vals.value: vals = [vals.value] else:
|
def get_constraints(self): constraints = {} custom_fields = [f['name'] for f in get_custom_fields(self.env)] constrained_fields = [k for k in self.args.keys() if k in Ticket.std_fields or k in custom_fields] for field in constrained_fields: vals = self.args[field] if not vals: continue if type(vals) is ListType: for j in range(len(vals)): vals[j] = vals[j].value else: vals = vals.value constraints[field] = vals; return constraints
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
if type(vals) is ListType: for j in range(len(vals)): vals[j] = vals[j].value else: vals = vals.value constraints[field] = vals;
|
constraints[field] = vals
|
def get_constraints(self): constraints = {} custom_fields = [f['name'] for f in get_custom_fields(self.env)] constrained_fields = [k for k in self.args.keys() if k in Ticket.std_fields or k in custom_fields] for field in constrained_fields: vals = self.args[field] if not vals: continue if type(vals) is ListType: for j in range(len(vals)): vals[j] = vals[j].value else: vals = vals.value constraints[field] = vals; return constraints
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
self.req.hdf.setValue('title', 'Advanced Ticket Query')
|
self.req.hdf.setValue('title', 'Custom Query')
|
def _render_editor(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') util.add_to_hdf(constraints, self.req.hdf, 'query.constraints')
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
def add_options(field, options, constraints, prefix):
|
self.req.hdf.setValue('query.order', order) if desc: self.req.hdf.setValue('query.desc', '1') def add_options(field, constraints, prefix, options):
|
def _render_editor(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') util.add_to_hdf(constraints, self.req.hdf, 'query.constraints')
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
def add_db_options(field, db, sql, constraints, prefix):
|
def add_db_options(field, constraints, prefix, cursor, sql):
|
def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix)
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
add_options(field, options, constraints, prefix) add_options('status', [{'name': 'new'}, {'name': 'assigned'}, {'name': 'reopened'}, {'name': 'closed'}], constraints, 'query.options.') add_options('resolution', [{'name': 'fixed'}, {'name': 'invalid'}, {'name': 'wontfix'}, {'name': 'duplicate'}, {'name': 'worksforme'}], constraints, 'query.options.')
|
add_options(field, constraints, prefix, options) add_options('status', constraints, 'query.options.', [{'name': 'new'}, {'name': 'assigned'}, {'name': 'reopened'}, {'name': 'closed'}]) add_options('resolution', constraints, 'query.options.', [{'name': 'fixed'}, {'name': 'invalid'}, {'name': 'wontfix'}, {'name': 'duplicate'}, {'name': 'worksforme'}])
|
def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix)
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
add_db_options('component', cursor, 'SELECT name FROM component ORDER BY name', constraints, 'query.options.') add_db_options('milestone', cursor, 'SELECT name FROM milestone ORDER BY name', constraints, 'query.options.') add_db_options('version', cursor, 'SELECT name FROM version ORDER BY name', constraints, 'query.options.') add_db_options('priority', cursor, 'SELECT name FROM enum WHERE type=\'priority\'', constraints, 'query.options.') add_db_options('severity', cursor, 'SELECT name FROM enum WHERE type=\'severity\'', constraints, 'query.options.')
|
add_db_options('component', constraints, 'query.options.', cursor, 'SELECT name FROM component ORDER BY name', ) add_db_options('milestone', constraints, 'query.options.', cursor, 'SELECT name FROM milestone ORDER BY name') add_db_options('version', constraints, 'query.options.', cursor, 'SELECT name FROM version ORDER BY name') add_db_options('priority', constraints, 'query.options.', cursor, 'SELECT name FROM enum WHERE type=\'priority\'') add_db_options('severity', constraints, 'query.options.', cursor, 'SELECT name FROM enum WHERE type=\'severity\'')
|
def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix)
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
options = [option for option in custom['options'] if option] for i in range(len(options)):
|
for i in range(len(reduce(None, custom['options']))):
|
def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix)
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
for k in [k for k,v in constraints.items() if not type(v) is ListType]: self.req.hdf.setValue('query.%s' % k, constraints[k]) self.req.hdf.setValue('query.order', order) self.req.hdf.setValue('query.desc', str(desc))
|
def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix)
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
|
self.req.hdf.setValue('title', 'Advanced Ticket Query')
|
self.req.hdf.setValue('title', 'Custom Query')
|
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit'))
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
if type(v) is ListType:
|
if len(v) > 1:
|
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit'))
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
clause.append("%s LIKE '%%%s%%'" % (col, util.sql_escape(v))) else: clause.append("%s = '%s'" % (col, util.sql_escape(v)))
|
clause.append("%s LIKE '%%%s%%'" % (col, util.sql_escape(v[0]))) else: clause.append("%s = '%s'" % (col, util.sql_escape(v[0])))
|
def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit'))
|
f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py
|
environ['PATH_INFO'] = request_uri[len(root_uri):]
|
environ['PATH_INFO'] = urllib.unquote(request_uri[len(root_uri):])
|
def dispatch_request(environ, start_response): """Main entry point for the Trac web interface. @param environ: the WSGI environment dict @param start_response: the WSGI callback for starting the response """ if 'mod_python.options' in environ: options = environ['mod_python.options'] environ.setdefault('trac.env_path', options.get('TracEnv')) environ.setdefault('trac.env_parent_dir', options.get('TracEnvParentDir')) environ.setdefault('trac.env_index_template', options.get('TracEnvIndexTemplate')) environ.setdefault('trac.template_vars', options.get('TracTemplateVars')) environ.setdefault('trac.locale', options.get('TracLocale')) if 'TracUriRoot' in options: # Special handling of SCRIPT_NAME/PATH_INFO for mod_python, which # tends to get confused for whatever reason root_uri = options['TracUriRoot'].rstrip('/') request_uri = environ['REQUEST_URI'].split('?', 1)[0] if not request_uri.startswith(root_uri): raise ValueError('TracUriRoot set to %s but request URL ' 'is %s' % (root_uri, request_uri)) environ['SCRIPT_NAME'] = root_uri environ['PATH_INFO'] = request_uri[len(root_uri):] else: environ.setdefault('trac.env_path', os.getenv('TRAC_ENV')) environ.setdefault('trac.env_parent_dir', os.getenv('TRAC_ENV_PARENT_DIR')) environ.setdefault('trac.env_index_template', os.getenv('TRAC_ENV_INDEX_TEMPLATE')) environ.setdefault('trac.template_vars', os.getenv('TRAC_TEMPLATE_VARS')) environ.setdefault('trac.locale', '') locale.setlocale(locale.LC_ALL, environ['trac.locale']) # Allow specifying the python eggs cache directory using SetEnv if 'mod_python.subprocess_env' in environ: egg_cache = environ['mod_python.subprocess_env'].get('PYTHON_EGG_CACHE') if egg_cache: os.environ['PYTHON_EGG_CACHE'] = egg_cache # Determine the environment env_path = environ.get('trac.env_path') if not env_path: env_parent_dir = environ.get('trac.env_parent_dir') env_paths = environ.get('trac.env_paths') if env_parent_dir or env_paths: # The first component of the path is the base name of the # environment path_info = environ.get('PATH_INFO', '').lstrip('/').split('/') env_name = path_info.pop(0) if not env_name: # No specific environment requested, so render an environment # index page send_project_index(environ, start_response, env_parent_dir, env_paths) return [] # To make the matching patterns of request handlers work, we append # the environment name to the `SCRIPT_NAME` variable, and keep only # the remaining path in the `PATH_INFO` variable. environ['SCRIPT_NAME'] = Href(environ['SCRIPT_NAME'])(env_name) environ['PATH_INFO'] = '/'.join([''] + path_info) if env_parent_dir: env_path = os.path.join(env_parent_dir, env_name) else: env_path = get_environments(environ).get(env_name) if not env_path or not os.path.isdir(env_path): start_response('404 Not Found', []) return ['Environment not found'] if not env_path: raise EnvironmentError('The environment options "TRAC_ENV" or ' '"TRAC_ENV_PARENT_DIR" or the mod_python ' 'options "TracEnv" or "TracEnvParentDir" are ' 'missing. Trac requires one of these options ' 'to locate the Trac environment(s).') env = _open_environment(env_path, run_once=environ['wsgi.run_once']) base_url = env.config.get('trac', 'base_url') if base_url: environ['trac.base_url'] = base_url req = Request(environ, start_response) try: db = env.get_db_cnx() try: try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except RequestDone: pass return req._response or [] finally: db.close() except HTTPException, e: env.log.warn(e) if req.hdf: req.hdf['title'] = e.reason or 'Error' req.hdf['error'] = { 'title': e.reason or 'Error', 'type': 'TracError', 'message': e.message } try: req.send_error(sys.exc_info(), status=e.code) except RequestDone: return [] except Exception, e: env.log.exception(e) import traceback from StringIO import StringIO tb = StringIO() traceback.print_exc(file=tb) if req.hdf: req.hdf['title'] = str(e) or 'Error' req.hdf['error'] = { 'title': str(e) or 'Error', 'type': 'internal', 'traceback': tb.getvalue() } try: req.send_error(sys.exc_info(), status=500) except RequestDone: return []
|
172b14264331a1d44b6d03286a5ea62a3c083681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/172b14264331a1d44b6d03286a5ea62a3c083681/main.py
|
order = self.args.get('order', 'priority')
|
order = self.args.get('order')
|
def render(self): self.perm.assert_permission(perm.TICKET_VIEW)
|
c4106557ad9af2fb73c02f6459b968ba509bdc9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c4106557ad9af2fb73c02f6459b968ba509bdc9a/Query.py
|
if not action and not constraints:
|
if not (action or constraints or order or desc):
|
def render(self): self.perm.assert_permission(perm.TICKET_VIEW)
|
c4106557ad9af2fb73c02f6459b968ba509bdc9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c4106557ad9af2fb73c02f6459b968ba509bdc9a/Query.py
|
self.req.hdf.setValue('query.order', order)
|
self.req.hdf.setValue('query.order', order or 'priority')
|
def _render_editor(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') util.add_to_hdf(constraints, self.req.hdf, 'query.constraints') self.req.hdf.setValue('query.order', order) if desc: self.req.hdf.setValue('query.desc', '1')
|
c4106557ad9af2fb73c02f6459b968ba509bdc9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c4106557ad9af2fb73c02f6459b968ba509bdc9a/Query.py
|
properties.append({'name': 'owner', 'type': 'text', 'label': 'Owner'})
|
restrict_owner = self.config.get('ticket', 'restrict_owner', '') if restrict_owner.lower() in TRUE: usernames = [escape(u[0]) for u in self.env.get_known_users()] properties.append({'name': 'owner', 'type': 'select', 'label': 'Owner', 'options': usernames}) else: properties.append({'name': 'owner', 'type': 'text', 'label': 'Owner'})
|
def rows_to_list(sql): list = [] cursor.execute(sql) while 1: row = cursor.fetchone() if not row: break list.append(row[0]) return list
|
da5e6d0276192eeb4b8ab0eb1367601f08f27d2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/da5e6d0276192eeb4b8ab0eb1367601f08f27d2c/Query.py
|
raise ImportError, 'No module named ' + module_name
|
raise ImportError, 'No module named ' + head
|
def load_component(name, path=None, globals=None, locals=None): if '.' in name: i = name.find('.') head, tail = name[:i], name[i + 1:] else: head, tail = name, '' module = _load_module(head, head, None, path) if not module: raise ImportError, 'No module named ' + module_name while tail: i = tail.find('.') if i < 0: i = len(tail) head, tail = tail[:i], tail[i + 1:] module_name = '%s.%s' % (module.__name__, head) module = _load_module(head, module_name, module, path) if not module: raise ImportError, 'No module named ' + module_name
|
b7686e4dcb32df3073567d61273bb0088a7fb073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b7686e4dcb32df3073567d61273bb0088a7fb073/loader.py
|
perms = {'resolve': 'TICKET_MODIFY', 'reassign': 'TICKET_CHGPROP', 'accept': 'TICKET_CHGPROP', 'reopen': 'TICKET_CREATE'}
|
perms = {'resolve': 'TICKET_MODIFY', 'reassign': 'TICKET_MODIFY', 'accept': 'TICKET_MODIFY', 'reopen': 'TICKET_CREATE'}
|
def get_available_actions(self, ticket, perm_): """Returns the actions that can be performed on the ticket.""" actions = { 'new': ['leave', 'resolve', 'reassign', 'accept'], 'assigned': ['leave', 'resolve', 'reassign' ], 'reopened': ['leave', 'resolve', 'reassign' ], 'closed': ['leave', 'reopen'] } perms = {'resolve': 'TICKET_MODIFY', 'reassign': 'TICKET_CHGPROP', 'accept': 'TICKET_CHGPROP', 'reopen': 'TICKET_CREATE'} return [action for action in actions.get(ticket['status'], ['leave']) if action not in perms or perm_.has_permission(perms[action])]
|
de435afa6c5637e55a7a337802a17e075f48adfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/de435afa6c5637e55a7a337802a17e075f48adfb/api.py
|
users.append(username)
|
if perm.get_user_permissions(username).get('TICKET_MODIFY'): users.append(username)
|
def get_ticket_fields(self): """Returns the list of fields available for tickets.""" from trac.ticket import model
|
de435afa6c5637e55a7a337802a17e075f48adfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/de435afa6c5637e55a7a337802a17e075f48adfb/api.py
|
'TICKET_VIEW',
|
'TICKET_VIEW',
|
def get_permission_actions(self): return ['TICKET_APPEND', 'TICKET_CREATE', 'TICKET_CHGPROP', 'TICKET_VIEW', ('TICKET_MODIFY', ['TICKET_APPEND', 'TICKET_CHGPROP']), ('TICKET_ADMIN', ['TICKET_CREATE', 'TICKET_MODIFY', 'TICKET_VIEW'])]
|
de435afa6c5637e55a7a337802a17e075f48adfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/de435afa6c5637e55a7a337802a17e075f48adfb/api.py
|
if self.render_unsafe_content and not binary \ and format == 'txt':
|
if not mime_type or (self.render_unsafe_content and \ not binary and format == 'txt'):
|
def _render_view(self, req, attachment): perm_map = {'ticket': 'TICKET_VIEW', 'wiki': 'WIKI_VIEW'} req.perm.assert_permission(perm_map[attachment.parent_type])
|
697163cab78008bf726ef4b43d9786575921b00a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/697163cab78008bf726ef4b43d9786575921b00a/attachment.py
|
def __init__(self, parent, parent_pool):
|
def __init__(self, parent, parent_pool=lambda: None):
|
def __init__(self, parent, parent_pool): """ Create a new pool that is a sub-pool of `parent_pool`, and arrange for `self.close` to be called up when the `parent` object is destroyed. The `parent` object must be weak-referenceable. The returned `Pool` instance will have the value of the newly created pool. """ self.pool = core.svn_pool_create(parent_pool) try: parent._pool_closer = weakref.ref(parent, self.close) except TypeError: self.close() raise return self
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.pool = core.svn_pool_create(parent_pool)
|
self.pool = core.svn_pool_create(parent_pool()) self.children = [] if parent_pool(): parent_pool.children.append(self)
|
def __init__(self, parent, parent_pool): """ Create a new pool that is a sub-pool of `parent_pool`, and arrange for `self.close` to be called up when the `parent` object is destroyed. The `parent` object must be weak-referenceable. The returned `Pool` instance will have the value of the newly created pool. """ self.pool = core.svn_pool_create(parent_pool) try: parent._pool_closer = weakref.ref(parent, self.close) except TypeError: self.close() raise return self
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.close()
|
self.close(None)
|
def __init__(self, parent, parent_pool): """ Create a new pool that is a sub-pool of `parent_pool`, and arrange for `self.close` to be called up when the `parent` object is destroyed. The `parent` object must be weak-referenceable. The returned `Pool` instance will have the value of the newly created pool. """ self.pool = core.svn_pool_create(parent_pool) try: parent._pool_closer = weakref.ref(parent, self.close) except TypeError: self.close() raise return self
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
return self
|
def __init__(self, parent, parent_pool): """ Create a new pool that is a sub-pool of `parent_pool`, and arrange for `self.close` to be called up when the `parent` object is destroyed. The `parent` object must be weak-referenceable. The returned `Pool` instance will have the value of the newly created pool. """ self.pool = core.svn_pool_create(parent_pool) try: parent._pool_closer = weakref.ref(parent, self.close) except TypeError: self.close() raise return self
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
|
self.pool = Pool(self, None)
|
self.pool = Pool(self)
|
def __init__(self, path, authz, log): Repository.__init__(self, authz, log)
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.fs_ptr, self.pool)
|
self.fs_ptr, self._pool)
|
def get_changeset(self, rev): return SubversionChangeset(int(rev), self.authz, self.scope, self.fs_ptr, self.pool)
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.pool)
|
self._pool)
|
def get_node(self, path, rev=None): self.authz.assert_permission(self.scope + path) if path and path[-1] == '/': path = path[:-1]
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.root = fs.revision_root(fs_ptr, rev, pool)
|
self.root = fs.revision_root(fs_ptr, rev, self.pool)
|
def __init__(self, path, rev, authz, scope, fs_ptr, pool): self.authz = authz self.scope = scope self.fs_ptr = fs_ptr self.pool = Pool(self, pool) self._requested_rev = rev
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.rev = fs.node_created_rev(self.root, self.scope + path, pool)
|
self.rev = fs.node_created_rev(self.root, self.scope + path, self.pool)
|
def __init__(self, path, rev, authz, scope, fs_ptr, pool): self.authz = authz self.scope = scope self.fs_ptr = fs_ptr self.pool = Pool(self, pool) self._requested_rev = rev
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
self.scope, self.fs_ptr, self.pool)
|
self.scope, self.fs_ptr, self._pool)
|
def get_entries(self): if self.isfile: return entries = fs.dir_entries(self.root, self.scope + self.path, self.pool) for item in entries.keys(): path = '/'.join((self.path, item)) if not self.authz.has_permission(path): continue yield SubversionNode(path, self._requested_rev, self.authz, self.scope, self.fs_ptr, self.pool)
|
49a6a8628b2faed066712b77f631d65bf31f507c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/49a6a8628b2faed066712b77f631d65bf31f507c/svn_fs.py
|
req.hdf['settings'] = req.session.data
|
req.hdf['settings'] = req.session
|
def render(self, req): action = req.args.get('action') if action == 'save': self.save_settings(req) elif action == 'load': self.load_session(req) elif action == 'login': req.redirect(self.env.href.login()) elif action == 'newsession': raise TracError, 'new session'
|
c2bd7a10d013cd581849cef62b43665191ce11b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c2bd7a10d013cd581849cef62b43665191ce11b4/Settings.py
|
def setup_config(self):
|
def setup_config(self, load_defaults=None):
|
def setup_config(self): self.config = Configuration(None)
|
ff5437e76828d421661873d5615cbb7ffb26e548 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ff5437e76828d421661873d5615cbb7ffb26e548/admin.py
|
if tkt.get('description'):
|
if tkt.values.get('description'):
|
def parse(self, fp): msg = email.message_from_file(fp) tkt = Ticket(self.env) tkt['status'] = 'new' tkt['reporter'] = msg['from'] tkt['summary'] = msg['subject'] for part in msg.walk(): if part.get_content_type() == 'text/plain': tkt['description'] = part.get_payload(decode=1).strip()
|
328eab8671ff26dd0b218fce45334d7e67024b65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/328eab8671ff26dd0b218fce45334d7e67024b65/emailfilter.py
|
heading, depth))
|
wiki_to_oneliner(heading, self.env, self._db, self._absurls), depth))
|
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()
|
11894387abe9b64133af097f465137fdc5c88ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/11894387abe9b64133af097f465137fdc5c88ce9/formatter.py
|
def render (self): perm.assert_permission (perm.LOG_VIEW) info = self.get_info (self.path)
|
dcf652585ee9639acb2682a332bf095f38ae3e3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/dcf652585ee9639acb2682a332bf095f38ae3e3e/Log.py
|
||
users += [username, 'autenticated']
|
users += [username, 'authenticated']
|
def __init__(self, db, username): self.perm_cache = {} cursor = db.cursor() cursor.execute ("SELECT username, action FROM permission") result = cursor.fetchall()
|
86a91f7b68b72f1871f8466287b5bd798f465dd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/86a91f7b68b72f1871f8466287b5bd798f465dd3/perm.py
|
for i in range(len(reduce(None, custom['options']))):
|
options = filter(None, custom['options']) for i in range(len(options)):
|
def add_db_options(field, constraints, prefix, cursor, sql): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, constraints, prefix, options)
|
4f10e943e3ae3374a51f1601df806aeab26dec5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4f10e943e3ae3374a51f1601df806aeab26dec5f/Query.py
|
args = text.split(":",1) language = args[0] if len(args)==2: text = args[1] else: text = ""
|
language = options.get('language') if not language: args = text.split(':', 1) language = args[0] if len(args) == 2: text = args[1] else: text = ''
|
def code_role(name, rawtext, text, lineno, inliner, options={}, content=[]): args = text.split(":",1) language = args[0] if len(args)==2: text = args[1] else: text = "" reference = code_formatter(language, text) return [reference], []
|
ed33d76987014e74e68bb82fa1ccaac0288411c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ed33d76987014e74e68bb82fa1ccaac0288411c2/rst.py
|
code_block.options = {
|
code_role.options = code_block.options = {
|
def code_block(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): """ Create a code-block directive for docutils.
|
ed33d76987014e74e68bb82fa1ccaac0288411c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ed33d76987014e74e68bb82fa1ccaac0288411c2/rst.py
|
message = wiki_to_oneliner(message, self.env, db, shorten=True)
|
if self.timeline_long_messages: message = wiki_to_html(message, self.env, req, db, absurls=True) else: message = wiki_to_oneliner(message, self.env, db, shorten=True)
|
def get_timeline_events(self, req, start, stop, filters): if 'changeset' in filters: format = req.args.get('format') wiki_format = self.wiki_format_messages show_files = self.timeline_show_files db = self.env.get_db_cnx() repos = self.env.get_repository(req.authname) for chgset in repos.get_changesets(start, stop): message = chgset.message or '--' if wiki_format: shortlog = wiki_to_oneliner(message, self.env, db, shorten=True) else: shortlog = util.shorten_line(message)
|
8a8334eaf89b3d633caa97b1b71554e15aa6a9eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8a8334eaf89b3d633caa97b1b71554e15aa6a9eb/changeset.py
|
filtr.writeline('header %s version %d | %s version %d header' %
|
filtr.writeline('header %s version %d | %s version %d redaeh' %
|
def generate_diff(self, pagename, version): from Changeset import DiffColorizer cursor = self.db.cursor () cursor.execute ('SELECT text FROM wiki ' 'WHERE name=%s AND (version=%s or version=%s)' 'ORDER BY version ASC', pagename, version - 1, version) res = cursor.fetchall() if (len(res) == 1): old = '' new = res[0][0].splitlines() elif (len(res) == 2): old = res[0][0].splitlines() new = res[1][0].splitlines() else: raise TracError('Version %d of page "%s" not found.' % (version, pagename), 'Page Not Found') filtr = DiffColorizer(self.req.hdf, 'wiki.diff') filtr.writeline('header %s version %d | %s version %d header' % (pagename, version - 1, pagename, version)) try: for line in difflib.Differ().compare(old, new): if line != ' ': filtr.writeline(escape(line)) except AttributeError: raise TracError('Python >= 2.2 is required for diff support.') filtr.close()
|
d02bb75cd8ab8eec8fb434a3d353dcbb3149e6b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d02bb75cd8ab8eec8fb434a3d353dcbb3149e6b9/Wiki.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.