rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def to_integral(self, rounding = None, context=None): | def to_integral(self, rounding=None, context=None): | def to_integral(self, rounding = None, context=None): """Rounds to the nearest integer, without raising inexact, rounded.""" if self._is_special: ans = self._check_nans(context=context) if ans: return ans if self._exp >= 0: return self if context is None: context = getcontext() flags = context._ignore_flags(Rounded, In... | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
ans = ans._fix(context=context) | ans = ans._fix(context) | def sqrt(self, context=None): """Return the square root of self. | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
return ans._fix(context=context) | return ans._fix(context) | def sqrt(self, context=None): """Return the square root of self. | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
return ans._fix(context=context) | return ans._fix(context) | def max(self, other, context=None): """Returns the larger value. | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
return ans._fix(context=context) | return ans._fix(context) | def min(self, other, context=None): """Returns the smaller value. | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
return d._fix(context=self) | return d._fix(self) | def create_decimal(self, num='0'): """Creates a new Decimal instance but using self as context.""" d = Decimal(num, context=self) return d._fix(context=self) | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
return str(a._fix(context=self)) | return str(a._fix(self)) | def _apply(self, a): return str(a._fix(context=self)) | dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py |
vesion string using the format major.minor.build (or patchlevel). | version string using the format major.minor.build (or patchlevel). | def _norm_version(version,build=''): """ Normalize the version and build strings and return a single vesion string using the format major.minor.build (or patchlevel). """ l = string.split(version,'.') if build: l.append(build) try: ints = map(int,l) except ValueError: strings = l else: strings = map(str,ints) version ... | e5a7fad356a98f931bbe0d2c9e4b18854510c3dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e5a7fad356a98f931bbe0d2c9e4b18854510c3dd/platform.py |
"setparameters%r: returned %r" % (config + result)) | "setparameters%r: returned %r" % (config, result)) | def test_setparameters(dsp): # Two configurations for testing: # config1 (8-bit, mono, 8 kHz) should work on even the most # ancient and crufty sound card, but maybe not on special- # purpose high-end hardware # config2 (16-bit, stereo, 44.1kHz) should work on all but the # most ancient and crufty ha... | 813669f911d362b12daed634324453df0d6917b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/813669f911d362b12daed634324453df0d6917b0/test_ossaudiodev.py |
"setparameters%r: returned %r" % (config + result)) | "setparameters%r: returned %r" % (config, result)) | def test_setparameters(dsp): # Two configurations for testing: # config1 (8-bit, mono, 8 kHz) should work on even the most # ancient and crufty sound card, but maybe not on special- # purpose high-end hardware # config2 (16-bit, stereo, 44.1kHz) should work on all but the # most ancient and crufty ha... | 813669f911d362b12daed634324453df0d6917b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/813669f911d362b12daed634324453df0d6917b0/test_ossaudiodev.py |
if host[0] == '[' and host[-1] == ']': | if host and host[0] == '[' and host[-1] == ']': | def _set_hostport(self, host, port): if port is None: i = host.rfind(':') j = host.rfind(']') # ipv6 addresses have [...] if i > j: try: port = int(host[i+1:]) except ValueError: raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) host = host[:i] else: port = self.default_port if host[0] == '[' and host[-1] ... | 4d03791632a9b7a6d96640df09466969aec81b71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d03791632a9b7a6d96640df09466969aec81b71/httplib.py |
if url[:2] == '//' and url[2:3] != '/': | if url[:2] == '//' and url[2:3] != '/' and url[2:12] != 'localhost/': | def open_file(self, url): """Use local file or FTP depending on form of URL.""" if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url) | 3ae2dc5e5ea7521426ce3f34afa18147435ede5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ae2dc5e5ea7521426ce3f34afa18147435ede5c/urllib.py |
__version__ = "1.0b2" | __version__ = "1.0b3" | def _stringify(string): return string | 78eedce3ffabc0c8d5af988ab7f72d3749f995db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78eedce3ffabc0c8d5af988ab7f72d3749f995db/xmlrpclib.py |
class Error: | class Error(Exception): | def _stringify(string): return string | 78eedce3ffabc0c8d5af988ab7f72d3749f995db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78eedce3ffabc0c8d5af988ab7f72d3749f995db/xmlrpclib.py |
t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType): | if not isinstance(value, StringType): if not isinstance(value, TupleType): | def __init__(self, value=0): t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType): if value == 0: value = time.time() value = time.localtime(value) value = time.strftime("%Y%m%dT%H:%M:%S", value) self.value = value | 78eedce3ffabc0c8d5af988ab7f72d3749f995db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78eedce3ffabc0c8d5af988ab7f72d3749f995db/xmlrpclib.py |
"<Server proxy for %s%s>" % | "<ServerProxy for %s%s>" % | def __repr__(self): return ( "<Server proxy for %s%s>" % (self.__host, self.__handler) ) | 78eedce3ffabc0c8d5af988ab7f72d3749f995db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78eedce3ffabc0c8d5af988ab7f72d3749f995db/xmlrpclib.py |
server = Server("http://betty.userland.com") | server = ServerProxy("http://betty.userland.com") | def __getattr__(self, name): # magic method dispatcher return _Method(self.__request, name) | 78eedce3ffabc0c8d5af988ab7f72d3749f995db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78eedce3ffabc0c8d5af988ab7f72d3749f995db/xmlrpclib.py |
if _arguments.has_key('errn'): | if _arguments.get('errn', 0): | def run(self, _no_object=None, _attributes={}, **_arguments): """run: Run the Terminal application Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'oapp' | 65300f17c3abaf647ba793930097f7d2658cc716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65300f17c3abaf647ba793930097f7d2658cc716/Terminal_Suite.py |
if _arguments.has_key('errn'): | if _arguments.get('errn', 0): | def quit(self, _no_object=None, _attributes={}, **_arguments): """quit: Quit the Terminal application Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'quit' | 65300f17c3abaf647ba793930097f7d2658cc716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65300f17c3abaf647ba793930097f7d2658cc716/Terminal_Suite.py |
if _arguments.has_key('errn'): | if _arguments.get('errn', 0): | def count(self, _object=None, _attributes={}, **_arguments): """count: Return the number of elements of a particular class within an object Required argument: a reference to the objects to be counted Keyword argument _attributes: AppleEvent attribute dictionary Returns: the number of objects counted """ _code = 'core' ... | 65300f17c3abaf647ba793930097f7d2658cc716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65300f17c3abaf647ba793930097f7d2658cc716/Terminal_Suite.py |
if _arguments.has_key('errn'): | if _arguments.get('errn', 0): | def do_script(self, _no_object=None, _attributes={}, **_arguments): """do script: Run a UNIX shell script or command Keyword argument with_command: data to be passed to the Terminal application as the command line Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'dosc' | 65300f17c3abaf647ba793930097f7d2658cc716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65300f17c3abaf647ba793930097f7d2658cc716/Terminal_Suite.py |
The function prototype can be called in three ways to create a | The function prototype can be called in different ways to create a | def CFUNCTYPE(restype, *argtypes): """CFUNCTYPE(restype, *argtypes) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in three ways to create a callable object: prototype(integer address) -> foreign function prototype(callable) -> ... | 866a5d89b29903735379fe778c1a08ef3314ba78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/866a5d89b29903735379fe778c1a08ef3314ba78/__init__.py |
f = codecs.getwriter(self.encoding)(s) | f = codecs.getreader(self.encoding)(s) | def test_badbom(self): s = StringIO.StringIO("\xff\xff") f = codecs.getwriter(self.encoding)(s) self.assertRaises(UnicodeError, f.read) | a9620d1e2b9501481aefdb1be1960585eb701534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a9620d1e2b9501481aefdb1be1960585eb701534/test_codecs.py |
f = codecs.getwriter(self.encoding)(s) | f = codecs.getreader(self.encoding)(s) | def test_badbom(self): s = StringIO.StringIO("\xff\xff") f = codecs.getwriter(self.encoding)(s) self.assertRaises(UnicodeError, f.read) | a9620d1e2b9501481aefdb1be1960585eb701534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a9620d1e2b9501481aefdb1be1960585eb701534/test_codecs.py |
if msg[0] in (errno.EACCES, errno.ENODEV): | if msg[0] in (errno.EACCES, errno.ENODEV, errno.EBUSY): | def play_sound_file(path): fp = open(path, 'r') size, enc, rate, nchannels, extra = sunaudio.gethdr(fp) data = fp.read() fp.close() if enc != SND_FORMAT_MULAW_8: print "Expect .au file with 8-bit mu-law samples" return try: a = linuxaudiodev.open('w') except linuxaudiodev.error, msg: if msg[0] in (errno.EACCES, errno... | 4ce6b351cce6e202568ec499fc0d717d65c0c1d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ce6b351cce6e202568ec499fc0d717d65c0c1d7/test_linuxaudiodev.py |
typ, val, tb = sys.exc_info() | typ, val, tb = excinfo = sys.exc_info() sys.last_type, sys.last_value, sys.last_traceback = excinfo | def print_exception(): flush_stdout() efile = sys.stderr typ, val, tb = sys.exc_info() tbe = traceback.extract_tb(tb) print >>efile, '\nTraceback (most recent call last):' exclude = ("run.py", "rpc.py", "threading.py", "Queue.py", "RemoteDebugger.py", "bdb.py") cleanup_traceback(tbe, exclude) traceback.print_list(tbe, ... | 924f6164215f59e04fa8aa62ed62ce8a50991267 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/924f6164215f59e04fa8aa62ed62ce8a50991267/run.py |
db_incs = find_file('db_185.h', inc_dirs, []) if (db_incs is not None and self.compiler.find_library_file(lib_dirs, 'db') ): | dblib = [] if self.compiler.find_library_file(lib_dirs, 'db'): dblib = ['db'] db185_incs = find_file('db_185.h', inc_dirs, ['/usr/include/db3', '/usr/include/db2']) db_inc = find_file('db.h', inc_dirs, ['/usr/include/db1']) if db185_incs is not None: | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | e06337a9285ce50ba86dd7dff27df0b56905a8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e06337a9285ce50ba86dd7dff27df0b56905a8b0/setup.py |
include_dirs = db_incs, libraries = ['db'] ) ) else: db_incs = find_file('db.h', inc_dirs, []) if db_incs is not None: exts.append( Extension('bsddb', ['bsddbmodule.c'], include_dirs = db_incs) ) | include_dirs = db185_incs, define_macros=[('HAVE_DB_185_H',1)], libraries = dblib ) ) elif db_inc is not None: exts.append( Extension('bsddb', ['bsddbmodule.c'], include_dirs = db_inc, libraries = dblib) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | e06337a9285ce50ba86dd7dff27df0b56905a8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e06337a9285ce50ba86dd7dff27df0b56905a8b0/setup.py |
self.in_list_item = True | self.in_list_item = 1 | def _indent_formatter(self, match, fullmatch): depth = int((len(fullmatch.group('idepth')) + 1) / 2) list_depth = len(self._list_stack) if list_depth > 0 and depth == list_depth + 1: self.in_list_item = True else: self.open_indentation(depth) return '' | 4414ffb97450b23b1fd6508603724203f67ac289 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4414ffb97450b23b1fd6508603724203f67ac289/WikiFormatter.py |
self.send_header('ETag', etag) return self.send_response(304) self.end_headers() raise NotModifiedException() | self._headers.append(('ETag', etag)) else: self.send_response(304) self.end_headers() raise NotModifiedException() | def check_modified(self, timesecs, extra=''): etag = 'W"%s/%d/%s"' % (self.authname, timesecs, extra) inm = self.get_header('If-None-Match') if (not inm or inm != etag): self.send_header('ETag', etag) return self.send_response(304) self.end_headers() raise NotModifiedException() | 2af6cce938242e4dcf8a1e947d4a0ce7dd42dd05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2af6cce938242e4dcf8a1e947d4a0ce7dd42dd05/core.py |
options = field.get('options', []) if default and default not in field.get('options', []): | options = field.get('options') if default and options and default not in options: | def _init_defaults(self, db=None): for field in self.fields: default = None if not field.get('custom'): default = self.env.config.get('ticket', 'default_' + field['name']) else: default = field.get('value') options = field.get('options', []) if default and default not in field.get('options', []): try: default_idx = int... | 321b4d73402e6e4cc4485e71a29eeaa478fee158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/321b4d73402e6e4cc4485e71a29eeaa478fee158/model.py |
"""Check the request "If-None-Match" header against an entity tag generated from the specified last modified time in seconds (`timesecs`), optionally appending an `extra` string to indicate variants of the requested resource. That `extra` parameter can also be a list, in which case the MD5 sum of the list content will ... | """Check the request "If-None-Match" header against an entity tag. The entity tag is generated from the specified last modified time in seconds (`timesecs`), optionally appending an `extra` string to indicate variants of the requested resource. That `extra` parameter can also be a list, in which case the MD5 sum of t... | def check_modified(self, timesecs, extra=''): """Check the request "If-None-Match" header against an entity tag generated from the specified last modified time in seconds (`timesecs`), optionally appending an `extra` string to indicate variants of the requested resource. That `extra` parameter can also be a list, in wh... | 906cc78e5c6aa84099039f5fd08e2cbbbfa343e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/906cc78e5c6aa84099039f5fd08e2cbbbfa343e0/api.py |
Otherwise, it adds the entity tag as as "ETag" header to the response so that consequetive requests can be cached. | Otherwise, it adds the entity tag as an "ETag" header to the response so that consecutive requests can be cached. | def check_modified(self, timesecs, extra=''): """Check the request "If-None-Match" header against an entity tag generated from the specified last modified time in seconds (`timesecs`), optionally appending an `extra` string to indicate variants of the requested resource. That `extra` parameter can also be a list, in wh... | 906cc78e5c6aa84099039f5fd08e2cbbbfa343e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/906cc78e5c6aa84099039f5fd08e2cbbbfa343e0/api.py |
'value': field['value'] | 'value': value | def insert_custom_fields(env, hdf, vals={}): for idx, field in util.enum(TicketSystem(env).get_custom_fields()): name = field['name'] value = vals.get('custom_' + name, field['value']) prefix = 'ticket.custom.%d' % idx hdf[prefix] = { 'name': field['name'], 'type': field['type'], 'label': field['label'] or field['name'... | bb7ec9b4be98190ff31ee84afde51546cf4eb4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bb7ec9b4be98190ff31ee84afde51546cf4eb4b2/web_ui.py |
from optparse import OptionParser | from optparse import OptionParser, OptionValueError | def main(): from optparse import OptionParser parser = OptionParser(usage='usage: %prog [options] [projenv] ...', version='%%prog %s' % __version__) auths = {} def _auth_callback(option, opt_str, value, parser, auths, cls): info = value.split(',', 3) if len(info) != 3: usage() env_name, filename, realm = info if env_n... | dc34bc3151c7905c94fd6e4e13dd2b05f7116c62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/dc34bc3151c7905c94fd6e4e13dd2b05f7116c62/standalone.py |
usage() | raise OptionValueError("Incorrect number of parameters for %s" % option) usage() | def _auth_callback(option, opt_str, value, parser, auths, cls): info = value.split(',', 3) if len(info) != 3: usage() env_name, filename, realm = info if env_name in auths: print >>sys.stderr, 'Ignoring duplicate authentication option for ' \ 'project: %s' % env_name else: auths[env_name] = cls(filename, realm) | dc34bc3151c7905c94fd6e4e13dd2b05f7116c62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/dc34bc3151c7905c94fd6e4e13dd2b05f7116c62/standalone.py |
if os.name == 'posix' and options.daemonize: daemon.daemonize() | if os.name == 'posix': if options.pidfile: options.pidfile = os.path.abspath(options.pidfile) if os.path.exists(options.pidfile): pidfile = open(options.pidfile) try: pid = int(pidfile.read()) finally: pidfile.close() try: os.kill(pid, 0) except OSError, e: if e.errno != errno.ESRCH: raise else: sys.exit("tracd is al... | def serve(): server_cls = __import__('flup.server.%s' % options.protocol, None, None, ['']).WSGIServer ret = server_cls(wsgi_app, bindAddress=server_address).run() sys.exit(ret and 42 or 0) # if SIGHUP exit with status 42 | 3429d3818a8c73f1f150ad00c7b73a7112f990d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3429d3818a8c73f1f150ad00c7b73a7112f990d8/standalone.py |
old = self.db_query("SELECT text FROM wiki WHERE name='%s' " "ORDER BY version DESC LIMIT 1" % title, cursor) | rows = self.db_query("SELECT text FROM wiki WHERE name='%s' " "ORDER BY version DESC LIMIT 1" % title, cursor) old = list(rows) | def _do_wiki_import(self, filename, title, cursor=None): if not os.path.isfile(filename): print "%s is not a file" % filename return f = open(filename,'r') data = util.to_utf8(f.read()) | 44cc2f3d23461aedec41ea2677267e27765e70f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/44cc2f3d23461aedec41ea2677267e27765e70f9/admin.py |
logfile = os.path.join(self.get_log_dir(), logfile) | if not os.path.isabs(logfile): logfile = os.path.join(self.get_log_dir(), logfile) | def setup_log(self): """Initialize the logging sub-system.""" from trac.log import logger_factory logtype = self.config.get('logging', 'log_type') loglevel = self.config.get('logging', 'log_level') logfile = self.config.get('logging', 'log_file') logfile = os.path.join(self.get_log_dir(), logfile) logid = self.path # E... | eb24c1d41ca17f27f45f92ec35ea17edd972324b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/eb24c1d41ca17f27f45f92ec35ea17edd972324b/env.py |
icalhref = '?format=ics' | icalhref = '?format=ics' | def render(self, req): self.perm.assert_permission(perm.ROADMAP_VIEW) req.hdf.setValue('title', 'Roadmap') | 31e6c8840e7a5ba1af258cce35576951eb94a541 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/31e6c8840e7a5ba1af258cce35576951eb94a541/Roadmap.py |
if milestone.has_key('date'): | if milestone.has_key('due'): | def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params) | 31e6c8840e7a5ba1af258cce35576951eb94a541 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/31e6c8840e7a5ba1af258cce35576951eb94a541/Roadmap.py |
if milestone.has_key('date'): write_date('DTSTART', localtime(milestone['due'])) | write_date('DTSTART', localtime(milestone['due'])) | def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params) | 31e6c8840e7a5ba1af258cce35576951eb94a541 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/31e6c8840e7a5ba1af258cce35576951eb94a541/Roadmap.py |
req.hdf['%s.real' % prefix] = col[0] | req.hdf['%s.real' % prefix] = col | 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... | a76d9194077f777eb0da363472df67e2af0b2947 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a76d9194077f777eb0da363472df67e2af0b2947/report.py |
while req.hdf.get('links.%s.%d.href' % (rel, idx)): | while req.hdf.get('chrome.links.%s.%d.href' % (rel, idx)): | def add_link(req, rel, href, title=None, type=None, class_name=None): link = {'href': escape(href)} if title: link['title'] = escape(title) if type: link['type'] = type if class_name: link['class'] = class_name idx = 0 while req.hdf.get('links.%s.%d.href' % (rel, idx)): idx += 1 req.hdf['links.%s.%d' % (rel, idx)] = li... | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
req.hdf['links.%s.%d' % (rel, idx)] = link | req.hdf['chrome.links.%s.%d' % (rel, idx)] = link | def add_link(req, rel, href, title=None, type=None, class_name=None): link = {'href': escape(href)} if title: link['title'] = escape(title) if type: link['type'] = type if class_name: link['class'] = class_name idx = 0 while req.hdf.get('links.%s.%d.href' % (rel, idx)): idx += 1 req.hdf['links.%s.%d' % (rel, idx)] = li... | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
if not logo_src[0] == '/' and not logo_src_abs: | if not logo_src.startswith('/') and not logo_src_abs: | def populate_hdf(self, req, handler): """ Add chrome-related data to the HDF. """ | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
req.hdf['header_logo'] = { | req.hdf['chrome.logo'] = { | def populate_hdf(self, req, handler): """ Add chrome-related data to the HDF. """ | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
req.hdf['chrome.%s.%s' % (category, name)] = text | req.hdf['chrome.nav.%s.%s' % (category, name)] = text | def populate_hdf(self, req, handler): """ Add chrome-related data to the HDF. """ | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
req.hdf['chrome.%s.%s.active' % (category, name)] = 1 | req.hdf['chrome.nav.%s.%s.active' % (category, name)] = 1 | def populate_hdf(self, req, handler): """ Add chrome-related data to the HDF. """ | 97f28a5f59785b14feb1dcd067fe5544ba0b71b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f28a5f59785b14feb1dcd067fe5544ba0b71b0/chrome.py |
module, id = req.hdf['HTTP.PathInfo'].split('/', 3)[1:] | module, id = 'wiki', 'WikiStart' path_info = req.path_info.split('/',2) if len(path_info) > 1: module = path_info[1] if len(path_info) > 2: id = path_info[2] | def render_macro(self, req, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args[0] size_re = re.co... | f4e41101296b8282dcf97c9f5631d38597459b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f4e41101296b8282dcf97c9f5631d38597459b59/macros.py |
'order': 0, 'optional': False}, | 'order': 0}, | def test_custom_field_select(self): self.env.config.set('ticket-custom', 'test', 'select') self.env.config.set('ticket-custom', 'test.label', 'Test') self.env.config.set('ticket-custom', 'test.value', '1') self.env.config.set('ticket-custom', 'test.options', 'option1|option2') fields = TicketSystem(self.env).get_custom... | b23c1b24aa99abd3abeca3890de1b991b3d0fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b23c1b24aa99abd3abeca3890de1b991b3d0fd5a/api.py |
'value': '1', 'options': ['', 'option1', 'option2'], | 'value': '1', 'options': ['option1', 'option2'], | def test_custom_field_optional_select(self): self.env.config.set('ticket-custom', 'test', 'select') self.env.config.set('ticket-custom', 'test.label', 'Test') self.env.config.set('ticket-custom', 'test.value', '1') self.env.config.set('ticket-custom', 'test.options', '|option1|option2') fields = TicketSystem(self.env).... | b23c1b24aa99abd3abeca3890de1b991b3d0fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b23c1b24aa99abd3abeca3890de1b991b3d0fd5a/api.py |
Generator that produces a (path, kind, change, base_rev, base_path) | Generator that produces a (path, kind, change, base_path, base_rev) | def get_changes(self): """ Generator that produces a (path, kind, change, base_rev, base_path) tuple for every change in the changeset, where change can be one of Changeset.ADD, Changeset.COPY, Changeset.DELETE, Changeset.EDIT or Changeset.MOVE, and kind is one of Node.FILE or Node.DIRECTORY. """ raise NotImplementedEr... | 3d7970248ecb760a2690fbe49562be5277616118 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3d7970248ecb760a2690fbe49562be5277616118/api.py |
milestone = Milestone(self.env, req.args.get('id'), db) | milestone = Milestone(self.env, milestone_id, db) | def process_request(self, req): req.perm.assert_permission('MILESTONE_VIEW') | 435f44068b47c0f7bde76aa8076706ab8fa919d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/435f44068b47c0f7bde76aa8076706ab8fa919d2/roadmap.py |
xlist = ['summary', 'description', 'link', 'comment'] | xlist = ['summary', 'description', 'link', 'comment', 'new'] | def _validate_mimebody(self, mime, ticket, newtk): """Validate the body of a ticket notification message""" (mime_decoder, mime_name, mime_charset) = mime tn = TicketNotifyEmail(self.env) tn.notify(ticket, newticket=newtk) message = notifysuite.smtpd.get_message() (headers, body) = parse_smtp_message(message) self.fail... | 8adeb545093184ff70333c9a00dd0473e01426df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8adeb545093184ff70333c9a00dd0473e01426df/notification.py |
q.append('SELECT 2 as type, summary AS title, ' ' description AS message, reporter AS author, keywords,' ' id AS data, time,0 AS ver' ' FROM ticket WHERE %s OR %s OR %s OR %s OR %s' % (self.query_to_sql(query, 'summary'), | q.append('SELECT DISTINCT 2 as type, a.summary AS title, ' ' a.description AS message, a.reporter AS author, a.keywords as keywords,' ' a.id AS data, a.time as time, 0 AS ver' ' FROM ticket a LEFT JOIN ticket_change b ON a.id = b.ticket' ' WHERE (b.field=\'comment\' AND %s ) OR' ' %s OR %s OR %s OR %s OR %s' % (self.qu... | def perform_query (self, query, changeset, tickets, wiki, page=0): keywords = query.split(' ') | b6e5c7c3f923b426c893284b757311fef3461c79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6e5c7c3f923b426c893284b757311fef3461c79/Search.py |
q.append('SELECT 2 as type, a.summary AS title, ' ' b.newvalue AS message, a.reporter AS author,' ' a.keywords as keywords,' ' a.id AS data, a.time AS time,0 AS ver' ' FROM ticket a, ticket_change b' ' WHERE a.id = b.ticket AND b.field=\'comment\' AND %s' % (self.query_to_sql(query, 'b.newvalue'))) | def perform_query (self, query, changeset, tickets, wiki, page=0): keywords = query.split(' ') | b6e5c7c3f923b426c893284b757311fef3461c79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6e5c7c3f923b426c893284b757311fef3461c79/Search.py | |
q_str += ' ORDER BY time DESC LIMIT %d OFFSET %d' % \ | q_str += ' ORDER BY 7 DESC LIMIT %d OFFSET %d' % \ | def perform_query (self, query, changeset, tickets, wiki, page=0): keywords = query.split(' ') | b6e5c7c3f923b426c893284b757311fef3461c79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b6e5c7c3f923b426c893284b757311fef3461c79/Search.py |
for f in os.listdir(trac.siteconfig.__default_macro_dir__): | for f in os.listdir(trac.siteconfig.__default_macros_dir__): | def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name = returnvals[0] rep... | 7e1ab333e2e97763a8002ec82ef6a02a4dca5791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e1ab333e2e97763a8002ec82ef6a02a4dca5791/admin.py |
src = os.path.join(trac.siteconfig.__default_macro_dir__, f) | src = os.path.join(trac.siteconfig.__default_macros_dir__, f) | def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name = returnvals[0] rep... | 7e1ab333e2e97763a8002ec82ef6a02a4dca5791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7e1ab333e2e97763a8002ec82ef6a02a4dca5791/admin.py |
default_idx = int(default) if default_idx > len(options): raise ValueError default = options[default_idx] except ValueError: self.env.log.warning('Invalid default value for ' 'custom field "%s"' % field['name']) | default = options[int(default)] except (ValueError, IndexError): self.env.log.warning('Invalid default value "%s" ' 'for custom field "%s"' % (default, field['name'])) | def _init_defaults(self, db=None): for field in self.fields: default = None if not field.get('custom'): default = self.env.config.get('ticket', 'default_' + field['name']) else: default = field.get('value') options = field.get('options') if default and options and default not in options: try: default_idx = int(default)... | dae5a769454400bb55b47d1ca03ea78ad9378170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/dae5a769454400bb55b47d1ca03ea78ad9378170/model.py |
break | try: cnx.cursor() break except Exception: cnx.close() | def get_cnx(self, timeout=None): start = time.time() self._available.acquire() try: tid = threading._get_ident() if tid in self._active: self._active[tid][0] += 1 return PooledConnection(self, self._active[tid][1]) while True: if self._dormant: cnx = self._dormant.pop() break elif self._maxsize and self._cursize < self... | a59364df2f44ddde98966688922ce7085852c6f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a59364df2f44ddde98966688922ce7085852c6f7/pool.py |
for line in difflines: if line.startswith('--- '): words = line.split(None, 2) filename, fromrev = words[1], 'old' groups, blocks = None, None | lines = iter(difflines) for line in lines: if not line.startswith('--- '): | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
if line.startswith('+++ '): words = line.split(None, 2) if len(words[1]) < len(filename): filename = words[1] groups = [] output.append({'filename' : filename, 'oldrev' : fromrev, 'newrev' : 'new', 'diff' : groups}) continue if line.startswith('Index: ') or line.startswith('======') or line == '': continue if groups... | words = line.split(None, 2) filename, fromrev = words[1], 'old' groups, blocks = None, None line = lines.next() if not line.startswith('+++ '): | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
if line.startswith('@@ '): r = re.match(r'@@ -(\d+),\d+ \+(\d+),\d+ @@', line) | words = line.split(None, 2) if len(words[1]) < len(filename): filename = words[1] groups = [] output.append({'filename' : filename, 'oldrev' : fromrev, 'newrev' : 'new', 'diff' : groups}) for line in lines: r = re.match(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@', line) | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
return None | break | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
fromline,toline = map(int, r.groups()) | fromline,fromend,toline,toend = map(int, r.groups()) | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
continue if blocks == None: return None | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py | |
command, line = line[0], line[1:] | fromend += fromline toend += toline | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
if (command == ' ') != last_type: last_type = command == ' ' blocks.append({'type': last_type and 'unmod' or 'mod', 'base.offset': fromline - 1, 'base.lines': [], 'changed.offset': toline - 1, 'changed.lines': []}) if command == ' ': blocks[-1]['changed.lines'].append(line) blocks[-1]['base.lines'].append(line) fromli... | while fromline < fromend or toline < toend: line = lines.next() command, line = line[0], line[1:] if (command == ' ') != last_type: last_type = command == ' ' blocks.append({'type': last_type and 'unmod' or 'mod', 'base.offset': fromline - 1, 'base.lines': [], 'changed.offset': toline - 1, 'changed.lines': []}) if c... | def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * ' ' + mod * ' ' | 81b657b816d8b094d2886fe500c5decefefc5342 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/81b657b816d8b094d2886fe500c5decefefc5342/patch.py |
pass | version = None | def _insert_ticket_data(self, req, db, ticket, data, reporter_id): """Insert ticket data into the hdf""" replyto = req.args.get('replyto') version = req.args.get('version', None) data['replyto'] = replyto if version: try: version = int(version) data['version'] = version except ValueError: pass | 25a83acacd059223a07e67b59ac2c5a4e9520aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/25a83acacd059223a07e67b59ac2c5a4e9520aa7/web_ui.py |
if version is not None and cnum > version: for k, v in change['fields'].iteritems(): if k not in values: values[k] = v['old'] continue changes.append(change) | def quote_original(author, original, link): if 'comment' not in req.args: # i.e. the comment was not yet edited data['comment'] = '\n'.join( ['Replying to [%s %s]:' % (link, author)] + ['> %s' % line for line in original.splitlines()] + ['']) | 25a83acacd059223a07e67b59ac2c5a4e9520aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/25a83acacd059223a07e67b59ac2c5a4e9520aa7/web_ui.py | |
if 'replyto' in change: replies.setdefault(change['replyto'], []).append(cnum) comment = '' if replyto == str(cnum): quote_original(change['author'], comment, 'comment:%s' % replyto) if version: | if version is not None and cnum > version: | def quote_original(author, original, link): if 'comment' not in req.args: # i.e. the comment was not yet edited data['comment'] = '\n'.join( ['Replying to [%s %s]:' % (link, author)] + ['> %s' % line for line in original.splitlines()] + ['']) | 25a83acacd059223a07e67b59ac2c5a4e9520aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/25a83acacd059223a07e67b59ac2c5a4e9520aa7/web_ui.py |
values[k] = v['new'] if 'description' in change['fields']: data['description_change'] = change | if k not in values: values[k] = v['old'] skip = True else: if 'replyto' in change: replies.setdefault(change['replyto'], []).append(cnum) comment = '' if replyto == str(cnum): quote_original(change['author'], comment, 'comment:%s' % replyto) if version: for k, v in change['fields'].iteritems(): values[k] = v['new'] ... | def quote_original(author, original, link): if 'comment' not in req.args: # i.e. the comment was not yet edited data['comment'] = '\n'.join( ['Replying to [%s %s]:' % (link, author)] + ['> %s' % line for line in original.splitlines()] + ['']) | 25a83acacd059223a07e67b59ac2c5a4e9520aa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/25a83acacd059223a07e67b59ac2c5a4e9520aa7/web_ui.py |
if not row: raise TracError('Report %d does not exist.' % id, | try: if not row: raise TracError('Report %d does not exist.' % id, | def get_info(self, id, args): cursor = self.db.cursor() | 492b2ab83de258eaaa4c56c6a8ccb4a69e2ae57e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/492b2ab83de258eaaa4c56c6a8ccb4a69e2ae57e/Report.py |
title = row[0] try: | title = row[0] | def get_info(self, id, args): cursor = self.db.cursor() | 492b2ab83de258eaaa4c56c6a8ccb4a69e2ae57e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/492b2ab83de258eaaa4c56c6a8ccb4a69e2ae57e/Report.py |
if path.startswith(self.scope): | if rev > 0 and path.startswith(self.scope): | def get_history(self): history = _get_history(self.scope + self.path, self.authz, self.fs_ptr, self.pool, self.rev) for path, rev in history: if path.startswith(self.scope): yield path[len(self.scope):], rev | be5729e969e69fa7555860360e34c03711d8cd1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/be5729e969e69fa7555860360e34c03711d8cd1f/svn_fs.py |
title = Markup('Ticket <em title="%s"> summary, id, type, verb, author) | if format == 'rss': title = 'Ticket (id, type.lower(), verb, summary) else: title = Markup('Ticket <em title="%s"> summary, id, type, verb, author) | def produce((id, t, author, type, summary), status, fields, comment, cid): if status == 'edit': if 'ticket_details' in filters: info = '' if len(fields) > 0: info = ', '.join(['<i>%s</i>' % f for f in \ fields.keys()]) + ' changed<br />' else: return None elif 'ticket' in filters: if status == 'closed' and fields.has_k... | 7356b09985ee21df80d7dceca9c158115a3eb6d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7356b09985ee21df80d7dceca9c158115a3eb6d0/web_ui.py |
defaults = {} for section, options in self.env.get_default_config().iteritems(): defaults[section] = default_options = {} for opt in options: default_options[opt.name] = opt.default | def _render_config(self, req): req.perm.assert_permission('CONFIG_VIEW') req.hdf['about.page'] = 'config' # Gather default values defaults = {} for section, options in self.env.get_default_config().iteritems(): defaults[section] = default_options = {} for opt in options: default_options[opt.name] = opt.default # Expor... | 5d09296f2bf19c6ff50e7748cf2e11102e0398f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d09296f2bf19c6ff50e7748cf2e11102e0398f1/About.py | |
default_options = defaults.get(section) | default_options = self.config.getdefaults().get(section) | def _render_config(self, req): req.perm.assert_permission('CONFIG_VIEW') req.hdf['about.page'] = 'config' # Gather default values defaults = {} for section, options in self.env.get_default_config().iteritems(): defaults[section] = default_options = {} for opt in options: default_options[opt.name] = opt.default # Expor... | 5d09296f2bf19c6ff50e7748cf2e11102e0398f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d09296f2bf19c6ff50e7748cf2e11102e0398f1/About.py |
options.append({'name': name, 'value': value, 'valueclass': (value == default and \ 'defaultvalue' or 'value')}) | options.append({ 'name': name, 'value': value, 'valueclass': (unicode(value) == unicode(default) and 'defaultvalue' or 'value')}) | def _render_config(self, req): req.perm.assert_permission('CONFIG_VIEW') req.hdf['about.page'] = 'config' # Gather default values defaults = {} for section, options in self.env.get_default_config().iteritems(): defaults[section] = default_options = {} for opt in options: default_options[opt.name] = opt.default # Expor... | 5d09296f2bf19c6ff50e7748cf2e11102e0398f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5d09296f2bf19c6ff50e7748cf2e11102e0398f1/About.py |
self.path = path | self.path = path | def __init__(self, path, authz, log): self.path = path self.log = log if core.SVN_VER_MAJOR < 1: raise TracError("Subversion >= 1.0 required: Found %d.%d.%d" % \ (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO)) self.pool = Pool() # Remove any trailing slash or else subversion might abort path = os.path.no... | 1e7fbc587c7afba5631f3ae6002cef1e3992ec11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/1e7fbc587c7afba5631f3ae6002cef1e3992ec11/svn_fs.py |
self._execute('severity change critical end-of-the-world') | self._execute('severity change critical "end-of-the-world"') | def test_severity_change_ok(self): """ Tests the 'severity add' command in trac-admin. This particular test passes valid arguments and checks for success. """ test_name = sys._getframe().f_code.co_name self._execute('severity add critical') self._execute('severity change critical end-of-the-world') test_results = self... | af34672c99198d72bd8a714bfe91d1ead16e70dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/af34672c99198d72bd8a714bfe91d1ead16e70dc/admin.py |
return self.default | return self.default(component.env) | def implementation(self, component): cfgvalue = component.config.get(self.cfg_section, self.cfg_property) for impl in self.xtnpt.extensions(component): if impl.__class__.__name__ == cfgvalue: return impl if self.default is not None: return self.default raise AttributeError('Cannot find an implementation of the "%s" ' '... | 8fde65a86a1b2278e4080c5222c27a0eb6df791b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8fde65a86a1b2278e4080c5222c27a0eb6df791b/core.py |
time = int(t or time.time()) self.date = datetime.fromtimestamp(time, utc) | timestamp = int(t or time.time()) self.date = datetime.fromtimestamp(timestamp, utc) | def insert(self, filename, fileobj, size, t=None, db=None): # FIXME: `t` should probably be switched to `datetime` too if not db: db = self.env.get_db_cnx() handle_ta = True else: handle_ta = False | 29a9ed0865c900850ccdf96878a1c351093bffe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/29a9ed0865c900850ccdf96878a1c351093bffe6/attachment.py |
self.size, time, self.description, self.author, self.ipnr)) | self.size, timestamp, self.description, self.author, self.ipnr)) | def insert(self, filename, fileobj, size, t=None, db=None): # FIXME: `t` should probably be switched to `datetime` too if not db: db = self.env.get_db_cnx() handle_ta = True else: handle_ta = False | 29a9ed0865c900850ccdf96878a1c351093bffe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/29a9ed0865c900850ccdf96878a1c351093bffe6/attachment.py |
def get_ticket (self, id): | def get_ticket (self, id, escape_values=1): | def get_ticket (self, id): global fields cnx = db.get_connection () cursor = cnx.cursor () | 8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f/Ticket.py |
info[fields[i]] = escape(row[i]) | info[fields[i]] = row[i] | def get_ticket (self, id): global fields cnx = db.get_connection () cursor = cnx.cursor () | 8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f/Ticket.py |
hdf.setValue('ticket.changes.%d.author' % idx, author) hdf.setValue('ticket.changes.%d.field' % idx, field) | hdf.setValue('ticket.changes.%d.time' % idx, str(date)) hdf.setValue('ticket.changes.%d.author' % idx, author) hdf.setValue('ticket.changes.%d.field' % idx, field) | def insert_ticket_data(self, hdf, id): """Inserts ticket data into the hdf""" cnx = db.get_connection () cursor = cnx.cursor() cursor.execute('SELECT time, author, field, oldvalue, newvalue ' 'FROM ticket_change ' 'WHERE ticket=%s ORDER BY time', id) curr_author = None curr_date = 0 comment = None idx = 0 | 8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f/Ticket.py |
old = self.get_ticket(id) | old = self.get_ticket(id, 0) | def render (self): action = dict_get_with_default(self.args, 'action', 'view') if action == 'create': self.create_ticket () try: id = int(self.args['id']) except: redirect (href.menu()) | 8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f/Ticket.py |
class BasicAuthentication(HTTPAuthentication): | class PasswordFileAuthentication(HTTPAuthentication): def __init__(self, filename): self.filename = filename self.mtime = os.stat(filename).st_mtime self.load(self.filename) self._lock = threading.Lock() def check_reload(self): self._lock.acquire() try: mtime = os.stat(self.filename).st_mtime if mtime > self.mtime: se... | def do_auth(self, environ, start_response): raise NotImplementedError | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
self.hash = {} | def __init__(self, htpasswd, realm): self.hash = {} self.realm = realm try: import crypt self.crypt = crypt.crypt except ImportError: self.crypt = None self.load(htpasswd) | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py | |
self.load(htpasswd) | PasswordFileAuthentication.__init__(self, htpasswd) | def __init__(self, htpasswd, realm): self.hash = {} self.realm = realm try: import crypt self.crypt = crypt.crypt except ImportError: self.crypt = None self.load(htpasswd) | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
class DigestAuthentication(HTTPAuthentication): | class DigestAuthentication(PasswordFileAuthentication): | def do_auth(self, environ, start_response): header = environ.get('HTTP_AUTHORIZATION') if header and header.startswith('Basic'): auth = b64decode(header[6:]).split(':') if len(auth) == 2: user, password = auth if self.test(user, password): return user | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
self.hash = {} | def __init__(self, htdigest, realm): self.active_nonces = [] self.hash = {} self.realm = realm self.load_htdigest(htdigest, realm) | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py | |
self.load_htdigest(htdigest, realm) def load_htdigest(self, filename, realm): | PasswordFileAuthentication.__init__(self, htdigest) def load(self, filename): | def __init__(self, htdigest, realm): self.active_nonces = [] self.hash = {} self.realm = realm self.load_htdigest(htdigest, realm) | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
if r == realm: | if r == self.realm: | def load_htdigest(self, filename, realm): """Load account information from apache style htdigest files, only users from the specified realm are used """ fd = open(filename, 'r') for line in fd.readlines(): line = line.strip() if not line: continue try: u, r, a1 = line.split(':') except ValueError: print >>sys.stderr, '... | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
print >> sys.stderr, "Warning: found no users in realm:", realm | print >> sys.stderr, "Warning: found no users in realm:", self.realm | def load_htdigest(self, filename, realm): """Load account information from apache style htdigest files, only users from the specified realm are used """ fd = open(filename, 'r') for line in fd.readlines(): line = line.strip() if not line: continue try: u, r, a1 = line.split(':') except ValueError: print >>sys.stderr, '... | c763c03a734eb2f621130258e8329c20e5c8d194 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c763c03a734eb2f621130258e8329c20e5c8d194/auth.py |
fd = None | fd = open(os.path.join(self.path, 'VERSION'), 'r') | def verify(self): """Verify that the provided path points to a valid Trac environment directory.""" fd = None try: fd = open(os.path.join(self.path, 'VERSION'), 'r') assert fd.read(26) == 'Trac Environment Version 1' finally: if fd: fd.close() | 0546711392cb077bb975f25d209fd308cc3b641b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0546711392cb077bb975f25d209fd308cc3b641b/env.py |
fd = open(os.path.join(self.path, 'VERSION'), 'r') | def verify(self): """Verify that the provided path points to a valid Trac environment directory.""" fd = None try: fd = open(os.path.join(self.path, 'VERSION'), 'r') assert fd.read(26) == 'Trac Environment Version 1' finally: if fd: fd.close() | 0546711392cb077bb975f25d209fd308cc3b641b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0546711392cb077bb975f25d209fd308cc3b641b/env.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.