rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
title = sql = ""
|
title = sql = description = ''
|
def render_report_editor(self, id, action='commit', copy=0): self.perm.assert_permission(perm.REPORT_MODIFY) cursor = self.db.cursor()
|
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py
|
self.create_report(self.args['title'], self.args['sql']) elif action == 'delete':
|
if not (self.args.has_key('sql') or self.args.has_key('title')): action = 'list' else: self.create_report(self.args.get('title', ''), self.args.get('description', ''), self.args.get('sql', '')) if action == 'delete':
|
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')
|
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py
|
else:
|
elif action == 'list':
|
def render(self): self.perm.assert_permission(perm.REPORT_VIEW) # did the user ask for any special report? id = int(self.args.get('id', -1)) action = self.args.get('action', 'list')
|
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py
|
return 1
|
return e
|
def set_code_processor(self, name): if self.builtin_processors.has_key(name): self.code_processor = self.builtin_processors[name] else: try: self.code_processor = self.load_macro(name) except Exception, e: if Mimeview.MIME_MAP.has_key(name): name = Mimeview.MIME_MAP[name] mimeviewer, exists = self.env.mimeview.get_viewer(name) if exists != -1: self.mime_type = name self.code_processor = self.mime_processor else: self.code_processor = self.builtin_processors['default'] return 1 return 0
|
5832b0ad86ef0ad83a0aa0de87aa414827598b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5832b0ad86ef0ad83a0aa0de87aa414827598b1f/WikiFormatter.py
|
if self.code_processor.error:
|
e = self.code_processor.error if e:
|
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 = WikiProcessor(self.env, '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.process(self.hdf, self.code_text)) else: self.code_text += line + os.linesep elif not self.code_processor: match = Formatter._processor_re.search(line) if match: name = match.group(1) self.code_processor = WikiProcessor(self.env, name) if self.code_processor.error: self.out.write(system_message('Error: Failed to load processor <code>%s</code>' % name, e)) self.code_text += line + os.linesep else: self.code_text += line + os.linesep self.code_processor = WikiProcessor(self.env, 'default') else: self.code_text += line + os.linesep
|
5832b0ad86ef0ad83a0aa0de87aa414827598b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5832b0ad86ef0ad83a0aa0de87aa414827598b1f/WikiFormatter.py
|
tabwidth = int(self.config.get('diff', 'tab_width'))
|
tabwidth = int(self.config.get('diff', 'tab_width', self.config.get('mimeviewer', 'tab_width')))
|
def render(self, req, mimetype, content, filename=None, rev=None): from trac.web.clearsilver import HDFWrapper
|
420d86781f96919d83e06475eb6954e692e8c951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/420d86781f96919d83e06475eb6954e692e8c951/patch.py
|
self.count = 0
|
def __init__(self, hdf, prefix='changeset.diff'): self.count = 0 self.block = [] self.ttype = None self.p_block = [] self.p_type = None self.hdf = hdf self.prefix = prefix self.changeno = 0 self.blockno = 0
|
5dca6282e50a01de0d2391edf83de1f9e93f7147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5dca6282e50a01de0d2391edf83de1f9e93f7147/Changeset.py
|
|
self.count = self.count + 1 if self.count < 3:
|
if text[0:2] in ['++', '--']:
|
def writeline(self, text): match = header_re.search(text) if match: self.hdf.setValue('%s.name.old' % self.prefix, match.group(1)) self.hdf.setValue('%s.name.new' % self.prefix, match.group(2)) return self.count = self.count + 1 if self.count < 3: return match = line_re.search(text) if match: self.changeno += 1 pfx = '%s.changes.%d.line' % (self.prefix, self.changeno) self.print_block() self.hdf.setValue('%s.old' % pfx, match.group(1)) self.hdf.setValue('%s.new' % pfx, match.group(3)) return ttype = text[0] text = text[1:] text = space_re.sub(' ', text.expandtabs(8)) if ttype == self.ttype: self.block.append(text) else: if ttype == '+' and self.ttype == '-': self.p_block = self.block self.p_type = self.ttype else: self.print_block() self.block = [text] self.ttype = ttype
|
5dca6282e50a01de0d2391edf83de1f9e93f7147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5dca6282e50a01de0d2391edf83de1f9e93f7147/Changeset.py
|
wiki_to_html(util.wiki_escape_newline( changeset_info['message']),
|
wiki_to_html(util.wiki_escape_newline(message),
|
def render(self): self.perm.assert_permission (perm.CHANGESET_VIEW)
|
47a40bffe42bc3b888d62bc4c039ee59d988fd32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/47a40bffe42bc3b888d62bc4c039ee59d988fd32/Changeset.py
|
'href': req.href.milestone(safe_name)}
|
'href': req.href.milestone(safe_name), 'due': milestone.due, 'completed': milestone.completed }
|
def milestone_to_hdf(env, db, req, milestone): safe_name = None if milestone.exists: safe_name = milestone.name.replace('/', '%2F') hdf = {'name': milestone.name, 'exists': milestone.exists, 'href': req.href.milestone(safe_name)} if milestone.description: hdf['description_source'] = milestone.description hdf['description'] = wiki_to_html(milestone.description, env, req, db) if milestone.due: hdf['due'] = milestone.due hdf['late'] = milestone.is_late if milestone.completed: hdf['completed'] = milestone.completed return hdf
|
f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d/roadmap.py
|
hdf['due'] = milestone.due
|
def milestone_to_hdf(env, db, req, milestone): safe_name = None if milestone.exists: safe_name = milestone.name.replace('/', '%2F') hdf = {'name': milestone.name, 'exists': milestone.exists, 'href': req.href.milestone(safe_name)} if milestone.description: hdf['description_source'] = milestone.description hdf['description'] = wiki_to_html(milestone.description, env, req, db) if milestone.due: hdf['due'] = milestone.due hdf['late'] = milestone.is_late if milestone.completed: hdf['completed'] = milestone.completed return hdf
|
f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d/roadmap.py
|
|
if milestone.completed: hdf['completed'] = milestone.completed
|
def milestone_to_hdf(env, db, req, milestone): safe_name = None if milestone.exists: safe_name = milestone.name.replace('/', '%2F') hdf = {'name': milestone.name, 'exists': milestone.exists, 'href': req.href.milestone(safe_name)} if milestone.description: hdf['description_source'] = milestone.description hdf['description'] = wiki_to_html(milestone.description, env, req, db) if milestone.due: hdf['due'] = milestone.due hdf['late'] = milestone.is_late if milestone.completed: hdf['completed'] = milestone.completed return hdf
|
f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1a6d695fd2fa1e3a7b2d58049143c5db76e6d5d/roadmap.py
|
|
break
|
if not result: continue elif isinstance(result, (str, unicode)): return result elif annotations: return self._annotate(result, annotations) else: buf = StringIO() buf.write('<div class="code-block"><pre>') for line in result: buf.write(line.expandtabs(8) + '\n') buf.write('</pre></div>') return buf.getvalue()
|
def render(self, req, mimetype, content, filename=None, rev=None, annotations=None): """Render an XHTML preview of the given content of the specified MIME type, selecting the most appropriate `IHTMLPreviewRenderer` implementation available for the given MIME type.
|
1f6e5dbace90bc48298098ac08792651d74bf17e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1f6e5dbace90bc48298098ac08792651d74bf17e/api.py
|
if result and not isinstance(result, (str, unicode)): if annotations: return self._annotate(result, annotations) else: buf = StringIO() buf.write('<div class="code-block"><pre>') for line in result: buf.write(line.expandtabs(8) + '\n') buf.write('<pre></div>') return buf.getvalue() return result
|
def render(self, req, mimetype, content, filename=None, rev=None, annotations=None): """Render an XHTML preview of the given content of the specified MIME type, selecting the most appropriate `IHTMLPreviewRenderer` implementation available for the given MIME type.
|
1f6e5dbace90bc48298098ac08792651d74bf17e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1f6e5dbace90bc48298098ac08792651d74bf17e/api.py
|
|
try: self.cursor.close() except: pass
|
if self.cursor: try: self.cursor.close() except ReferenceError: pass
|
def __del__(self): try: self.cursor.close() except: pass
|
24e841b6437e957dabcc3d770c4d13aae0d861ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/24e841b6437e957dabcc3d770c4d13aae0d861ed/db.py
|
__slots__ = 'cnx'
|
__slots__ = ['cnx']
|
def __iter__(self): while 1: row = self.cursor.fetchone() if not row: return yield row
|
24e841b6437e957dabcc3d770c4d13aae0d861ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/24e841b6437e957dabcc3d770c4d13aae0d861ed/db.py
|
try: self.cnx.close() except: pass
|
if self.cnx: try: self.cnx.close() except ReferenceError: pass
|
def __del__(self): try: self.cnx.close() except: pass
|
24e841b6437e957dabcc3d770c4d13aae0d861ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/24e841b6437e957dabcc3d770c4d13aae0d861ed/db.py
|
for e in node.get_entries()
|
for e in sorted(node.get_entries(), key=kind_order)
|
def process_request(self, req): repos = self.env.get_repository(req.authname) authz = SubversionAuthorizer(self.env, req.authname)
|
ec175125151132e27d1156f40f74eacc8c511014 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ec175125151132e27d1156f40f74eacc8c511014/changeset.py
|
raise RequestDone
|
return
|
def process_request(self, req): repos = self.env.get_repository(req.authname) authz = SubversionAuthorizer(self.env, req.authname)
|
ec175125151132e27d1156f40f74eacc8c511014 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ec175125151132e27d1156f40f74eacc8c511014/changeset.py
|
raise TrarError, 'Docutils >= %s not found' % docutils_required
|
raise TracError, 'Docutils not found'
|
def render(self, req, mimetype, content, filename=None, rev=None): try: from docutils import nodes from docutils.core import publish_string from docutils.parsers import rst from docutils import __version__ except ImportError: raise TrarError, 'Docutils >= %s not found' % docutils_required if StrictVersion(__version__) < StrictVersion('0.3.3'): raise TracError, 'Docutils version >= %s required, %s found' \ % ('0.3.3', __version__)
|
6b096dc7b2b601b3e9cd59b9315f8af39784155e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6b096dc7b2b601b3e9cd59b9315f8af39784155e/rst.py
|
if authname == 'anonymous': self.auth_name = '*' else: self.auth_name = authname
|
self.auth_name = authname
|
def __init__(self,env,authname): if authname == 'anonymous': self.auth_name = '*' else: self.auth_name = authname
|
b0302fa2e5b6c1471e9847b986a7c5374e49375d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b0302fa2e5b6c1471e9847b986a7c5374e49375d/authzperm.py
|
acc = 'r'
|
acc = ''
|
def has_permission(self, path): acc = 'r'
|
b0302fa2e5b6c1471e9847b986a7c5374e49375d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b0302fa2e5b6c1471e9847b986a7c5374e49375d/authzperm.py
|
elif self.conf_authz.has_section(self.module_name + '/') and \ self.conf_authz.has_option(self.module_name + '/', '*'): acc = self.conf_authz.get(self.module_name + '/','*')
|
def has_permission(self, path): acc = 'r'
|
b0302fa2e5b6c1471e9847b986a7c5374e49375d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b0302fa2e5b6c1471e9847b986a7c5374e49375d/authzperm.py
|
|
elif kwd[0].isupper() and kwd[1].islower():
|
elif len(kwd) > 1 and kwd[0].isupper() and kwd[1].islower():
|
def quickjump(self, kwd): if len(kwd.split()) != 1: return None # Ticket quickjump if kwd[0] == '#' and kwd[1:].isdigit(): return self.env.href.ticket(kwd[1:]) elif kwd[0:len('ticket:')] == 'ticket:' and kwd[len('ticket:'):].isdigit(): return self.env.href.ticket(kwd[len('ticket:'):]) elif kwd[0:len('bug:')] == 'bug:' and kwd[len('bug:'):].isdigit(): return self.env.href.ticket(kwd[len('bug:'):]) # Changeset quickjump elif kwd[0] == '[' and kwd[-1] == ']' and kwd[1:-1].isdigit(): return self.env.href.changeset(kwd[1:-1]) elif kwd[0:len('changeset:')] == 'changeset:' and kwd[len('changeset:'):].isdigit(): return self.env.href.changeset(kwd[len('changeset:'):]) # Report quickjump elif kwd[0] == '{' and kwd[-1] == '}' and kwd[1:-1].isdigit(): return self.env.href.report(kwd[1:-1]) elif kwd[0:len('report:')] == 'report:' and kwd[len('report:'):].isdigit(): return self.env.href.report(kwd[len('report:'):]) # Milestone quickjump elif kwd[0:len('milestone:')] == 'milestone:': return self.env.href.milestone(kwd[len('milestone:'):]) # Source quickjump elif kwd[0] == '/': return self.env.href.browser(kwd) elif kwd[0:len('source:')] == 'source:': return self.env.href.browser(kwd[len('source:'):]) # Wiki quickjump elif kwd[0:len('wiki:')] == 'wiki:': r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)" if re.match (r, kwd[len('wiki:'):]): return self.env.href.wiki(kwd[len('wiki:'):]) elif kwd[0].isupper() and kwd[1].islower(): r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)" if re.match (r, kwd): return self.env.href.wiki(kwd)
|
77118ecc5956fb98fa4d5ab90285ccdceb8e05e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/77118ecc5956fb98fa4d5ab90285ccdceb8e05e6/Search.py
|
if mil.completed > time.time():
|
if mil.completed > datetime.now(utc):
|
def render_admin_panel(self, req, cat, page, milestone): req.perm.require('TICKET_ADMIN')
|
52d2c204f0fb8482f52ddae9b17f9bcf8a6a87ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/52d2c204f0fb8482f52ddae9b17f9bcf8a6a87ff/admin.py
|
class_map = {'A': 'diff-add', 'M': 'diff-mod', 'D': 'diff-rem'}
|
class_map = {'A': 'add', 'M': 'mod', 'D': 'rem'}
|
def _render_changeset(self, req, item): absurls = req.args.get('format') == 'rss' href = self.env.href if absurls: href = self.env.abs_href
|
bcb4e235d2951025fb784fff06dc0c58e1699f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bcb4e235d2951025fb784fff06dc0c58e1699f31/Timeline.py
|
files.append('<span class="%s">%s</span>' % (class_map[change], name))
|
files.append('<span class="diff-%s">%s</span>' % (class_map.get(change, 'mod'), name))
|
def _render_changeset(self, req, item): absurls = req.args.get('format') == 'rss' href = self.env.href if absurls: href = self.env.abs_href
|
bcb4e235d2951025fb784fff06dc0c58e1699f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bcb4e235d2951025fb784fff06dc0c58e1699f31/Timeline.py
|
lst = key and [(key(i), i) for i in iterable] or list(iterable)
|
if key is None: lst = list(iterable) else: lst = [(key(val), idx, val) for idx, val in enumerate(iterable)]
|
def sorted(iterable, cmp=None, key=None, reverse=False): """Partial implementation of the "sorted" function from Python 2.4""" lst = key and [(key(i), i) for i in iterable] or list(iterable) lst.sort() if reverse: lst = reversed(lst) return key and [i for __, i in lst] or lst
|
3b2fbe5b648b457a98eae9daf17c7f1d0637fb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3b2fbe5b648b457a98eae9daf17c7f1d0637fb02/__init__.py
|
return key and [i for __, i in lst] or lst
|
return [i[-1] for i in lst]
|
def sorted(iterable, cmp=None, key=None, reverse=False): """Partial implementation of the "sorted" function from Python 2.4""" lst = key and [(key(i), i) for i in iterable] or list(iterable) lst.sort() if reverse: lst = reversed(lst) return key and [i for __, i in lst] or lst
|
3b2fbe5b648b457a98eae9daf17c7f1d0637fb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3b2fbe5b648b457a98eae9daf17c7f1d0637fb02/__init__.py
|
self.env.delete_attachment(self.db, parent_type, parent_id, filename)
|
self.env.delete_attachment(parent_type, parent_id, filename)
|
def delete_attachment(self, req, parent_type, parent_id, filename): perm_map = {'ticket': perm.TICKET_ADMIN, 'wiki': perm.WIKI_DELETE} req.perm.assert_permission(perm_map[parent_type])
|
843ffa9c730e283286b38d104f98ae9dd1992827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/843ffa9c730e283286b38d104f98ae9dd1992827/attachment.py
|
self.assertEqual('attachment', ns)
|
self.assertEqual('raw-attachment', ns)
|
def test_wiki_link_wikipage(self): attachment = Attachment(self.env, 'wiki', 'SomePage') attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'/trac.cgi/attachment/wiki/SomePage/foo.txt" '
|
'/trac.cgi/raw-attachment/wiki/SomePage/foo.txt" '
|
def test_wiki_link_wikipage(self): attachment = Attachment(self.env, 'wiki', 'SomePage') attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'attachment/wiki/SomePage/foo.txt?format=raw" '
|
'raw-attachment/wiki/SomePage/foo.txt" '
|
def test_wiki_link_wikipage(self): attachment = Attachment(self.env, 'wiki', 'SomePage') attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
self.assertEqual('attachment', ns)
|
self.assertEqual('raw-attachment', ns)
|
def test_wiki_link_subpage(self): attachment = Attachment(self.env, 'wiki', 'SomePage/SubPage') attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'/trac.cgi/attachment/wiki/SomePage/SubPage/foo.txt" '
|
'/trac.cgi/raw-attachment/wiki/SomePage/SubPage/foo.txt" '
|
def test_wiki_link_subpage(self): attachment = Attachment(self.env, 'wiki', 'SomePage/SubPage') attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
self.assertEqual('attachment', ns)
|
self.assertEqual('raw-attachment', ns)
|
def test_wiki_link_ticket(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'attachment/ticket/123/foo.txt" '
|
'raw-attachment/ticket/123/foo.txt" '
|
def test_wiki_link_ticket(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'attachment/ticket/123/foo.txt?format=raw" '
|
'raw-attachment/ticket/123/foo.txt" '
|
def test_wiki_link_ticket(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
self.assertEqual('attachment', ns)
|
self.assertEqual('raw-attachment', ns)
|
def test_wiki_link_foreign(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'attachment/ticket/123/foo.txt" '
|
'raw-attachment/ticket/123/foo.txt" '
|
def test_wiki_link_foreign(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
'attachment/ticket/123/foo.txt?format=raw" '
|
'raw-attachment/ticket/123/foo.txt" '
|
def test_wiki_link_foreign(self): attachment = Attachment(self.env, 'ticket', 123) attachment.insert('foo.txt', tempfile.TemporaryFile(), 0)
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
return unittest.makeSuite(AttachmentTestCase, 'test')
|
suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(AttachmentTestCase, 'test')) suite.addTest(unittest.makeSuite(AttachmentModuleTestCase, 'test')) return suite
|
def suite(): return unittest.makeSuite(AttachmentTestCase, 'test')
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
unittest.main()
|
unittest.main(defaultTest='suite')
|
def suite(): return unittest.makeSuite(AttachmentTestCase, 'test')
|
5212b3d75f41c5849287b8b689aab1f5fa9d36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5212b3d75f41c5849287b8b689aab1f5fa9d36fe/attachment.py
|
return [action for action in actions.get(ticket['status'], ['leave'])
|
return [action for action in actions.get(ticket['status'] or 'new', ['leave'])
|
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_MODIFY', 'accept': 'TICKET_MODIFY', 'reopen': 'TICKET_CREATE'} return [action for action in actions.get(ticket['status'], ['leave']) if action not in perms or perm_.has_permission(perms[action])]
|
cf4a59d4f5e14fe3dcc0f9d2c7abee0a536b3ffb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/cf4a59d4f5e14fe3dcc0f9d2c7abee0a536b3ffb/api.py
|
charset = mimeview.get_charset(old_node.content_type) or \ default_charset old_content = util.to_utf8(old_content, charset)
|
charset = mimeview.get_charset(old_node.content_type) if not charset: charset = mimeview.detect_unicode(old_content) old_content = util.to_utf8(old_content, charset or default_charset)
|
def _render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': util.format_datetime(chgset.date), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
d715d556ffa08bb2d946d566021c24b90248c90d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d715d556ffa08bb2d946d566021c24b90248c90d/changeset.py
|
charset = mimeview.get_charset(new_node.content_type) or \ default_charset new_content = util.to_utf8(new_content, charset)
|
charset = mimeview.get_charset(new_node.content_type) if not charset: charset = mimeview.detect_unicode(new_content) new_content = util.to_utf8(new_content, charset or default_charset)
|
def _render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': util.format_datetime(chgset.date), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
d715d556ffa08bb2d946d566021c24b90248c90d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d715d556ffa08bb2d946d566021c24b90248c90d/changeset.py
|
env = _open_environment(env_path, run_once=environ['wsgi.run_once'])
|
run_once = environ['wsgi.run_once'] env = _open_environment(env_path, run_once=run_once)
|
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'] = urllib.unquote(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']) if env.base_url: environ['trac.base_url'] = env.base_url req = Request(environ, start_response) try: try: try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except RequestDone: pass return req._response or [] finally: if not environ.get('wsgi.run_once'): env.shutdown(threading._get_ident()) except HTTPException, e: env.log.warn(e) title = e.reason or 'Error' data = {'title': title, 'type': 'TracError', 'message': e.message} try: req.send_error(sys.exc_info(), status=e.code, env=env, data=data) except RequestDone: return [] except Exception, e: env.log.exception(e) exc_info = sys.exc_info() try: message = "%s: %s" % (e.__class__.__name__, to_unicode(e)) traceback = get_last_traceback() frames = [] if 'TRAC_ADMIN' in req.perm: tb = exc_info[2] while tb: if not tb.tb_frame.f_locals.get('__traceback_hide__'): filename = tb.tb_frame.f_code.co_filename lineno = tb.tb_lineno - 1 before, line, after = get_lines_from_file(filename, lineno, 5) frames += [{'traceback': tb, 'filename': filename, 'lineno': lineno, 'line': line, 'lines_before': before, 'lines_after': after, 'function': tb.tb_frame.f_code.co_name, 'vars': tb.tb_frame.f_locals}] tb = tb.tb_next data = {'type': 'internal', 'message': message, 'traceback': traceback, 'frames': frames, 'shorten_line': shorten_line} try: # clear chrome data is already set del req.chrome except AttributeError: pass try: req.send_error(exc_info, status=500, env=env, data=data) except RequestDone: return [] finally: del exc_info
|
01a6432a8fae248368350ddb4a6d5e2e82237ddd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/01a6432a8fae248368350ddb4a6d5e2e82237ddd/main.py
|
if not environ.get('wsgi.run_once'):
|
if not run_once:
|
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'] = urllib.unquote(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']) if env.base_url: environ['trac.base_url'] = env.base_url req = Request(environ, start_response) try: try: try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except RequestDone: pass return req._response or [] finally: if not environ.get('wsgi.run_once'): env.shutdown(threading._get_ident()) except HTTPException, e: env.log.warn(e) title = e.reason or 'Error' data = {'title': title, 'type': 'TracError', 'message': e.message} try: req.send_error(sys.exc_info(), status=e.code, env=env, data=data) except RequestDone: return [] except Exception, e: env.log.exception(e) exc_info = sys.exc_info() try: message = "%s: %s" % (e.__class__.__name__, to_unicode(e)) traceback = get_last_traceback() frames = [] if 'TRAC_ADMIN' in req.perm: tb = exc_info[2] while tb: if not tb.tb_frame.f_locals.get('__traceback_hide__'): filename = tb.tb_frame.f_code.co_filename lineno = tb.tb_lineno - 1 before, line, after = get_lines_from_file(filename, lineno, 5) frames += [{'traceback': tb, 'filename': filename, 'lineno': lineno, 'line': line, 'lines_before': before, 'lines_after': after, 'function': tb.tb_frame.f_code.co_name, 'vars': tb.tb_frame.f_locals}] tb = tb.tb_next data = {'type': 'internal', 'message': message, 'traceback': traceback, 'frames': frames, 'shorten_line': shorten_line} try: # clear chrome data is already set del req.chrome except AttributeError: pass try: req.send_error(exc_info, status=500, env=env, data=data) except RequestDone: return [] finally: del exc_info
|
01a6432a8fae248368350ddb4a6d5e2e82237ddd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/01a6432a8fae248368350ddb4a6d5e2e82237ddd/main.py
|
entries_per_date[-1][1].append((name, version))
|
entries_per_date[-1][1].append((name, int(version)))
|
def render_macro(self, req, name, content): prefix = limit = None if content: argv = [arg.strip() for arg in content.split(',')] if len(argv) > 0: prefix = argv[0] if len(argv) > 1: limit = int(argv[1])
|
929d868e91456a403b50a19eb13fd3c3bbd8e2c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/929d868e91456a403b50a19eb13fd3c3bbd8e2c5/macros.py
|
<div class="error">Error: HTML block contains disallowed tags.
|
<div class="system-message">Error: HTML block contains disallowed tags.
|
def html_processor(hdf, text, env): if Formatter._htmlproc_disallow_rule.search(text): err = """\
|
4e2089562825f7bda3a70ddff4edaadbf0123bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4e2089562825f7bda3a70ddff4edaadbf0123bde/WikiFormatter.py
|
return '<span class="error">Macro %s(%s) failed: %s</span' \
|
return '<div class="system-message">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, self.env) except Exception, e: return '<span class="error">Macro %s(%s) failed: %s</span' \ % (name, args, e)
|
4e2089562825f7bda3a70ddff4edaadbf0123bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4e2089562825f7bda3a70ddff4edaadbf0123bde/WikiFormatter.py
|
self.code_text += line + os.linesep
|
self.code_text += line + os.linesep
|
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) 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
|
4e2089562825f7bda3a70ddff4edaadbf0123bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4e2089562825f7bda3a70ddff4edaadbf0123bde/WikiFormatter.py
|
self.out.write('<div class="error">Failed to load processor macro %s: %s t %s</div>' % (name, line, e))
|
self.out.write('<div class="system-message">Failed to load processor macro %s: %s t %s</div>' % (name, line, e))
|
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) 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
|
4e2089562825f7bda3a70ddff4edaadbf0123bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4e2089562825f7bda3a70ddff4edaadbf0123bde/WikiFormatter.py
|
message = _from_svn(self._get_prop(core.SVN_PROP_REVISION_LOG)) author = _from_svn(self._get_prop(core.SVN_PROP_REVISION_AUTHOR))
|
message = self._get_prop(core.SVN_PROP_REVISION_LOG) author = self._get_prop(core.SVN_PROP_REVISION_AUTHOR) message = message and to_unicode(message, 'utf-8') author = author and to_unicode(author, 'utf-8')
|
def __init__(self, rev, authz, scope, fs_ptr, pool=None): self.rev = rev self.authz = authz self.scope = scope self.fs_ptr = fs_ptr self.pool = Pool(pool) message = _from_svn(self._get_prop(core.SVN_PROP_REVISION_LOG)) author = _from_svn(self._get_prop(core.SVN_PROP_REVISION_AUTHOR)) _date = self._get_prop(core.SVN_PROP_REVISION_DATE) if _date: ts = core.svn_time_from_cstring(_date, self.pool()) / 1000000 date = datetime.fromtimestamp(ts, utc) else: date = None Changeset.__init__(self, rev, message, author, date)
|
9adc2d4f1e71ce837315236e41f33060fb1932de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9adc2d4f1e71ce837315236e41f33060fb1932de/svn_fs.py
|
@param modification_callback: Function taking a single argument, the modified file, and is called after a modification is detected."""
|
@param modification_callback: a function taking a single argument, the modified file, which is called every time a modification is detected """
|
def _reloader_thread(modification_callback): """When this function is run from the main thread, it will force other threads to exit when any modules currently loaded change. @param modification_callback: Function taking a single argument, the modified file, and is called after a modification is detected.""" mtimes = {} while True: for filename in filter(None, [getattr(module, "__file__", None) for module in sys.modules.values()]): while not os.path.isfile(filename): # Probably in an egg or zip file filename = os.path.dirname(filename) if not filename: break if not filename: # Couldn't map to physical file, so just ignore continue if filename.endswith(".pyc"): filename = filename[:-1] mtime = os.stat(filename).st_mtime if filename not in mtimes: mtimes[filename] = mtime continue if mtime > mtimes[filename]: modification_callback(filename) sys.exit(3) time.sleep(_SLEEP_TIME)
|
b6b0179517bddd1b4f5a6175ad7fb6980451fe71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6b0179517bddd1b4f5a6175ad7fb6980451fe71/autoreload.py
|
for filename in filter(None, [getattr(module, "__file__", None)
|
for filename in filter(None, [getattr(module, '__file__', None)
|
def _reloader_thread(modification_callback): """When this function is run from the main thread, it will force other threads to exit when any modules currently loaded change. @param modification_callback: Function taking a single argument, the modified file, and is called after a modification is detected.""" mtimes = {} while True: for filename in filter(None, [getattr(module, "__file__", None) for module in sys.modules.values()]): while not os.path.isfile(filename): # Probably in an egg or zip file filename = os.path.dirname(filename) if not filename: break if not filename: # Couldn't map to physical file, so just ignore continue if filename.endswith(".pyc"): filename = filename[:-1] mtime = os.stat(filename).st_mtime if filename not in mtimes: mtimes[filename] = mtime continue if mtime > mtimes[filename]: modification_callback(filename) sys.exit(3) time.sleep(_SLEEP_TIME)
|
b6b0179517bddd1b4f5a6175ad7fb6980451fe71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6b0179517bddd1b4f5a6175ad7fb6980451fe71/autoreload.py
|
if filename.endswith(".pyc"):
|
if filename.endswith('.pyc'):
|
def _reloader_thread(modification_callback): """When this function is run from the main thread, it will force other threads to exit when any modules currently loaded change. @param modification_callback: Function taking a single argument, the modified file, and is called after a modification is detected.""" mtimes = {} while True: for filename in filter(None, [getattr(module, "__file__", None) for module in sys.modules.values()]): while not os.path.isfile(filename): # Probably in an egg or zip file filename = os.path.dirname(filename) if not filename: break if not filename: # Couldn't map to physical file, so just ignore continue if filename.endswith(".pyc"): filename = filename[:-1] mtime = os.stat(filename).st_mtime if filename not in mtimes: mtimes[filename] = mtime continue if mtime > mtimes[filename]: modification_callback(filename) sys.exit(3) time.sleep(_SLEEP_TIME)
|
b6b0179517bddd1b4f5a6175ad7fb6980451fe71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6b0179517bddd1b4f5a6175ad7fb6980451fe71/autoreload.py
|
if sys.platform == "win32":
|
if sys.platform == 'win32':
|
def _restart_with_reloader(): while True: args = [sys.executable] + sys.argv if sys.platform == "win32": args = ['"%s"' % arg for arg in args] new_environ = os.environ.copy() new_environ["RUN_MAIN"] = 'true' # This call reinvokes ourself and goes into the other branch of main as # a new process. exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) if exit_code != 3: return exit_code
|
b6b0179517bddd1b4f5a6175ad7fb6980451fe71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6b0179517bddd1b4f5a6175ad7fb6980451fe71/autoreload.py
|
new_environ["RUN_MAIN"] = 'true'
|
new_environ['RUN_MAIN'] = 'true'
|
def _restart_with_reloader(): while True: args = [sys.executable] + sys.argv if sys.platform == "win32": args = ['"%s"' % arg for arg in args] new_environ = os.environ.copy() new_environ["RUN_MAIN"] = 'true' # This call reinvokes ourself and goes into the other branch of main as # a new process. exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) if exit_code != 3: return exit_code
|
b6b0179517bddd1b4f5a6175ad7fb6980451fe71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6b0179517bddd1b4f5a6175ad7fb6980451fe71/autoreload.py
|
yield '@@ -%d,%d +%d,%d' % (i1 + 1, i2 - i1, j1 + 1, j2 - j1)
|
yield '@@ -%d,%d +%d,%d @@' % (i1 + 1, i2 - i1, j1 + 1, j2 - j1)
|
def unified_diff(fromlines, tolines, context=None, ignore_blank_lines=0, ignore_case=0, ignore_space_changes=0): opcodes = _get_opcodes(fromlines, tolines, ignore_blank_lines, ignore_case, ignore_space_changes) for group in _group_opcodes(opcodes, context): i1, i2, j1, j2 = group[0][1], group[-1][2], group[0][3], group[-1][4] yield '@@ -%d,%d +%d,%d' % (i1 + 1, i2 - i1, j1 + 1, j2 - j1) for tag, i1, i2, j1, j2 in group: if tag == 'equal': for line in fromlines[i1:i2]: yield ' ' + line else: if tag in ('replace', 'delete'): for line in fromlines[i1:i2]: yield '-' + line if tag in ('replace', 'insert'): for line in tolines[j1:j2]: yield '+' + line
|
a802190d0eb0e64272dcb83e5dfd5b698879616f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a802190d0eb0e64272dcb83e5dfd5b698879616f/diff.py
|
templates_dir = arg[:4]
|
templates_dir = arg[:5]
|
def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed." % self.envname print "Does an environment already exist?" return 2
|
d83c564b99d34fd761bc4d0af742dc97e448e1e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d83c564b99d34fd761bc4d0af742dc97e448e1e1/admin.py
|
i = filename.rfind('.') suffix = filename[i+1:]
|
suffix = filename.split('.')[-1]
|
def get_mimetype(filename): try: i = filename.rfind('.') suffix = filename[i+1:] return MIME_MAP[suffix] except KeyError: import mimetypes return mimetypes.guess_type(filename)[0] except: return None
|
1522300f5f9cba1b474461e7912f1cdcf7d1fb31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1522300f5f9cba1b474461e7912f1cdcf7d1fb31/api.py
|
bold = ('<strong>', '</strong>') bold_open = self.tag_open_p(bold)
|
italic = ('<i>', '</i>') italic_open = self.tag_open_p(italic)
|
def _bolditalic_formatter(self, match, fullmatch): bold = ('<strong>', '</strong>') bold_open = self.tag_open_p(bold) tmp = '' if not bold_open: tmp += bold[0] self.open_tag(*bold) tmp += self._italic_formatter(match, fullmatch) if bold_open: tmp += bold[1] self.close_tag(bold[1]) return tmp
|
94f1c837647f81515aed3d9f2dbc89611785f10d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/94f1c837647f81515aed3d9f2dbc89611785f10d/formatter.py
|
if not bold_open: tmp += bold[0] self.open_tag(*bold) tmp += self._italic_formatter(match, fullmatch) if bold_open: tmp += bold[1] self.close_tag(bold[1])
|
if italic_open: tmp += italic[1] self.close_tag(italic[1]) tmp += self._bold_formatter(match, fullmatch) if not italic_open: tmp += italic[0] self.open_tag(*italic)
|
def _bolditalic_formatter(self, match, fullmatch): bold = ('<strong>', '</strong>') bold_open = self.tag_open_p(bold) tmp = '' if not bold_open: tmp += bold[0] self.open_tag(*bold) tmp += self._italic_formatter(match, fullmatch) if bold_open: tmp += bold[1] self.close_tag(bold[1]) return tmp
|
94f1c837647f81515aed3d9f2dbc89611785f10d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/94f1c837647f81515aed3d9f2dbc89611785f10d/formatter.py
|
req.check_modified(chgset.date, diff_options[0] + ''.join(diff_options[1]))
|
req.check_modified(chgset.date, diff_options[0] + ''.join(diff_options[1]))
|
def process_request(self, req): req.perm.assert_permission(perm.CHANGESET_VIEW)
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
self.render_diff(req, repos, chgset, diff_options)
|
self._render_diff(req, repos, chgset, diff_options)
|
def process_request(self, req): req.perm.assert_permission(perm.CHANGESET_VIEW)
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
self.render_zip(req, repos, chgset)
|
self._render_zip(req, repos, chgset)
|
def process_request(self, req): req.perm.assert_permission(perm.CHANGESET_VIEW)
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
self.render_html(req, repos, chgset, diff_options)
|
self._render_html(req, repos, chgset, diff_options)
|
def process_request(self, req): req.perm.assert_permission(perm.CHANGESET_VIEW)
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
def render_html(self, req, repos, chgset, diff_options):
|
def _render_html(self, req, repos, chgset, diff_options):
|
def render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': time.strftime('%c', time.localtime(chgset.date)), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
for option in diff_options:
|
for option in diff_options[1]:
|
def render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': time.strftime('%c', time.localtime(chgset.date)), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
changes = hdf_diff(old_content.splitlines(), new_content.splitlines(),
|
changes = hdf_diff(util.to_utf8(old_content).splitlines(), util.to_utf8(new_content).splitlines(),
|
def render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': time.strftime('%c', time.localtime(chgset.date)), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
ignore_blank_lines='-B' in diff_options, ignore_case='-i' in diff_options, ignore_space_changes='-b' in diff_options)
|
ignore_blank_lines='-B' in diff_options[1], ignore_case='-i' in diff_options[1], ignore_space_changes='-b' in diff_options[1])
|
def render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': time.strftime('%c', time.localtime(chgset.date)), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) }
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
def render_diff(self, req, repos, chgset, diff_options):
|
def _render_diff(self, req, repos, chgset, diff_options):
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
old_content = old_node.get_content().read()
|
old_content = util.to_utf8(old_node.get_content().read())
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
new_content = new_node.get_content().read()
|
new_content = util.to_utf8(new_node.get_content().read())
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
for option in diff_options:
|
for option in diff_options[1]:
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
ignore_blank_lines='-B' in diff_options, ignore_case='-i' in diff_options, ignore_space_changes='-b' in diff_options):
|
ignore_blank_lines='-B' in diff_options[1], ignore_case='-i' in diff_options[1], ignore_space_changes='-b' in diff_options[1]):
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
def render_zip(self, req, repos, chgset):
|
def _render_zip(self, req, repos, chgset):
|
def render_zip(self, req, repos, chgset): """ZIP archive with all the added and/or modified files.""" req.send_response(200) req.send_header('Content-Type', 'application/zip') req.send_header('Content-Disposition', 'filename=Changeset%s.zip' % chgset.rev) req.end_headers()
|
294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py
|
cursor = self.db.cursor()
|
cursor = db.cursor()
|
def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params)
|
e86006c3cc32892c719c60ca1262aa872518d915 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e86006c3cc32892c719c60ca1262aa872518d915/Roadmap.py
|
rev_re = re.compile(r"([^@
|
rev_re = re.compile(r"([^@
|
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': escape(href.browser(path, rev=rev)) }) return links
|
4561e8b76b9af41af62c15d3ac561a5e7ff5a468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4561e8b76b9af41af62c15d3ac561a5e7ff5a468/util.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
def test_htdocs_location(self): req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='') info = Chrome(self.env).prepare_request(req) self.assertEqual('/trac.cgi/chrome/common/', info['htdocs_location'])
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
def test_logo(self): req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
def test_default_links(self): req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='') links = Chrome(self.env).prepare_request(req)['links'] self.assertEqual('/trac.cgi/wiki', links['start'][0]['href']) self.assertEqual('/trac.cgi/search', links['search'][0]['href']) self.assertEqual('/trac.cgi/wiki/TracGuide', links['help'][0]['href']) self.assertEqual('/trac.cgi/chrome/common/css/trac.css', links['stylesheet'][0]['href'])
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='')
|
def test_icon_links(self): req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='') chrome = Chrome(self.env)
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), path_info='/', base_path='/trac.cgi')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), path_info='/', base_path='/trac.cgi')
|
def get_navigation_items(self, req): yield 'metanav', 'test', 'Test'
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), path_info='/', base_path='/trac.cgi')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), path_info='/', base_path='/trac.cgi')
|
def get_navigation_items(self, req): yield 'metanav', 'test', 'Test'
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
req = Mock(chrome={}, href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='/')
|
req = Mock(chrome={}, abs_href=Href('http://example.org/trac.cgi'), href=Href('/trac.cgi'), base_path='/trac.cgi', path_info='/')
|
def get_navigation_items(self, req): yield 'metanav', 'test2', 'Test 2'
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
from trac.web import chrome print chrome.__file__
|
def suite(): return unittest.makeSuite(ChromeTestCase, 'test')
|
27096567803726e379d16b4e3068b026d556205b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/27096567803726e379d16b4e3068b026d556205b/chrome.py
|
|
self.close_indentation()
|
def open_table(self): if not self.in_table: self.close_paragraph() self.close_indentation() self.close_list() self.close_def_list() self.in_table = 1 self.out.write('<table class="wiki">' + os.linesep)
|
4caf1c53a872ef2ed186f0813338dc969a6a9b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4caf1c53a872ef2ed186f0813338dc969a6a9b6b/formatter.py
|
|
if self.in_table and line[0:2] != '||':
|
if self.in_table and line.strip()[0:2] != '||':
|
def format(self, text, out, escape_newlines=False): self.out = out self._open_tags = [] self._list_stack = []
|
4caf1c53a872ef2ed186f0813338dc969a6a9b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4caf1c53a872ef2ed186f0813338dc969a6a9b6b/formatter.py
|
'filename': urllib.unquote(filename)
|
'filename': urllib.unquote(filename), 'raw_href': raw_href
|
def render_view(self, req, parent_type, parent_id, filename): perm_map = {'ticket': perm.TICKET_VIEW, 'wiki': perm.WIKI_VIEW} self.perm.assert_permission(perm_map[parent_type])
|
d80b08a319375884f5f4b758298ec7b516566b7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d80b08a319375884f5f4b758298ec7b516566b7e/attachment.py
|
add_link(req, 'alternate', self.env.href.attachment(parent_type, parent_id, filename, format='raw'), 'Original Format', mime_type)
|
def render_view(self, req, parent_type, parent_id, filename): perm_map = {'ticket': perm.TICKET_VIEW, 'wiki': perm.WIKI_VIEW} self.perm.assert_permission(perm_map[parent_type])
|
d80b08a319375884f5f4b758298ec7b516566b7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d80b08a319375884f5f4b758298ec7b516566b7e/attachment.py
|
|
zipinfo.date_time = time.gmtime(new_node.last_modified)[:6]
|
zipinfo.date_time = new_node.last_modified.utctimetuple()[:6]
|
def _render_zip(self, req, filename, repos, data): """ZIP archive with all the added and/or modified files.""" new_rev = data['new_rev'] req.send_response(200) req.send_header('Content-Type', 'application/zip') req.send_header('Content-Disposition', 'attachment;' 'filename=%s.zip' % filename)
|
2191b22f7401169b64430985854962dd794646aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2191b22f7401169b64430985854962dd794646aa/changeset.py
|
old_node = repos.get_node(base_path or path, base_rev) new_node = repos.get_node(path, chgset.rev)
|
if change is Changeset.ADD: old_node = None else: old_node = repos.get_node(base_path or path, base_rev) if change is Changeset.DELETE: new_node = None else: new_node = repos.get_node(path, chgset.rev)
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
old_content = old_node.get_content().read()
|
if kind is 'dir': continue new_content = old_content = '' new_node_info = old_node_info = ('','') if old_node: old_content = old_node.get_content().read() old_node_info = (old_node.path, old_node.rev)
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
new_content = new_node.get_content().read()
|
if new_node: new_content = new_node.get_content().read() new_node_info = (new_node.path, new_node.rev)
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
req.write('--- %s (revision %s)' % (old_node.path, old_node.rev) +
|
req.write('--- %s (revision %s)' % old_node_info +
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
req.write('+++ %s (revision %s)' % (new_node.path, new_node.rev) +
|
req.write('+++ %s (revision %s)' % new_node_info +
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
req.write(line + util.CRLF)
|
req.write(util.rstrip(line, '\r') + util.CRLF)
|
def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers()
|
398635c4cfc9e6edb00c3397a70ab8f227d434aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/398635c4cfc9e6edb00c3397a70ab8f227d434aa/Changeset.py
|
from email.MIMEText import MIMEText
|
from email.MIMEText import MIMEText from email.Header import Header
|
def send(self, rcpt, mime_headers={}):
|
3f02f2ac732d18b63be45396663354e0178a2fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f02f2ac732d18b63be45396663354e0178a2fb6/Notify.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.