rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def __init__(self, action_name='_action_'):
def __init__(self, action_name='_action_', default_action=None):
def __init__(self, action_name='_action_'): self.action_name = action_name
0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py
def find_method(self, servlet, ret_value):
def find_method(self, servlet, ret_value, **kw):
def find_method(self, servlet, ret_value): possible_actions = [] for name, value in servlet.fields.items(): if name == self.action_name: possible_actions.append(value) elif name.startswith(self.action_name): possible_actions.append(name[len(self.action_name):]) if not possible_actions: return event.Continue if len(poss...
0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py
return event.Continue
if self.default_action: possible_actions = [self.default_action] else: return event.Continue
def find_method(self, servlet, ret_value): possible_actions = [] for name, value in servlet.fields.items(): if name == self.action_name: possible_actions.append(value) elif name.startswith(self.action_name): possible_actions.append(name[len(self.action_name):]) if not possible_actions: return event.Continue if len(poss...
0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py
raise httpexceptions.Forbidden(
raise httpexceptions.HTTPForbidden(
def find_method(self, servlet, ret_value): possible_actions = [] for name, value in servlet.fields.items(): if name == self.action_name: possible_actions.append(value) elif name.startswith(self.action_name): possible_actions.append(name[len(self.action_name):]) if not possible_actions: return event.Continue if len(poss...
0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py
raise httpexceptions.Forbidden(
raise httpexceptions.HTTPForbidden(
def find_method(self, servlet, ret_value): possible_actions = [] for name, value in servlet.fields.items(): if name == self.action_name: possible_actions.append(value) elif name.startswith(self.action_name): possible_actions.append(name[len(self.action_name):]) if not possible_actions: return event.Continue if len(poss...
0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py
assert self.prefix, "must set prefix"
assert self.prefix is not None, "must set prefix"
def __init__(self, *args, **kwargs): assert self.app_obj, "must set app_obj" assert self.prefix, "must set prefix" args = (self,) + args scgi_server.SCGIHandler.__init__(*args, **kwargs)
ac989ce2483572006f6658414e691fecba468094 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ac989ce2483572006f6658414e691fecba468094/scgiserver.py
include_ip=True):
include_ip=True, logout_path=None):
def __init__(self, app, secret, cookie_name='auth_tkt', secure=False, include_ip=True): self.app = app self.secret = secret self.cookie_name = cookie_name self.secure = secure self.include_ip = include_ip
7d552d2a679e5372695b53e129302c28d07f9227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/7d552d2a679e5372695b53e129302c28d07f9227/auth_tkt.py
secret, cookie, remote_addr)
self.secret, cookie_value, remote_addr)
def __call__(self, environ, start_response): cookies = request.get_cookies(environ) if cookies.has_key(self.cookie_name): cookie_value = cookies[self.cookie_name].value else: cookie_value = '' if cookie_value: if self.include_ip: remote_addr = environ['REMOTE_ADDR'] else: # mod_auth_tkt uses this dummy value when IP is...
7d552d2a679e5372695b53e129302c28d07f9227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/7d552d2a679e5372695b53e129302c28d07f9227/auth_tkt.py
if not rep_err:
if rep_err:
def handle_exception(exc_info, conf, error_stream, html=True): """ You can also use exception handling outside of a web context, like:: import sys import paste import paste.error_middleware try: do stuff except: paste.error_middleware.exception_handler( sys.exc_info(), paste.CONFIG, sys.stderr, html=False) If you wan...
edfa568c3c0d14678c4445912ce23b14afdb4c21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edfa568c3c0d14678c4445912ce23b14afdb4c21/errormiddleware.py
if not rep_err:
if rep_err:
def handle_exception(exc_info, conf, error_stream, html=True): """ You can also use exception handling outside of a web context, like:: import sys import paste import paste.error_middleware try: do stuff except: paste.error_middleware.exception_handler( sys.exc_info(), paste.CONFIG, sys.stderr, html=False) If you wan...
edfa568c3c0d14678c4445912ce23b14afdb4c21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edfa568c3c0d14678c4445912ce23b14afdb4c21/errormiddleware.py
reported = True if conf.get('show_exceptions_in_error_log', True):
else: reported = True if conf.get('show_exceptions_in_error_log', False):
def handle_exception(exc_info, conf, error_stream, html=True): """ You can also use exception handling outside of a web context, like:: import sys import paste import paste.error_middleware try: do stuff except: paste.error_middleware.exception_handler( sys.exc_info(), paste.CONFIG, sys.stderr, html=False) If you wan...
edfa568c3c0d14678c4445912ce23b14afdb4c21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edfa568c3c0d14678c4445912ce23b14afdb4c21/errormiddleware.py
if not rep_err:
if rep_err:
def handle_exception(exc_info, conf, error_stream, html=True): """ You can also use exception handling outside of a web context, like:: import sys import paste import paste.error_middleware try: do stuff except: paste.error_middleware.exception_handler( sys.exc_info(), paste.CONFIG, sys.stderr, html=False) If you wan...
edfa568c3c0d14678c4445912ce23b14afdb4c21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edfa568c3c0d14678c4445912ce23b14afdb4c21/errormiddleware.py
""" Parses the request, returning a dictionary of the keys.
"""Parses the request, returning a dictionary of the keys.
def parse_formvars(environ, all_as_list=False, include_get_vars=True): """ Parses the request, returning a dictionary of the keys. If ``all_as_list`` is true, then all values will be lists. If not, then only values that show up multiple times will be lists. If ``include_get_vars`` is true and this was a POST request...
049b5949b4f52646f27fc1e52173d17e611502fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/049b5949b4f52646f27fc1e52173d17e611502fd/request.py
""" Reconstructs the URL from the WSGI environment. You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with the keyword arguments.
"""Reconstructs the URL from the WSGI environment. You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with the keyword arguments.
def construct_url(environ, with_query_string=True, with_path_info=True, script_name=None, path_info=None, querystring=None): """ Reconstructs the URL from the WSGI environment. You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with the keyword arguments. """ url = environ['wsgi.url_scheme']+'://' if environ.ge...
049b5949b4f52646f27fc1e52173d17e611502fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/049b5949b4f52646f27fc1e52173d17e611502fd/request.py
"paste.webkit.FakeWebware.MiscUtils"],
"paste.webkit.FakeWebware.MiscUtils", "paste.servers", "paste.servers.scgi_server", "paste.wareweb"],
def get_data_files(path, files = []): l = [] for name in os.listdir(path): if name[0] == ".": continue relpath = os.path.join(path, name) f = os.path.join(BASEDIR, relpath) if os.path.isdir(f): get_data_files(relpath, files) elif os.path.isfile(f): l.append(f) pref = sysconfig.get_python_lib()[len(sysconfig.PREFIX) + 1...
a92ac5ae142d3cac119272ebecfffdd78b32b455 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a92ac5ae142d3cac119272ebecfffdd78b32b455/setup.py
environ['REMOTE_USER_TOKENS'] = tokens
def __call__(self, environ, start_response): cookies = request.get_cookies(environ) if cookies.has_key(self.cookie_name): cookie_value = cookies[self.cookie_name].value else: cookie_value = '' if cookie_value: if self.include_ip: remote_addr = environ['REMOTE_ADDR'] else: # mod_auth_tkt uses this dummy value when IP is...
3bf31acddcbbb78c3506eb19b29c248ca4c51e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3bf31acddcbbb78c3506eb19b29c248ca4c51e55/auth_tkt.py
print "login! %r" % username print request['environ'].keys()
def do_process(self, request): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer
7e89f5cbbada5d86ffc72de4fd2f46eacaa48278 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/7e89f5cbbada5d86ffc72de4fd2f46eacaa48278/open_id.py
print "Set with", request['environ']['paste.auth_tkt.set_user']
def do_process(self, request): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer
7e89f5cbbada5d86ffc72de4fd2f46eacaa48278 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/7e89f5cbbada5d86ffc72de4fd2f46eacaa48278/open_id.py
if end: break
def _parse_action(self): self.action = None for match in self._tag_re.finditer(self.text): end = match.group(1) == '/' tag = match.group(2).lower() if tag != 'form': continue attrs = _parse_attrs(match.group(3)) self.action = attrs.get('action', '') self.method = attrs.get('method', 'GET') self.id = attrs.get('id') # @...
94dc1f0a1f4c618a1abbc8aee6a8ce523ec8be4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/94dc1f0a1f4c618a1abbc8aee6a8ce523ec8be4d/fixture.py
return -len(url), '\xff'
return '\xff', -len(url)
def key(app_desc): (domain, url), app = app_desc if not domain: # Make sure empty domains sort last: return -len(url), '\xff' else: return -len(url), domain
3ebd1641a58600b040ffae538f3c2bb1d68df3d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3ebd1641a58600b040ffae538f3c2bb1d68df3d5/urlmap.py
return -len(url), domain
return domain, -len(url)
def key(app_desc): (domain, url), app = app_desc if not domain: # Make sure empty domains sort last: return -len(url), '\xff' else: return -len(url), domain
3ebd1641a58600b040ffae538f3c2bb1d68df3d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3ebd1641a58600b040ffae538f3c2bb1d68df3d5/urlmap.py
if type(app_iter) in (list, tuple): reg.cleanup() return app_iter else: new_app_iter = wsgilib.add_close(app_iter, reg.cleanup) return new_app_iter
reg.cleanup() return app_iter
def __call__(self, environ, start_response): app_iter = None reg = environ.setdefault('paste.registry', Registry()) reg.prepare() try: app_iter = self.application(environ, start_response) finally: if app_iter is None: # An error occurred... reg.cleanup() if type(app_iter) in (list, tuple): # Because it is a concrete it...
ef373cdc7a37ef597c182eb82e7c3b1cd42229ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ef373cdc7a37ef597c182eb82e7c3b1cd42229ca/registry.py
..code-block:: Python
.. code-block:: Python
def capture_output(environ, start_response, application): """ Runs application with environ and start_response, and captures status, headers, and body. Sends status and header, but *not* body. Returns (status, headers, body). Typically this is used like: ..code-block:: Python def dehtmlifying_middleware(applicatio...
a7d4b4b8ce15b601e46304b62998640d484086b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a7d4b4b8ce15b601e46304b62998640d484086b3/wsgilib.py
..code-block:: Python
.. code-block:: Python
def intercept_output(environ, application, conditional=None, start_response=None): """ Runs application with environ and captures status, headers, and body. None are sent on; you must send them on yourself (unlike ``capture_output``) Typically this is used like: ..code-block:: Python def dehtmlifying_middleware(app...
a7d4b4b8ce15b601e46304b62998640d484086b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a7d4b4b8ce15b601e46304b62998640d484086b3/wsgilib.py
..code-block:: Python
.. code-block:: Python
def replacement_app(environ, start_response): status, headers, body = intercept_output( environ, application) content_type = header_value(headers, 'content-type') if (not content_type or not content_type.startswith('text/html')): return [body] body = re.sub(r'<.*?>', '', body) return [body]
a7d4b4b8ce15b601e46304b62998640d484086b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a7d4b4b8ce15b601e46304b62998640d484086b3/wsgilib.py
self.originElev)
self.originElev.value) CSGeo.initialize(self)
def initialize(self): """Initialize coordinate system.""" import spatialdata.geocoords.geocoords as bindings bindings.CppCSGeoLocalCart_origin(self._cppCoordSys, self.originLon, self.originLat, self.originElev)
d6b6fd8fe497cbc72f503145269aa51345faa688 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8643/d6b6fd8fe497cbc72f503145269aa51345faa688/CSGeoLocalCart.py
CSGeo.initialize(self)
def initialize(self): """Initialize coordinate system.""" import spatialdata.geocoords.geocoords as bindings bindings.CppCSGeoLocalCart_origin(self._cppCoordSys, self.originLon, self.originLat, self.originElev)
d6b6fd8fe497cbc72f503145269aa51345faa688 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8643/d6b6fd8fe497cbc72f503145269aa51345faa688/CSGeoLocalCart.py
def __init__(self, name="simpledb"): """Constructor.""" SpatialDB.__init__(self, name) self._cppSpatialDB = bindings.CppSimpleDB() return
d705a81843ea5c6941fc24f9a80519b6c12f0dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8643/d705a81843ea5c6941fc24f9a80519b6c12f0dcc/SimpleDB.py
__id__ = "$Id: SimpleDB.py,v 1.3 2005/03/21 20:25:08 baagaard Exp $"
__id__ = "$Id: SimpleDB.py,v 1.4 2005/03/23 18:09:11 baagaard Exp $"
def __init__(self, name="simpledb"): """Constructor.""" SpatialDB.__init__(self, name) self._cppSpatialDB = bindings.CppSimpleDB() return
d705a81843ea5c6941fc24f9a80519b6c12f0dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8643/d705a81843ea5c6941fc24f9a80519b6c12f0dcc/SimpleDB.py
__id__ = "$Id: GeoCoordSys.py,v 1.1 2005/06/01 23:55:34 baagaard Exp $"
__id__ = "$Id: GeoCoordSys.py,v 1.2 2005/06/02 21:33:39 baagaard Exp $"
def __init__(self, name="geocoordsys"): """Constructor.""" Component.__init__(self, name, facility="geocoordsys")
b4ee8da35b89e23a42b14e05c301b1f268478f21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8643/b4ee8da35b89e23a42b14e05c301b1f268478f21/GeoCoordSys.py
dash_i = relsfx.rfind('-')
dash_i = relsfx.find('-')
def __build_search_suffixes(self): "Construct arch & kernel-versioning search suffixes." ss = set()
77a5c1f9949be4bdf3ebc6fb969debd68a9ebd27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/289/77a5c1f9949be4bdf3ebc6fb969debd68a9ebd27/safety.py
@param mail: an email address sha1sum @type mail: string
@param mail_sha1sum: an email address sha1sum @type mail_sha1sum: string
def getFoafFromSha(self, mail_sha1sum): """ Services to obtain FOAF URI from an email sha1sum @param mail: an email address sha1sum @type mail: string @return: the FOAF URI of this email owner @rtype: string @todo: customize FOAF service """ # TODO: customize this with a real service # # ideas: - PyGoogle <h...
a6c39c3cc5f32283c8323b89d9259286d03897a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/a6c39c3cc5f32283c8323b89d9259286d03897a8/services.py
path = self.config.get('url') + 'index.rdf'
path = self.config.get('dir') + 'index.rdf'
def toRDF(self): """Dump inde to RDF file"""
2b8b1f67cab5761201c2edebc021ab513ef8a352 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/2b8b1f67cab5761201c2edebc021ab513ef8a352/index.py
person = URIRef(subscriber.getStringId())
person = URIRef(self.baseUri + '
def __toRDF(self): """Dump to RDF file all subscribers""" if not (os.path.exists(self.config.get('dir'))): os.mkdir(self.config.get('dir'))
ee769e5049274f541be369682bd4417924f8f891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/ee769e5049274f541be369682bd4417924f8f891/subscribers.py
self.subscribers.process()
if (self.config.get('foaf')): self.subscribers.process()
def publish(self): """ Publish the messages """ self.__createDir() #fisrt lap self.__parse() #and second lap mbox = Mbox(self.config.get('mbox')) messages = 0
b5f06acc4b8a247e5fd4edaf36e5fc90e22f5d34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/b5f06acc4b8a247e5fd4edaf36e5fc90e22f5d34/mailinglist.py
opts, args = getopt.getopt(argv, "dufh:", ["dir=","url=","file=","help"])
opts, args = getopt.getopt(argv, "d:u:f:h", ["dir=","url=","file=","help"])
def args(self, argv, config): "Getting params"
e4749bca7d95b9635e409a8788b13004de5c300d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4749bca7d95b9635e409a8788b13004de5c300d/swaml.py
gsr.reset()
gsr.clear() gsr.clearSearchForm()
def goButtonClicked(self): uri = widgets.get_widget('urlInput').get_text() if (uri != ''): gsr.reset() gsr.messageBar( 'query on ' + uri) gsr.drawTree(gsr.getPosts(uri))
e581dccc064e1c1bd2352ce03643260ff6fca5dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e581dccc064e1c1bd2352ce03643260ff6fca5dc/gsr.py
def reset(self):
def clear(self):
def reset(self): #tree self.treeTranslator = {} for column in self.treeView.get_columns(): self.treeView.remove_column(column)
e581dccc064e1c1bd2352ce03643260ff6fca5dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e581dccc064e1c1bd2352ce03643260ff6fca5dc/gsr.py
self.text.get_buffer().set_text('') def clearSearchForm(self):
def reset(self): #tree self.treeTranslator = {} for column in self.treeView.get_columns(): self.treeView.remove_column(column)
e581dccc064e1c1bd2352ce03643260ff6fca5dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e581dccc064e1c1bd2352ce03643260ff6fca5dc/gsr.py
widgets.get_widget('toYearSpin').set_value(2010.0) self.text.get_buffer().set_text('')
widgets.get_widget('toYearSpin').set_value(2010.0)
def reset(self): #tree self.treeTranslator = {} for column in self.treeView.get_columns(): self.treeView.remove_column(column)
e581dccc064e1c1bd2352ce03643260ff6fca5dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e581dccc064e1c1bd2352ce03643260ff6fca5dc/gsr.py
print '' print '-----------------------------------------' print 'original: ' + str(msg['From'])
def toRDF(self, message, n): """Print a message into RDF in XML format""" msg = message template = Template() tpl = template.get('rdf_message')
febd9d7fafc768b6293376f75abfa7416052dc36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/febd9d7fafc768b6293376f75abfa7416052dc36/publisher.py
print '1'
def toRDF(self, message, n): """Print a message into RDF in XML format""" msg = message template = Template() tpl = template.get('rdf_message')
febd9d7fafc768b6293376f75abfa7416052dc36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/febd9d7fafc768b6293376f75abfa7416052dc36/publisher.py
print '2' print 'name: ' + from_name print 'mail: ' + from_mail
def toRDF(self, message, n): """Print a message into RDF in XML format""" msg = message template = Template() tpl = template.get('rdf_message')
febd9d7fafc768b6293376f75abfa7416052dc36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/febd9d7fafc768b6293376f75abfa7416052dc36/publisher.py
def __toRDF(self): """Dump to RDF file all suscriptors""" if not (os.path.exists(self.config.get('dir'))): os.mkdir(self.config.get('dir'))
10e2b7c976902c1e179e0b59e486cd35cda37197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/10e2b7c976902c1e179e0b59e486cd35cda37197/suscriptors.py
def loadAdditionalData(self, uri): for post in self.graph.objects(uri, SIOC['container_of']):
def loadAdditionalData(self): for post in self.graph.objects(self.uri, SIOC['container_of']):
def loadAdditionalData(self, uri): for post in self.graph.objects(uri, SIOC['container_of']): if not self.hasValueForPredicate(post, SIOC['title']): print 'Resolving reference to get additional data (', post, ')...', self.graph.parse(post) print 'OK, now', len(self.graph), 'triples' for user in self.graph.objects(uri...
25c1955d9d46551d06d3541d40a07c3ac5c895de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/25c1955d9d46551d06d3541d40a07c3ac5c895de/buxon.py
for user in self.graph.objects(uri, SIOC['has_subscriber']):
for user in self.graph.objects(self.uri, SIOC['has_subscriber']):
def loadAdditionalData(self, uri): for post in self.graph.objects(uri, SIOC['container_of']): if not self.hasValueForPredicate(post, SIOC['title']): print 'Resolving reference to get additional data (', post, ')...', self.graph.parse(post) print 'OK, now', len(self.graph), 'triples' for user in self.graph.objects(uri...
25c1955d9d46551d06d3541d40a07c3ac5c895de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/25c1955d9d46551d06d3541d40a07c3ac5c895de/buxon.py
select = ('?post', '?id', '?postTitle', '?userName')
select = ('?post', '?postTitle', '?userName', '?parent')
def query(self): try: self.graph = self.loadMailingList(self.uri) self.loadAdditionalData(self.uri) print 'Total triples loaded:', len(self.graph) sparqlGr = sparql.sparqlGraph.SPARQLGraph(self.graph) select = ('?post', '?id', '?postTitle', '?userName') where = sparql.GraphPattern([('?post', RDF['type'], SIOC['Pos...
7690383425e57ec5a94accd3ac525876cc8a45a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/7690383425e57ec5a94accd3ac525876cc8a45a3/gsr.py
('?post', SIOC['id'], '?id')]) opt = sparql.GraphPattern([('?post', SIOC['title'], '?postTitle'),
('?post', SIOC['title'], '?postTitle'),
def query(self): try: self.graph = self.loadMailingList(self.uri) self.loadAdditionalData(self.uri) print 'Total triples loaded:', len(self.graph) sparqlGr = sparql.sparqlGraph.SPARQLGraph(self.graph) select = ('?post', '?id', '?postTitle', '?userName') where = sparql.GraphPattern([('?post', RDF['type'], SIOC['Pos...
7690383425e57ec5a94accd3ac525876cc8a45a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/7690383425e57ec5a94accd3ac525876cc8a45a3/gsr.py
for (post, id, title, creator) in posts: self.treeTranslator[id] = self.treeStore.append(self.__getParent(id), [str(title)])
for (post, title, creator, parent) in posts: self.treeTranslator[post] = self.treeStore.append(self.__getParent(parent), [str(title)])
def drawTree(self, url): self.cache = Cache(url) posts = self.cache.query() if (posts!=None and len(posts)>0): #create view and model self.treeView = widgets.get_widget('postsTree') self.treeStore = gtk.TreeStore(str) self.treeView.set_model(self.treeStore) #append items parent = None for (post, id, title, creator) ...
7690383425e57ec5a94accd3ac525876cc8a45a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/7690383425e57ec5a94accd3ac525876cc8a45a3/gsr.py
def __getParent(self, id): if (id in self.treeTranslator): return self.treeTranslator[id]
def __getParent(self, uri): if (uri in self.treeTranslator): return self.treeTranslator[uri]
def __getParent(self, id): if (id in self.treeTranslator): return self.treeTranslator[id] else: return None
7690383425e57ec5a94accd3ac525876cc8a45a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/7690383425e57ec5a94accd3ac525876cc8a45a3/gsr.py
def __init__(self): self.treeTranslator = {} #statusbar self.statusbar = widgets.get_widget('gsrStatusbar') self.messageBar('ready') #main window self.window = widgets.get_widget('gsr') self.window.set_icon_from_file('rdf.ico') self.window.show()
7690383425e57ec5a94accd3ac525876cc8a45a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/7690383425e57ec5a94accd3ac525876cc8a45a3/gsr.py
print msg['Subject'] + ' - ' + subject
def __init__(self, msg, config): """Message constructor""" self.__class__.id += 1 self.id = self.__class__.id self.messageId = msg['Message-Id'] self.date = msg['Date'] self.From = msg['From'] self.getAddressFrom = msg.getaddr('From') self.to = msg['To'] #tip because decode_header returns the exception # ValueError...
71e461ec9919fb7454ba724b1691acfec01db486 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/71e461ec9919fb7454ba724b1691acfec01db486/message.py
self.to = msg['To'] subject_parted = msg['Subject'].split(' ') subject = '' for one in subject_parted: [(s, enconding)] = decode_header(one) if (subject == ''): subject = s else: subject += ' ' + s self.subject = subject
try: self.to = msg['To'] except: self.to = self.config.get('defaultTo')
def __init__(self, msg, config): """Message constructor""" self.__class__.id += 1 self.id = self.__class__.id self.messageId = msg['Message-Id'] self.date = msg['Date'] self.From = msg['From'] self.getAddressFrom = msg.getaddr('From') self.to = msg['To'] #tip because decode_header returns the exception # ValueError...
db9d8293a00f10e50dd314daeca038a9a8b57008 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/db9d8293a00f10e50dd314daeca038a9a8b57008/message.py
self.config = config
def __init__(self, msg, config): """Message constructor""" self.__class__.id += 1 self.id = self.__class__.id self.messageId = msg['Message-Id'] self.date = msg['Date'] self.From = msg['From'] self.getAddressFrom = msg.getaddr('From') self.to = msg['To'] #tip because decode_header returns the exception # ValueError...
db9d8293a00f10e50dd314daeca038a9a8b57008 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/db9d8293a00f10e50dd314daeca038a9a8b57008/message.py
to = ' ' try: to = self.to except: to = self.config.get('defaultTo')
to = self.to
def getTo(self): to = ' ' try: to = self.to except: #some mails have not a 'to' field to = self.config.get('defaultTo') to = to.replace('@', self.config.getAntiSpam()) to = to.replace('<', '') to = to.replace('>', '') return unicode(to, errors='ignore')
db9d8293a00f10e50dd314daeca038a9a8b57008 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/db9d8293a00f10e50dd314daeca038a9a8b57008/message.py
self.msg = msg
self.messageId = msg['Message-Id'] self.date = msg['Date'] self.From = msg['From'] self.getAddressFrom = msg.getaddr('From') self.to = msg['To'] subject_parted = msg['Subject'].split(' ') subject = '' for one in subject_parted: [(s, enconding)] = decode_header(one) if (subject == ''): subject = s else: subject += '...
def __init__(self, msg, config): """Message constructor""" self.__class__.id += 1 self.id = self.__class__.id self.msg = msg self.config = config
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
parted_id = self.msg['Message-Id'].split('.') msg_id = parted_id[len(parted_id)-1] + '-' + self.msg['Date'] + '-swaml-' + str(self.id)
parted_id = self.messageId.split('.') msg_id = parted_id[len(parted_id)-1] + '-' + self.date + '-swaml-' + str(self.id)
def getSwamlId(self): #TODO: obtain a better SWAML ID parted_id = self.msg['Message-Id'].split('.') msg_id = parted_id[len(parted_id)-1] + '-' + self.msg['Date'] + '-swaml-' + str(self.id) return sha.new(msg_id).hexdigest()
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
date = email.Utils.parsedate(self.getDate())
date = email.Utils.parsedate(self.date)
def getPath(self): """Return the message's index name"""
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
if(self.msg['From'].find('<')!= -1):
if(self.From.find('<')!= -1):
def getFromName(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[0]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_name
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
return str(self.msg.getaddr('From')[0])
return str(self.getAddressFrom[0])
def getFromName(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[0]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_name
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
from_name, from_mail = self.parseFrom(self.msg['From'])
from_name, from_mail = self.parseFrom(self.From)
def getFromName(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[0]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_name
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
if(self.msg['From'].find('<')!= -1):
if(self.From.find('<')!= -1):
def getFromMail(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[1]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_mail
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
return str(self.msg.getaddr('From')[1])
return str(self.getAddressFrom[1])
def getFromMail(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[1]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_mail
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
from_name, from_mail = self.parseFrom(self.msg['From'])
from_name, from_mail = self.parseFrom(self.From)
def getFromMail(self): if(self.msg['From'].find('<')!= -1): #mail similar than: Name Surmane <name@domain.com> return str(self.msg.getaddr('From')[1]) else: #something like: Name Surmane name@domain.com from_name, from_mail = self.parseFrom(self.msg['From']) return from_mail
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
to = self.msg['To']
to = self.to
def getTo(self): to = ' ' try: to = self.msg['To'] except: #some mails have not a 'to' field to = self.config.get('defaultTo') to = to.replace('@', self.config.getAntiSpam()) to = to.replace('<', '') to = to.replace('>', '') return unicode(to, errors='ignore')
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
return unicode(self.msg['Subject'], errors='ignore')
return self.subject
def getSubject(self): return unicode(self.msg['Subject'], errors='ignore')
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
return self.msg['Date']
return self.date
def getDate(self): return self.msg['Date']
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
return unicode(self.msg.fp.read(), errors='ignore')
return self.body
def getBody(self): return unicode(self.msg.fp.read(), errors='ignore')
e4fc328b2ad5db6985e54b3de1089e0f6fe35706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e4fc328b2ad5db6985e54b3de1089e0f6fe35706/message.py
print "SWAML", __init__.__version__
print "SWAML 0.0.5",
def version(self): print "SWAML", __init__.__version__ sys.exit()
f8739921982f64a8c0466b441a5f293b3d40aaf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/f8739921982f64a8c0466b441a5f293b3d40aaf1/swaml.py
elif opt in ("-d", "--dir=") and arg:
elif opt in ("-d", "--dir") and arg:
def args(self, argv, config): "Getting params of default input"
743592d88dab2964394ae1a0a7a16d49c98eb769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/743592d88dab2964394ae1a0a7a16d49c98eb769/swaml.py
elif opt in ("-u", "--url=") and arg:
elif opt in ("-u", "--url") and arg:
def args(self, argv, config): "Getting params of default input"
743592d88dab2964394ae1a0a7a16d49c98eb769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/743592d88dab2964394ae1a0a7a16d49c98eb769/swaml.py
elif opt in ("-m", "--mbox=") and arg:
elif opt in ("-m", "--mbox") and arg:
def args(self, argv, config): "Getting params of default input"
743592d88dab2964394ae1a0a7a16d49c98eb769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/743592d88dab2964394ae1a0a7a16d49c98eb769/swaml.py
elif opt in ("-f", "--format=") and arg:
elif opt in ("-f", "--format") and arg:
def args(self, argv, config): "Getting params of default input"
743592d88dab2964394ae1a0a7a16d49c98eb769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/743592d88dab2964394ae1a0a7a16d49c98eb769/swaml.py
self.cache.dump()
self.cache.dump(self.base + 'buxon.cache')
def destroy(self): if (self.cache != None): self.cache.dump()
41a05be58c4b847b8905254a06aaf82384035e52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/41a05be58c4b847b8905254a06aaf82384035e52/buxon.py
self.window.set_icon_from_file('includes/images/rdf.ico')
self.window.set_icon_from_file(self.base + 'includes/images/rdf.ico')
def main(self, uri=None): #widgets self.treeView = widgets.get_widget('postsTree') self.text = widgets.get_widget('buxonTextView') buffer = self.text.get_buffer() self.insertBufferTag(buffer, 'bold', 'weight', pango.WEIGHT_BOLD) self.insertBufferTag(buffer, 'monospace', 'family', 'monospace') self.insertBufferTag(buff...
41a05be58c4b847b8905254a06aaf82384035e52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/41a05be58c4b847b8905254a06aaf82384035e52/buxon.py
def __init__(self):
def __init__(self, base):
def __init__(self): GtkUI.__init__(self, 'buxon') self.cache = None self.treeTranslator = {}
41a05be58c4b847b8905254a06aaf82384035e52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/41a05be58c4b847b8905254a06aaf82384035e52/buxon.py
widgets = ObjectBuilder('includes/ui/graphical/buxon.glade')
path = __file__.split('/') base = '/'.join(path[:-1]) + '/' widgets = ObjectBuilder(base + 'includes/ui/graphical/buxon.glade')
def __init__(self): GtkUI.__init__(self, 'buxon') self.cache = None self.treeTranslator = {}
41a05be58c4b847b8905254a06aaf82384035e52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/41a05be58c4b847b8905254a06aaf82384035e52/buxon.py
buxon = Buxon()
buxon = Buxon(base)
def __init__(self): GtkUI.__init__(self, 'buxon') self.cache = None self.treeTranslator = {}
41a05be58c4b847b8905254a06aaf82384035e52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/41a05be58c4b847b8905254a06aaf82384035e52/buxon.py
base = '/'.join(path[:-1]) + '/'
base = '/'.join(path[:-1]) + '/'
def __init__(self, argv, base=None): """ All operation that Buxon need to run """ try: global widgets global callbacks global buxon if (base == None): path = __file__.split('/') base = '/'.join(path[:-1]) + '/' widgets = ObjectBuilder(base + 'includes/ui/graphical/buxon.glade') callbacks = Callbacks() widgets.signal...
c08d158defc83ac14f33215ce56a545df7f37fef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/c08d158defc83ac14f33215ce56a545df7f37fef/buxon.py
import socket socket.setdefaulttimeout(10)
def __getGraph(self, foaf): """ A simple mechanism to cache foaf graph """ if (self.__actualFoaf != foaf or self.__graph == None): self.__actualFoaf = foaf self.__graph = sparqlGraph.SPARQLGraph() try: self.__graph.parse(foaf) except: self.__graph = None
f3ec93ac5b76b7de2782335175b11561f859951d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/f3ec93ac5b76b7de2782335175b11561f859951d/services.py
'bd6566af7b3bfa28f917aa545bf4174661817d79' : 'http://www.asturlinux.org/~jsmanrique/foaf.rdf'
'bd6566af7b3bfa28f917aa545bf4174661817d79' : 'http://www.asturlinux.org/~jsmanrique/foaf.rdf', '97d9756f1281858d0e9e4489003073e4986546ce' : 'http://xtrasgu.asturlinux.org/descargas/foaf.rdf'
def getFoaf(self, mail): """ Services to obtain FOAF URI from an email address @param mail: an email address @type mail: string @return: the FOAF URI of this email owner @rtype: string @todo customize foaf service """ mail_sha1sum = self.getShaMail(mail) # TODO: customize this with a real service # # ideas:...
e54260464af1a4b46d84b68f728a1e4b88d7b4ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/e54260464af1a4b46d84b68f728a1e4b88d7b4ef/services.py
to_tmp = self.msg['To'] self.tpl = self.tpl.replace('{TO}', to_tmp)
tmp_to = ' ' try: tmp_to = self.msg['To'] if (self.default_to == ''): self.default_to = tmp_to except: if (self.default_to != ''): tmp_to = self.default_to tmp_to = tmp_to.replace('@', self.config.getAntiSpam()) tmp_to = tmp_to.replace('<', '&lt;') tmp_to = tmp_to.replace('>', '&gt;') self.tpl = self.tpl.replace('{TO...
def addIndex(self, message, n): self.msg = message self.template = Template() self.tpl = self.template.get('rdf_index_item')
8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7/publisher.py
print '(index) Error proccesing messages: ' + str(detail)
print 'Error proccesing messages: ' + str(detail)
def addIndex(self, message, n): self.msg = message self.template = Template() self.tpl = self.template.get('rdf_index_item')
8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7/publisher.py
to_tmp = self.msg.getaddr('To')[1] self.tpl = self.tpl.replace('{TO}', to_tmp)
tmp_to = ' ' try: tmp_to = self.msg['To'] if (self.default_to == ''): self.default_to = tmp_to except: if (self.default_to != ''): tmp_to = self.default_to tmp_to = tmp_to.replace('@', self.config.getAntiSpam()) tmp_to = tmp_to.replace('<', '&lt;') tmp_to = tmp_to.replace('>', '&gt;') self.tpl = self.tpl.replace('{TO...
def intoRDF(self, message, n): self.msg = message self.template = Template() self.tpl = self.template.get('rdf_message')
8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7/publisher.py
print '(intoRDF) Error proccesing messages: ' + str(detail)
print 'Error proccesing messages: ' + str(detail)
def intoRDF(self, message, n): self.msg = message self.template = Template() self.tpl = self.template.get('rdf_message')
8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/8a88ddb68024c9a8cd1383a7b6e90e0791d40ee7/publisher.py
self.graph = self.loadMailingList(self.uri) self.loadAdditionalData(self.uri) print 'Total triples loaded:', len(self.graph)
self.bad = False try: self.graph = self.loadMailingList(self.uri) except Exception, details: print '\nAn exception ocurred parsing ' + uri + ': ' + str(details) self.bad = True return self.loadAdditionalData() print 'Total triples loaded:', len(self.graph)
def __init__(self, uri): self.uri = uri self.graph = self.loadMailingList(self.uri) self.loadAdditionalData(self.uri) print 'Total triples loaded:', len(self.graph)
55ad5319216f65bf168d34db44d374124a892e77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/55ad5319216f65bf168d34db44d374124a892e77/buxon.py
if (uri != self.cache.uri):
if (uri!=self.cache.uri or self.cache.bad):
def getPosts(self, uri, min=None, max=None, text=None): if (self.cache == None): self.cache = Cache(uri) else: if (uri != self.cache.uri): self.cache = Cache(uri) min, max = self.getDates() posts = self.cache.query() if (min!=None or max!=None or text!=None): posts = self.cache.filterPosts(posts, min, max, text) ret...
55ad5319216f65bf168d34db44d374124a892e77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/55ad5319216f65bf168d34db44d374124a892e77/buxon.py
posts = self.cache.query() if (min!=None or max!=None or text!=None): posts = self.cache.filterPosts(posts, min, max, text) return posts
if (not self.cache.bad): posts = self.cache.query() if (min!=None or max!=None or text!=None): posts = self.cache.filterPosts(posts, min, max, text) return posts else: return None
def getPosts(self, uri, min=None, max=None, text=None): if (self.cache == None): self.cache = Cache(uri) else: if (uri != self.cache.uri): self.cache = Cache(uri) min, max = self.getDates() posts = self.cache.query() if (min!=None or max!=None or text!=None): posts = self.cache.filterPosts(posts, min, max, text) ret...
55ad5319216f65bf168d34db44d374124a892e77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/55ad5319216f65bf168d34db44d374124a892e77/buxon.py
f.write(url + ' ' + title)
f.write(url + ' ' + title + '\n')
def dumpTranslation(self): try: f = open(self.translationFile, 'w') for url in self.translation.keys(): title = self.translation[url] f.write(url + ' ' + title) f.close() print 'dumped URL\'s cache in', self.destinationFile except IOError, details: print 'Problem writing translation cache: ' + str(details)
4fd47d4d5d8613541f2fbc116d6cd5390dec5d72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/4fd47d4d5d8613541f2fbc116d6cd5390dec5d72/urls2tex.py
print 'dumped URL\'s cache in', self.destinationFile
print 'dumped URL\'s cache in', self.translationFile
def dumpTranslation(self): try: f = open(self.translationFile, 'w') for url in self.translation.keys(): title = self.translation[url] f.write(url + ' ' + title) f.close() print 'dumped URL\'s cache in', self.destinationFile except IOError, details: print 'Problem writing translation cache: ' + str(details)
4fd47d4d5d8613541f2fbc116d6cd5390dec5d72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/4fd47d4d5d8613541f2fbc116d6cd5390dec5d72/urls2tex.py
ret = self.__force_decode(orig)
ret = self.__unicode(orig, self.charset)
def encode(self, orig): """ Encode an string @param orig: original string """ ret = '' try: ret = self.__force_decode(orig) except Exception: ret = self.__unicode(orig, self.charset) return ret
a312cd35820542b9a799600d2e2462b783f1cc99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/a312cd35820542b9a799600d2e2462b783f1cc99/charset.py
ret = self.__unicode(orig, self.charset)
ret = self.__decode(orig)
def encode(self, orig): """ Encode an string @param orig: original string """ ret = '' try: ret = self.__force_decode(orig) except Exception: ret = self.__unicode(orig, self.charset) return ret
a312cd35820542b9a799600d2e2462b783f1cc99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/a312cd35820542b9a799600d2e2462b783f1cc99/charset.py
def __decode(self, orig): """ Decode an string @param orig: original string """ #tip because decode_header returns the exception # ValueError: too many values to unpack #TODO: performance this tip parted = orig.split(' ') dest = '' for one in parted: [(s, enconding)] = decode_header(one) if (dest == ''): dest = s ...
a312cd35820542b9a799600d2e2462b783f1cc99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/a312cd35820542b9a799600d2e2462b783f1cc99/charset.py
GtkUI.__init__(self, 'buxon')
GtkUI.__init__(self, 'buxon', base)
def __init__(self, base='./'): """ Buxon constructor @param base: base directory """ GtkUI.__init__(self, 'buxon') self.base = base self.cache = None self.treeTranslator = {}
d224e5356cbd3faf743c80c9cef0e02c20dd405f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2232/d224e5356cbd3faf743c80c9cef0e02c20dd405f/buxon.py
print 'list'
def list(self, sort=None, group=None, filter=None, columns=None, filterspec=None, show_customization=None, show_nodes=1, pagesize=None): ''' call the template index with the args
32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8/cgi_client.py
print `props`
def _createnode(self): ''' create a node based on the contents of the form ''' cl = self.db.classes[self.classname] props = parsePropsFromForm(self.db, cl, self.form)
32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/32d4c8e2b4ce40eaecf7fc934f6015e4b64db5b8/cgi_client.py
def _createnode(self): ''' create a node based on the contents of the form ''' cl = self.db.classes[self.classname] props, dummy = parsePropsFromForm(self.db, cl, self.form) if not props.has_key('status'): try: unread_id = self.db.status.lookup('unread') except KeyError: pass else: props['status'] = unread_id if p...
def showfile(self): ''' display a file ''' nodeid = self.nodeid cl = self.db.file mime_type = cl.get(nodeid, 'type') if mime_type == 'message/rfc822': mime_type = 'text/plain' self.header(headers={'Content-Type': mime_type}) self.write(cl.get(nodeid, 'content'))
a43f362c984960504ee2a5274edaf031a40df05f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a43f362c984960504ee2a5274edaf031a40df05f/cgi_client.py
if hasattr(backends, 'mysql'): l.append(unittest.makeSuite(mysqlDBTestCase, 'test')) l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test'))
p = []
def suite(): l = [ unittest.makeSuite(anydbmDBTestCase, 'test'), unittest.makeSuite(anydbmReadOnlyDBTestCase, 'test') ]
066327279c9213ce45a34552b41c3416b42104b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/066327279c9213ce45a34552b41c3416b42104b7/test_db.py
value = str(value)
if type(value) != type(''): raise ValueError, 'link value must be String'
def create(self, **propvalues): """Create a new node of this class and return its id.
f585d0fd8b97406c94bbd0235dd528198f965caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f585d0fd8b97406c94bbd0235dd528198f965caf/hyperdb.py
raise ValueError, 'new property "%s": %s not a %s'%(
raise IndexError, 'new property "%s": %s not a %s'%(
def create(self, **propvalues): """Create a new node of this class and return its id.
f585d0fd8b97406c94bbd0235dd528198f965caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f585d0fd8b97406c94bbd0235dd528198f965caf/hyperdb.py