rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
and not constraint[0][0] in '!~^$':
and not constraint[0][0] in ('!', '~', '^', '$'):
def get_columns(self): if self.cols: return self.cols
36331da02fc9b314c1a7351ab2da64f6c8fdca9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/36331da02fc9b314c1a7351ab2da64f6c8fdca9b/Query.py
if len(v[0]) and v[0][neg] in "~^$":
if len(v[0]) and v[0][neg] in ('~', '^', '$'):
def get_constraint_sql(name, value, mode, neg): value = sql_escape(value[len(mode and '!' or '' + mode):]) if mode == '~' and value: return "IFNULL(%s,'') %sLIKE '%%%s%%'" % ( name, neg and 'NOT ' or '', value) elif mode == '^' and value: return "IFNULL(%s,'') %sLIKE '%s%%'" % ( name, neg and 'NOT ' or '', value) elif ...
36331da02fc9b314c1a7351ab2da64f6c8fdca9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/36331da02fc9b314c1a7351ab2da64f6c8fdca9b/Query.py
sql.append("\nWHERE " + " AND ".join(filter(None, clauses)))
sql.append("\nWHERE " + " AND ".join(clauses))
def get_constraint_sql(name, value, mode, neg): value = sql_escape(value[len(mode and '!' or '' + mode):]) if mode == '~' and value: return "IFNULL(%s,'') %sLIKE '%%%s%%'" % ( name, neg and 'NOT ' or '', value) elif mode == '^' and value: return "IFNULL(%s,'') %sLIKE '%s%%'" % ( name, neg and 'NOT ' or '', value) elif ...
36331da02fc9b314c1a7351ab2da64f6c8fdca9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/36331da02fc9b314c1a7351ab2da64f6c8fdca9b/Query.py
if val[:1] in "~^$":
if val[:1] in ('~', '^', '$'):
def display(self): self.req.hdf.setValue('title', 'Custom Query') query = self.query
36331da02fc9b314c1a7351ab2da64f6c8fdca9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/36331da02fc9b314c1a7351ab2da64f6c8fdca9b/Query.py
self.cookie.load(os.getenv('HTTP_COOKIE'))
if os.getenv('HTTP_COOKIE'): self.cookie.load(os.getenv('HTTP_COOKIE'))
def init_request(self): Request.init_request(self) self.cgi_location = os.getenv('SCRIPT_NAME') self.remote_addr = os.getenv('REMOTE_ADDR') self.remote_user = os.getenv('REMOTE_USER') self.cookie.load(os.getenv('HTTP_COOKIE'))
8fe5af3eb3c7cbdcbae2f83f6e49308e72d0f8ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8fe5af3eb3c7cbdcbae2f83f6e49308e72d0f8ef/core.py
'preview': ' '}
'preview': ''}
def preview_to_hdf(self, req, mimetype, charset, content, filename, detail=None, annotations=None): if not is_binary(content): content = to_utf8(content, charset or self.preview_charset(content)) max_preview_size = self.max_preview_size() if len(content) >= max_preview_size: return {'max_file_size_reached': True, 'max_...
c56f91fd281c45fbb93fecc6eb4f0f0c0de8c68c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c56f91fd281c45fbb93fecc6eb4f0f0c0de8c68c/api.py
self.hdf.setValue(prefix, markup.escape(value))
self.hdf.setValue(prefix, markup.escape(value).encode('utf-8'))
def add_value(prefix, value): if value is None: return elif value in (True, False): self.hdf.setValue(prefix, str(int(value))) elif isinstance(value, markup.Markup): self.hdf.setValue(prefix, value.encode('utf-8')) elif isinstance(value, markup.Fragment): self.hdf.setValue(prefix, unicode(value).encode('utf-8')) elif i...
0d61b3c895b74b88982a5911af0fc4d194d32699 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0d61b3c895b74b88982a5911af0fc4d194d32699/clearsilver.py
req.perm.reqiure(perm_map[attachment.parent_type])
req.perm.require(perm_map[attachment.parent_type])
def _do_save(self, req, attachment): perm_map = {'ticket': 'TICKET_APPEND', 'wiki': 'WIKI_MODIFY'} req.perm.reqiure(perm_map[attachment.parent_type])
b0b4fdf1fedd97e19a01238709cc41ff875315e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b0b4fdf1fedd97e19a01238709cc41ff875315e5/attachment.py
'install_scripts': my_install_scripts})
'install_scripts': my_install_scripts, 'install_data': my_install_data})
def initialize_options(self): bdist_wininst.initialize_options(self) self.title = "Trac %s" % VERSION self.bitmap = "setup_wininst.bmp"
ce87e6d19d4f8f40d7b864ece2a4de626604501e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ce87e6d19d4f8f40d7b864ece2a4de626604501e/setup.py
while current_rev:
while current_rev is not None:
def sync(self): self.log.debug("Checking whether sync with repository is needed") youngest_stored = self.repos.get_youngest_rev_in_cache(self.db) if youngest_stored != str(self.repos.youngest_rev): kindmap = dict(zip(_kindmap.values(), _kindmap.keys())) actionmap = dict(zip(_actionmap.values(), _actionmap.keys())) self...
7641a2c84ff6f0f1fd03c5cf238e6e2f29a67bcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7641a2c84ff6f0f1fd03c5cf238e6e2f29a67bcd/cache.py
attachments_dir = os.path.join(self.env_path, 'attachments')
self.attachments_dir = os.path.join(self.env_path, 'attachments')
def setUp(self): self.env_path = os.path.join(tempfile.gettempdir(), 'trac-tempenv') os.mkdir(self.env_path) self.db = InMemoryDatabase() attachments_dir = os.path.join(self.env_path, 'attachments') config = Configuration(None) config.setdefault('attachment', 'max_size', 512) self.env = Mock(config=config, log=logger_f...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
get_attachments_dir=lambda: attachments_dir,
get_attachments_dir=lambda: self.attachments_dir,
def setUp(self): self.env_path = os.path.join(tempfile.gettempdir(), 'trac-tempenv') os.mkdir(self.env_path) self.db = InMemoryDatabase() attachments_dir = os.path.join(self.env_path, 'attachments') config = Configuration(None) config.setdefault('attachment', 'max_size', 512) self.env = Mock(config=config, log=logger_f...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/foo.txt',
self.assertEqual(os.path.join(self.attachments_dir, 'ticket', '42', 'foo.txt'),
def test_get_path(self): attachment = Attachment(self.env, 'ticket', 42) attachment.filename = 'foo.txt' self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/foo.txt', attachment.path) attachment = Attachment(self.env, 'wiki', 'SomePage') attachment.filename = 'bar.jpg' self.assertEqual('/tmp/trac-tempenv/attachme...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
self.assertEqual('/tmp/trac-tempenv/attachments/wiki/SomePage/bar.jpg',
self.assertEqual(os.path.join(self.attachments_dir, 'wiki', 'SomePage', 'bar.jpg'),
def test_get_path(self): attachment = Attachment(self.env, 'ticket', 42) attachment.filename = 'foo.txt' self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/foo.txt', attachment.path) attachment = Attachment(self.env, 'wiki', 'SomePage') attachment.filename = 'bar.jpg' self.assertEqual('/tmp/trac-tempenv/attachme...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/Teh%20foo.txt',
self.assertEqual(os.path.join(self.attachments_dir, 'ticket', '42', 'Teh%20foo.txt'),
def test_get_path_encoded(self): attachment = Attachment(self.env, 'ticket', 42) attachment.filename = 'Teh foo.txt' self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/Teh%20foo.txt', attachment.path) attachment = Attachment(self.env, 'wiki', '\xdcberSicht') attachment.filename = 'Teh bar.jpg' self.assertEqual('...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
self.assertEqual('/tmp/trac-tempenv/attachments/wiki/%DCberSicht/Teh%20bar.jpg',
self.assertEqual(os.path.join(self.attachments_dir, 'wiki', '%DCberSicht', 'Teh%20bar.jpg'),
def test_get_path_encoded(self): attachment = Attachment(self.env, 'ticket', 42) attachment.filename = 'Teh foo.txt' self.assertEqual('/tmp/trac-tempenv/attachments/ticket/42/Teh%20foo.txt', attachment.path) attachment = Attachment(self.env, 'wiki', '\xdcberSicht') attachment.filename = 'Teh bar.jpg' self.assertEqual('...
099069b3a902ad6e5626a7de48cc355cffdbb848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/099069b3a902ad6e5626a7de48cc355cffdbb848/attachment.py
poolable = have_pysqlite and sqlite_version >= 30301
poolable = have_pysqlite and os.name == 'nt' and sqlite_version >= 30301
def to_sql(cls, table): return _to_sql(table)
7f64c451e6657945d130e677d6df5df376785f48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7f64c451e6657945d130e677d6df5df376785f48/sqlite_backend.py
return PooledConnection(self, cnx, tid)
def get_cnx(self, timeout=None): start = time.time() self._available.acquire() try: tid = threading._get_ident() if tid in self._active: num, cnx = self._active.get(tid) if num == 0: # was pushed back (see _cleanup) if try_rollback(cnx): self._active[tid][0] = num + 1 return PooledConnection(self, cnx, tid) else: del s...
170f74c4cde8b5ba88c0e16e7ebfb415819ac0a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/170f74c4cde8b5ba88c0e16e7ebfb415819ac0a0/pool.py
def send_response(self, code): raise RuntimeError, 'Virtual method not implemented' def send_header(self, name, value): raise RuntimeError, 'Virtual method not implemented' def end_headers(self): raise RuntimeError, 'Virtual method not implemented'
def init_request(self): import neo_cgi import neo_cs import neo_util import Cookie self.hdf = neo_util.HDF() self.incookie = Cookie.SimpleCookie() self.outcookie = Cookie.SimpleCookie()
8450371c7958ff365662ad39fe6ba78e8bddc7c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8450371c7958ff365662ad39fe6ba78e8bddc7c8/core.py
if port == 80:
if os.getenv('HTTP_X_FORWARDED_HOST'): self.base_url = 'http://%s%s/' % (os.getenv('HTTP_X_FORWARDED_HOST'), self.cgi_location) elif port == 80:
def init_request(self): Request.init_request(self) self.cgi_location = os.getenv('SCRIPT_NAME') self.remote_addr = os.getenv('REMOTE_ADDR') self.remote_user = os.getenv('REMOTE_USER') self.command = os.getenv('REQUEST_METHOD') host = os.getenv('SERVER_NAME') try: port = int(os.getenv('SERVER_PORT')) except TypeError: p...
8450371c7958ff365662ad39fe6ba78e8bddc7c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8450371c7958ff365662ad39fe6ba78e8bddc7c8/core.py
self.fileno = 0 def close_file(self, file_baton, pool):
self.prev_path = None self.fileno = -1 self.prefix = None def _check_next(self, old_path, new_path, pool): if self.prev_path == (old_path or new_path): return
def __init__(self, old_root, new_root, rev, req, args, env): BaseDiffEditor.__init__(self, old_root, new_root, rev, req, args, env) self.fileno = 0
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
def change_file_prop(self, file_baton, name, value, pool): if not file_baton: return (old_path, new_path, pool) = file_baton prefix = 'changeset.changes.%d.props.%s' % (self.fileno, name)
self.prev_path = old_path or new_path self.prefix = 'changeset.changes.%d' % (self.fileno)
def close_file(self, file_baton, pool): self.fileno += 1
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
old_value = svn.fs.node_prop(self.old_root, old_path, name, pool) self.req.hdf.setValue(prefix + '.old', old_value) if value: self.req.hdf.setValue(prefix + '.new', value) def change_dir_prop(self, dir_baton, name, value, pool):
old_rev = svn.fs.node_created_rev(self.old_root, old_path, pool) self.req.hdf.setValue('%s.rev.old' % self.prefix, str(old_rev)) self.req.hdf.setValue('%s.browser_href.old' % self.prefix, self.env.href.browser(old_path, old_rev)) if new_path: new_rev = svn.fs.node_created_rev(self.new_root, new_path, pool) self.req.hdf...
def change_file_prop(self, file_baton, name, value, pool): if not file_baton: return
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
def change_dir_prop(self, dir_baton, name, value, pool): if not dir_baton: return
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
prefix = 'changeset.changes.%d.props.%s' % (self.fileno, name)
self._check_next(old_path, new_path, dir_pool) prefix = '%s.props.%s' % (self.prefix, name)
def change_dir_prop(self, dir_baton, name, value, pool): if not dir_baton: return
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
old_value = svn.fs.node_prop(self.old_root, old_path, name, pool)
old_value = svn.fs.node_prop(self.old_root, old_path, name, dir_pool)
def change_dir_prop(self, dir_baton, name, value, pool): if not dir_baton: return
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
old_rev = svn.fs.node_created_rev(self.old_root, old_path, pool) new_rev = svn.fs.node_created_rev(self.new_root, new_path, pool) prefix = 'changeset.changes.%d' % (self.fileno) self.req.hdf.setValue('%s.rev.old' % prefix, str(old_rev)) self.req.hdf.setValue('%s.rev.new' % prefix, str(new_rev)) self.req.hdf.setValue('...
self._check_next(old_path, new_path, pool)
def apply_textdelta(self, file_baton, base_checksum): if not file_baton: return (old_path, new_path, pool) = file_baton old_rev = svn.fs.node_created_rev(self.old_root, old_path, pool) new_rev = svn.fs.node_created_rev(self.new_root, new_path, pool)
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
mime_type = svn.fs.node_prop (self.new_root, new_path, svn.util.SVN_PROP_MIME_TYPE, pool)
mime_type = svn.fs.node_prop(self.new_root, new_path, svn.util.SVN_PROP_MIME_TYPE, pool)
def apply_textdelta(self, file_baton, base_checksum): if not file_baton: return (old_path, new_path, pool) = file_baton old_rev = svn.fs.node_created_rev(self.old_root, old_path, pool) new_rev = svn.fs.node_created_rev(self.new_root, new_path, pool)
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
builder = Diff.HDFBuilder(self.req.hdf, '%s.diff' % prefix, tabwidth)
builder = Diff.HDFBuilder(self.req.hdf, '%s.diff' % self.prefix, tabwidth)
def apply_textdelta(self, file_baton, base_checksum): if not file_baton: return (old_path, new_path, pool) = file_baton old_rev = svn.fs.node_created_rev(self.old_root, old_path, pool) new_rev = svn.fs.node_created_rev(self.new_root, new_path, pool)
5d4c14a9ae16d7086c0ba29b263aafad5e909c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d4c14a9ae16d7086c0ba29b263aafad5e909c0b/Changeset.py
format = ('%%%is: %%-%is | ' % (width[1], width[1]),
format = ('%%%is: %%-%is | ' % (width[0], width[1]),
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] != 'summary'] 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: continu...
f438c3aa773fbc8d04ab50d68352961a8c349104 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f438c3aa773fbc8d04ab50d68352961a8c349104/Notify.py
self.hdf.setValue('HTTP.Host', os.getenv('HTTP_HOST'))
self.hdf.setValue('HTTP.Host', os.getenv('HTTP_HOST').split(':')[0])
def init_request(self): Request.init_request(self) self.cgi_location = os.getenv('SCRIPT_NAME') self.remote_addr = os.getenv('REMOTE_ADDR') self.remote_user = os.getenv('REMOTE_USER') self.command = os.getenv('REQUEST_METHOD') host = os.getenv('SERVER_NAME') proto_port = '' port = int(os.environ.get('SERVER_PORT', 80))...
c9cfa9ed5eb02648c2ddb11f49ec52bd388eabec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c9cfa9ed5eb02648c2ddb11f49ec52bd388eabec/core.py
if column in ['id', 'ticket', '
if column in ('ticket', 'id', '_id', '
def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} for action in [k for k,v in actions.items() if req.perm.has_permission(v...
2a745aa87936e1e869b815421da626d392098904 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2a745aa87936e1e869b815421da626d392098904/report.py
if col[0] in ('ticket', 'id')]
if col[0] in ('ticket', 'id', '_id')]
def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} for action in [k for k,v in actions.items() if req.perm.has_permission(v...
2a745aa87936e1e869b815421da626d392098904 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2a745aa87936e1e869b815421da626d392098904/report.py
elif column in ['time', 'date','changetime', 'created', 'modified']:
elif column in ('time', 'date','changetime', 'created', 'modified'):
def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} for action in [k for k,v in actions.items() if req.perm.has_permission(v...
2a745aa87936e1e869b815421da626d392098904 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2a745aa87936e1e869b815421da626d392098904/report.py
"""Render an XHTML preview of the given `content` (a raw str object)
"""Render an XHTML preview of the given `content`. `content` is the same as an `IHTMLPreviewRenderer.render`'s `content` argument.
def render(self, req, mimetype, content, filename=None, url=None, annotations=None): """Render an XHTML preview of the given `content` (a raw str object)
e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2/api.py
full_mimetype = mimetype or self.get_mimetype(filename, content)
full_mimetype = mimetype if not full_mimetype: if hasattr(content, 'read'): content = content.read(mimeview.get_max_preview_size()) full_mimetype = self.get_mimetype(filename, content)
def render(self, req, mimetype, content, filename=None, url=None, annotations=None): """Render an XHTML preview of the given `content` (a raw str object)
e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2/api.py
def render(self, req, mimetype, content, filename=None, url=None, annotations=None): """Render an XHTML preview of the given `content` (a raw str object)
e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2/api.py
content = expanded_content result = renderer.render(req, full_mimetype, content,
rendered_content = expanded_content result = renderer.render(req, full_mimetype, rendered_content,
def render(self, req, mimetype, content, filename=None, url=None, annotations=None): """Render an XHTML preview of the given `content` (a raw str object)
e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e93909bc074150b9e0cf24fb9f8ab9c269c3c5a2/api.py
assert tid == threading._get_ident()
def shutdown(self, tid=None): assert tid == threading._get_ident() if tid: try: self._lock.acquire() self._cache.pop(tid, None) finally: self._lock.release()
a184eecbfdd364ed069bbd6a45324396897ca595 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a184eecbfdd364ed069bbd6a45324396897ca595/api.py
SHREF_TARGET_MIDDLE = r"(?:\|(?=[^| ])|&(?!lt;)|[^|& ])" SHREF_TARGET_LAST_CHAR = r"[^|'~_\.,& \)]"
SHREF_TARGET_MIDDLE = r"(?:\|(?=[^|\s])|&(?!lt;)|[^|&\s])" SHREF_TARGET_LAST_CHAR = r"[^|'~_\.,&\s\)\]:?!]"
def process(self, req, text, inline=False): if self.error: return system_message('Error: Failed to load processor <code>%s</code>' % self.name, self.error) text = self.processor(req, text) if inline: code_block_start = re.compile('^<div class="code-block">') code_block_end = re.compile('</div>$') text, nr = code_block_...
424ba53b5861faf25714a83d3fcc3b54c11aab59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/424ba53b5861faf25714a83d3fcc3b54c11aab59/formatter.py
changeset = Mock(Changeset, 1, 'Import', 'joe', 42000, get_changes=lambda: iter(changes))
changesets = [Mock(Changeset, 0, '', '', 41000, get_changes=lambda: []), Mock(Changeset, 1, 'Import', 'joe', 42000, get_changes=lambda: iter(changes))]
def test_initial_sync(self): changes = [('trunk', Node.DIRECTORY, Changeset.ADD, None, None), ('trunk/README', Node.FILE, Changeset.ADD, None, None)] changeset = Mock(Changeset, 1, 'Import', 'joe', 42000, get_changes=lambda: iter(changes)) repos = Mock(Repository, None, self.log, get_changeset=lambda x: changeset, get_...
a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6/cache.py
get_changeset=lambda x: changeset, get_oldest_rev=lambda: 1,
get_changeset=lambda x: changesets[int(x)], get_oldest_rev=lambda: 0,
def test_initial_sync(self): changes = [('trunk', Node.DIRECTORY, Changeset.ADD, None, None), ('trunk/README', Node.FILE, Changeset.ADD, None, None)] changeset = Mock(Changeset, 1, 'Import', 'joe', 42000, get_changes=lambda: iter(changes)) repos = Mock(Repository, None, self.log, get_changeset=lambda x: changeset, get_...
a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6/cache.py
next_rev=lambda x: x == '0' and '1' or None)
next_rev=lambda x: int(x) == 0 and '1' or None)
def test_initial_sync(self): changes = [('trunk', Node.DIRECTORY, Changeset.ADD, None, None), ('trunk/README', Node.FILE, Changeset.ADD, None, None)] changeset = Mock(Changeset, 1, 'Import', 'joe', 42000, get_changes=lambda: iter(changes)) repos = Mock(Repository, None, self.log, get_changeset=lambda x: changeset, get_...
a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a81203a7fc8eb7c779fef3fbf03a8b56fbbc04a6/cache.py
field['optional'] = '' in field['options']
if '' in field['options']: field['optional'] = True field['options'].remove('')
def get_custom_fields(self): fields = [] config = self.config['ticket-custom'] for name in [option for option, value in config.options() if '.' not in option]: field = { 'name': name, 'type': config.get(name), 'order': config.getint(name + '.order', 0), 'label': config.get(name + '.label') or name.capitalize(), 'value'...
c24b175863d14a154305882378751cd05a0b0c61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c24b175863d14a154305882378751cd05a0b0c61/api.py
req.path_info = path_info
req.path_info = to_utf8(path_info)
def dispatch_request(path_info, req, env): """Main entry point for the Trac web interface.""" # Re-parse the configuration file if it changed since the last the time it # was parsed env.config.parse_if_needed() base_url = env.config.get('trac', 'base_url') if not base_url: base_url = absolute_url(req) req.base_url = ...
4811fe8a5989c5e878c1d260ebbdfe50862ebf74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4811fe8a5989c5e878c1d260ebbdfe50862ebf74/main.py
content = content.read(mimeview.get_max_preview_size())
content = content.read(self.get_max_preview_size())
def render(self, req, mimetype, content, filename=None, url=None, annotations=None): """Render an XHTML preview of the given `content`.
4128ff9a9115a3970f3d0eb15dbd9792ce426945 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4128ff9a9115a3970f3d0eb15dbd9792ce426945/api.py
(cons_locale, cons_charset) = locale.getdefaultlocale()
cons_charset = locale.getpreferredencoding()
def print_listing(self, headers, data, sep=' ', decor=True): (cons_locale, cons_charset) = locale.getdefaultlocale() ldata = list(data) if decor: ldata.insert(0, headers) print colw = [] ncols = len(ldata[0]) # assumes all rows are of equal length for cnum in xrange(0, ncols): mw = 0 for cell in [unicode(d[cnum]) or ''...
7ab135dbd60529ad1a53ff5a3f13bfd5a9f7dca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7ab135dbd60529ad1a53ff5a3f13bfd5a9f7dca2/admin.py
__default_templates_dir__ = '%(templates)s' __default_htdocs_dir__ = '%(htdocs)s' __default_wiki_dir__ = '%(wiki)s'
__default_templates_dir__ = '%(templates)r' __default_htdocs_dir__ = '%(htdocs)r' __default_wiki_dir__ = '%(wiki)r'
def siteconfig(self): templates_dir = os.path.join(self.prefix, 'share','trac','templates') htdocs_dir = os.path.join(self.prefix, 'share','trac','htdocs') wiki_dir = os.path.join(self.prefix, 'share','trac','wiki-default') f = open(_p('trac/siteconfig.py'),'w') f.write("""
f9f058a8c0cfdc1b7632c175c77e0096f3c52f1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f9f058a8c0cfdc1b7632c175c77e0096f3c52f1f/setup.py
fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')]
fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc')]
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
for i, f in enum([f['name'] for f in fields]):
i = 0 for f in [f['name'] for f in fields if f['type'] != 'textarea']:
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
if fval.find('\n') > -1:
if fval.find('\n') != -1:
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
big = [f for f in tkt.fields if f['type'] == 'textarea' and f['name'] != 'description']
big = []
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
for f in [f['name'] for f in fields]: if not tkt.values.has_key(f):
for f in fields: fname = f['name'] if not tkt.values.has_key(fname):
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), CRLF.join(fval.splitlines())))
fval = tkt[fname] if f['type'] == 'textarea' or '\n' in str(fval): big.append((fname.capitalize(), CRLF.join(fval.splitlines())))
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
txt += format[i % 2] % (f.capitalize(), fval)
txt += format[i % 2] % (fname.capitalize(), fval)
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
if not i % 2:
if i % 2:
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > ...
f1ab6093ddcbd5043fbfaafca5b5e06bde87313b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f1ab6093ddcbd5043fbfaafca5b5e06bde87313b/Notify.py
def init_request(self): core.Request.init_request(self) options = self.req.get_options()
8c8d659f72c1bd488b713bfdca633d8975787ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8c8d659f72c1bd488b713bfdca633d8975787ff9/ModPythonHandler.py
FieldStorage class with an added get function.
FieldStorage class with a get function that provides an empty string as the default value for the 'default' parameter, mimicking the CGI interface.
def end_headers(self): pass
8c8d659f72c1bd488b713bfdca633d8975787ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8c8d659f72c1bd488b713bfdca633d8975787ff9/ModPythonHandler.py
req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project))
req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project))
def send_project_index(req, mpr, dir): req.content_type = 'text/html' req.write('<html><head><title>Available Projects</title></head>') req.write('<body><h1>Available Projects</h1><ul>') for project in os.listdir(dir): req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project)) req.write...
8c8d659f72c1bd488b713bfdca633d8975787ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8c8d659f72c1bd488b713bfdca633d8975787ff9/ModPythonHandler.py
command, line = line[0], line[1:]
command = ' ' if line: command, line = line[0], line[1:]
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
a9cdb0882821a973ad2a87907ca3248b2ef57151 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a9cdb0882821a973ad2a87907ca3248b2ef57151/patch.py
url, annotations)}
url, annotations), 'raw_href': url}
def preview_to_hdf(self, req, content, length, mimetype, filename, url=None, annotations=None): """Prepares a rendered preview of the given `content`.
e0ab87618defe595284685c17b4ecdb21167e14d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e0ab87618defe595284685c17b4ecdb21167e14d/api.py
return 'timeline_rss.cs', 'text/xml'
return 'timeline_rss.cs', 'application/rss+xml'
def process_request(self, req): req.perm.assert_permission(perm.TIMELINE_VIEW)
65c0c9f409ad3c49a84972bc6189271d6bce969f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/65c0c9f409ad3c49a84972bc6189271d6bce969f/Timeline.py
args = filter(None, args)
def get_constraint_sql(name, value, mode, neg): if name not in custom_fields: name = 't.' + name else: name = name + '.value' value = value[len(mode) + neg:]
4d5d97624532165424b518ae58d8e3a31844193f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4d5d97624532165424b518ae58d8e3a31844193f/query.py
cinfo['browser_href.new'] = self.env.href.browser(new_path, rev)
cinfo['browser_href.new'] = self.env.href.browser(new_path, rev=rev)
def get_change_info(self, rev): cursor = self.db.cursor () cursor.execute("SELECT name, change FROM node_change " "WHERE rev=%s", (rev,)) info = [] while 1: row = cursor.fetchone() if not row: break change = row['change'] name = row['name'] if change in 'CRdm': # 'C'opy, 'R'eplace or 'd'elete on a branch # the name col...
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
cinfo['browser_href.old'] = self.env.href.browser(old_path, old_rev)
cinfo['browser_href.old'] = self.env.href.browser(old_path, rev=old_rev)
def get_change_info(self, rev): cursor = self.db.cursor () cursor.execute("SELECT name, change FROM node_change " "WHERE rev=%s", (rev,)) info = [] while 1: row = cursor.fetchone() if not row: break change = row['change'] name = row['name'] if change in 'CRdm': # 'C'opy, 'R'eplace or 'd'elete on a branch # the name col...
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
self.add_link('alternate', '?format=diff', 'Unified Diff',
self.add_link(req, 'alternate', '?format=diff', 'Unified Diff',
def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW)
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
self.add_link('alternate', '?format=zip', 'Zip Archive',
self.add_link(req, 'alternate', '?format=zip', 'Zip Archive',
def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW)
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
self.add_link('first', self.env.href.changeset(1), 'Changeset 1') self.add_link('prev', self.env.href.changeset(self.rev - 1),
self.add_link(req, 'first', self.env.href.changeset(1), 'Changeset 1') self.add_link(req, 'prev', self.env.href.changeset(self.rev - 1),
def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW)
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
self.add_link('next', self.env.href.changeset(self.rev + 1),
self.add_link(req, 'next', self.env.href.changeset(self.rev + 1),
def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW)
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
self.add_link('last', self.env.href.changeset(youngest_rev),
self.add_link(req, 'last', self.env.href.changeset(youngest_rev),
def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW)
5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py
mimetype = mimetypes.guess_type(path)[0] or \ 'application/octet-stream'
mimetype = get_mimetype(path) or 'application/octet-stream'
def send_file(self, path, mimetype=None): """Send a local file to the browser. This method includes the "Last-Modified", "Content-Type" and "Content-Length" headers in the response, corresponding to the file attributes. It also checks the last modification time of the local file against the "If-Modified-Since" provide...
3e4f52d418a606c023b2582e2999dd888f8e6e8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3e4f52d418a606c023b2582e2999dd888f8e6e8e/api.py
if not authenticated and self.last_visit: if time.time() - self.last_visit > UPDATE_INTERVAL: self.bake_cookie()
if not authenticated and refresh_cookie: self.bake_cookie()
def get_session(self, sid, authenticated=False): db = self.env.get_db_cnx() cursor = db.cursor() self.sid = sid cursor.execute("SELECT last_visit FROM session " "WHERE sid=%s AND authenticated=%s", (sid, int(authenticated))) row = cursor.fetchone() if not row: return self._new = False self.last_visit = int(row[0]) curs...
c4750c15b54885f44055d6ce3431f4d9775dc380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c4750c15b54885f44055d6ce3431f4d9775dc380/session.py
'title': util.row[0],
'title': row[0],
def _render_confirm_delete(self, req, db, id): req.perm.assert_permission('REPORT_DELETE')
5a0824890fb594416ef096e4f37d0234096076ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5a0824890fb594416ef096e4f37d0234096076ef/report.py
time.strftime("%a, %d %b %Y %H:%M:%S GMT", self.last_modified)) req.send_header('Pragma', 'no-cache') req.send_header('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT') req.send_header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') req.send_header('Cache-Control', 'post-check=0, pre-check=0')
time.strftime("%a, %d %b %Y %H:%M:%S GMT", self.last_modified))
def display_raw(self, req): req.send_response(200) req.send_header('Content-Type', self.mime_type) req.send_header('Content-Length', str(self.length)) req.send_header('Last-Modified', time.strftime("%a, %d %b %Y %H:%M:%S GMT", self.last_modified)) req.send_header('Pragma', 'no-cache') req.send_header('Expires', 'Mon, 2...
74120833ed550d69a6a65e69042631dfac99a114 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/74120833ed550d69a6a65e69042631dfac99a114/File.py
args[x] = _args[x].value
argv = _args[x] if type(argv) == list: argv = argv[0] args[x] = argv.value
def real_main(): import sync import Href import perm import auth from util import dict_get_with_default, redirect path_info = os.getenv('PATH_INFO') remote_addr = os.getenv('REMOTE_ADDR') remote_user = os.getenv('REMOTE_USER') http_cookie = os.getenv('HTTP_COOKIE') http_referer = os.getenv('HTTP_REFERER') cgi_location...
df6867cff3173ed1f4d48d334ee012b5904b9637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/df6867cff3173ed1f4d48d334ee012b5904b9637/trac.py
'session for user %s' % (sid, req.authname))
'session for user %s' % (sid, self.req.authname))
def promote_session(self, sid): """ Promotes an anonymous session to an authenticated session, if there is no preexisting session data for that user name. """ assert self.req.authname != 'anonymous', \ 'Cannot promote session of anonymous user'
c37148ae73c202fd29b7ddf1dde3519d387817c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c37148ae73c202fd29b7ddf1dde3519d387817c9/session.py
if self.hasTickets(): raise Exception("Will not modify database with existing tickets!")
self.assertNoTickets()
def setSeverityList(self, s): """Remove all severities, set them to `s`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM enum WHERE type='severity'""") for value, i in s: print "inserting severity ", value, " ", i c.execute("""I...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
if self.hasTickets(): raise Exception("Will not modify database with existing tickets!")
self.assertNoTickets()
def setPriorityList(self, s): """Remove all priorities, set them to `s`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM enum WHERE type='priority'""") for value, i in s: print "inserting priority ", value, " ", i c.execute("""I...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
if self.hasTickets(): raise Exception("Will not modify database with existing tickets!")
self.assertNoTickets()
def setComponentList(self, l, key): """Remove all components, set them to `l`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM component""") for comp in l: print "inserting component ", comp[key] c.execute("""INSERT INTO compone...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
if self.hasTickets(): raise Exception("Will not modify database with existing tickets!")
self.assertNoTickets()
def setVersionList(self, v, key): """Remove all versions, set them to `v`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM version""") for vers in v: print "inserting version ", vers[key] c.execute("""INSERT INTO version (name) ...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
if self.hasTickets(): raise Exception("Will not modify database with existing tickets!")
self.assertNoTickets()
def setMilestoneList(self, m, key): """Remove all milestones, set them to `m`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM milestone""") for ms in m: print "inserting milestone ", ms[key] c.execute("""INSERT INTO milestone (...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
def addTicket(self, time, changetime, component,
def addTicket(self, id, time, changetime, component,
def addTicket(self, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords): c = self.db().cursor()
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
c.execute("""INSERT INTO ticket (time, changetime, component,
desc = description.encode('utf-8') if PREFORMAT_COMMENTS: desc = '{{{\n%s\n}}}' % desc print "inserting ticket %s -- %s" % (id, summary) c.execute("""INSERT INTO ticket (id, time, changetime, component,
def addTicket(self, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords): c = self.db().cursor()
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
VALUES (%s, %s, %s,
VALUES (%s, %s, %s, %s,
def addTicket(self, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords): c = self.db().cursor()
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
time.strftime('%s'), changetime.strftime('%s'), component.encode('utf-8'),
id, time.strftime('%s'), changetime.strftime('%s'), component.encode('utf-8'),
def addTicket(self, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords): c = self.db().cursor()
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
summary.encode('utf-8'), '{{{\n%s\n}}}' % (description.encode('utf-8'), ), keywords)
summary.encode('utf-8'), desc, keywords)
def addTicket(self, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords): c = self.db().cursor()
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
ticket, time.strftime('%s'), author, 'comment', '', '{{{\n%s\n}}}' % (value.encode('utf-8'), ))
ticket, time.strftime('%s'), author, 'comment', '', comment)
def addTicketComment(self, ticket, time, author, value): c = self.db().cursor() c.execute("""INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue) VALUES (%s, %s, %s, %s, %s, %s)""", ticket, time.strftime('%s'), author, 'comment', '', '{{{\n%s\n}}}' % (value.encode('utf-8'), )) self.db().co...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
class TheBugzillaConverter: def __init__(self, _db, _host, _user, _password, _env, _force): try: print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % (_db, _host, _user, _password) self.mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictC...
def addAttachment(self, id, attachment, description, author): print 'inserting attachment for ticket %s -- %s' % (id, description) self.env.create_attachment(self.db(), 'ticket', str(id), attachment, description, author, 'unknown') def getLoginName(self, cursor, userid): if userid not in self.loginNameCache: cursor.e...
def addTicketChange(self, ticket, time, author, field, oldvalue, newvalue): c = self.db().cursor() c.execute("""INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue) VALUES (%s, %s, %s, %s, %s, %s)""", ticket, time.strftime('%s'), author, field, oldvalue.encode('utf-8'), newvalue.encode('ut...
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
print """\ Usage: bugzilla2trac.py --db <MySQL dbname> - Bugzilla's database [-h | --host <MySQL hostname>] - Bugzilla's DNS host name [-u | --user <MySQL username>] - effective Bugzilla's database user [-p | --passwd <MySQL password>] - Bugzilla's user password --tracenv /path/to/trac/env - full ...
print "bugzilla2trac - Imports a bug database from Bugzilla into Trac." print print "Usage: bugzilla2trac.py [options]" print print "Available Options:" print " --db <MySQL dbname> - Bugzilla's database" print " --tracenv /path/to/trac/env - full path to Trac db environment" print " -h | --host <My...
def usage(): print """\
278262b3815812ba5a808f31a44ab5da9fcaadf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/278262b3815812ba5a808f31a44ab5da9fcaadf9/bugzilla2trac.py
self.assertEqual(16, self.repos.normalize_rev('latest')) self.assertEqual(16, self.repos.normalize_rev('head')) self.assertEqual(16, self.repos.normalize_rev('')) self.assertEqual(16, self.repos.normalize_rev(None))
self.assertEqual(17, self.repos.normalize_rev('latest')) self.assertEqual(17, self.repos.normalize_rev('head')) self.assertEqual(17, self.repos.normalize_rev('')) self.assertEqual(17, self.repos.normalize_rev(None))
def test_repos_normalize_rev(self): self.assertEqual(16, self.repos.normalize_rev('latest')) self.assertEqual(16, self.repos.normalize_rev('head')) self.assertEqual(16, self.repos.normalize_rev('')) self.assertEqual(16, self.repos.normalize_rev(None)) self.assertEqual(11, self.repos.normalize_rev('11')) self.assertEqua...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(16, self.repos.youngest_rev)
self.assertEqual(17, self.repos.youngest_rev)
def test_rev_navigation(self): self.assertEqual(1, self.repos.oldest_rev) self.assertEqual(None, self.repos.previous_rev(0)) self.assertEqual(None, self.repos.previous_rev(1)) self.assertEqual(16, self.repos.youngest_rev) self.assertEqual(6, self.repos.next_rev(5)) self.assertEqual(7, self.repos.next_rev(6)) # ... self...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(None, self.repos.next_rev(16))
self.assertEqual(None, self.repos.next_rev(17))
def test_rev_navigation(self): self.assertEqual(1, self.repos.oldest_rev) self.assertEqual(None, self.repos.previous_rev(0)) self.assertEqual(None, self.repos.previous_rev(1)) self.assertEqual(16, self.repos.youngest_rev) self.assertEqual(6, self.repos.next_rev(5)) self.assertEqual(7, self.repos.next_rev(6)) # ... self...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(14, node.rev) self.assertEqual(1133340423L, node.last_modified)
self.assertEqual(17, node.rev) self.assertEqual(1143808225L, node.last_modified)
def test_get_node(self): node = self.repos.get_node('/trunk') self.assertEqual('trunk', node.name) self.assertEqual('/trunk', node.path) self.assertEqual(Node.DIRECTORY, node.kind) self.assertEqual(14, node.rev) self.assertEqual(1133340423L, node.last_modified) node = self.repos.get_node('/trunk/README.txt') self.asser...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(14, self.repos.normalize_rev('latest')) self.assertEqual(14, self.repos.normalize_rev('head')) self.assertEqual(14, self.repos.normalize_rev('')) self.assertEqual(14, self.repos.normalize_rev(None))
self.assertEqual(17, self.repos.normalize_rev('latest')) self.assertEqual(17, self.repos.normalize_rev('head')) self.assertEqual(17, self.repos.normalize_rev('')) self.assertEqual(17, self.repos.normalize_rev(None))
def test_repos_normalize_rev(self): self.assertEqual(14, self.repos.normalize_rev('latest')) self.assertEqual(14, self.repos.normalize_rev('head')) self.assertEqual(14, self.repos.normalize_rev('')) self.assertEqual(14, self.repos.normalize_rev(None)) self.assertEqual(5, self.repos.normalize_rev('5')) self.assertEqual(...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(14, self.repos.youngest_rev)
self.assertEqual(17, self.repos.youngest_rev)
def test_rev_navigation(self): self.assertEqual(1, self.repos.oldest_rev) self.assertEqual(None, self.repos.previous_rev(0)) self.assertEqual(1, self.repos.previous_rev(2)) self.assertEqual(14, self.repos.youngest_rev) self.assertEqual(2, self.repos.next_rev(1)) self.assertEqual(3, self.repos.next_rev(2)) # ... self.as...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
self.assertEqual(None, self.repos.next_rev(14))
self.assertEqual(None, self.repos.next_rev(17))
def test_rev_navigation(self): self.assertEqual(1, self.repos.oldest_rev) self.assertEqual(None, self.repos.previous_rev(0)) self.assertEqual(1, self.repos.previous_rev(2)) self.assertEqual(14, self.repos.youngest_rev) self.assertEqual(2, self.repos.next_rev(1)) self.assertEqual(3, self.repos.next_rev(2)) # ... self.as...
19ecd012506375489920938d2a952ccb2c5b3ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/19ecd012506375489920938d2a952ccb2c5b3ac4/svn_fs.py
root = svn.fs.revision_root(self.fs_ptr, rev, self.pool)
def render(self): FileCommon.render(self) rev = self.args.get('rev', None) self.path = self.args.get('path', '/') if not rev: rev = svn.fs.youngest_rev(self.fs_ptr, self.pool) else: rev = int(rev) self.req.hdf.setValue('file.rev', str(rev)) self.req.hdf.setValue('file.path', self.path) self.req.hdf.setValue('file.rawu...
ec26cc32f0e56175c64489c2a3059a74dba4cbf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ec26cc32f0e56175c64489c2a3059a74dba4cbf6/File.py
def create_report(self, title, sql):
def create_report(self, title, description, sql):
def create_report(self, title, sql): self.perm.assert_permission(perm.REPORT_CREATE)
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py
cursor.execute('INSERT INTO report (id, title, sql)' 'VALUES (NULL, %s, %s)', title, sql)
cursor.execute('INSERT INTO report (id, title, sql, description)' 'VALUES (NULL, %s, %s, %s)', title, sql, description)
def create_report(self, title, sql): self.perm.assert_permission(perm.REPORT_CREATE)
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py
title = self.args['title'] sql = self.args['sql'] description = self.args['description']
title = self.args.get('title', '') sql = self.args.get('sql', '') description = self.args.get('description', '')
def commit_changes(self, id): """ saves report changes to the database """ self.perm.assert_permission(perm.REPORT_MODIFY)
0027c4b6b513d5e30705c4bc999e43367a18616e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0027c4b6b513d5e30705c4bc999e43367a18616e/Report.py