rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
my_t = self._t + _tzoffset(self._tz, self._t) ob_t = other._t + _tzoffset(other._tz, other._t) return (my_t - ob_t) / 86400.0
if 0: my_t = self._t + _tzoffset(self._tz, self._t) ob_t = other._t + _tzoffset(other._tz, other._t) return (my_t - ob_t) / 86400.0 return self._d - other._d
def __sub__(self,other): """Either a DateTime or a number may be subtracted from a DateTime, however, a DateTime may not be subtracted from a number.""" if hasattr(other, '_d'): my_t = self._t + _tzoffset(self._tz, self._t) ob_t = other._t + _tzoffset(other._tz, other._t) return (my_t - ob_t) / 86400.0 else: return sel...
941eee025d0e497426e6949d06245abbe795ae69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/941eee025d0e497426e6949d06245abbe795ae69/DateTime.py
provided by default, and 'alt' comes from the 'title_or_id' method.
provided by default, and 'alt' comes from the 'title' property.
def tag(height=None, width=None, alt=None, scale=0, xscale=0, yscale=0, **args): """ This method returns a string which contains an HTML IMG tag reference to the image.
10969ff4aa809aad48d1359503e3aef61b182522 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/10969ff4aa809aad48d1359503e3aef61b182522/Image.py
toc = TransientObjectContainer( 'session_data', 'Session Data Container', addNotification = addnotify, delNotification = delnotify, limit=limit, period_secs=period_spec) if timeout_spec is not None:
if 1:
def install_tempfolder_and_sdc(self): app = self.getApp() from Products.ZODBMountPoint.MountedObject import manage_addMounts,\ MountedObject from Products.ZODBMountPoint.MountedObject import getConfiguration as \ getDBTabConfiguration
84bf129802001e8aa6a1b3e60f97a29394dcf8b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/84bf129802001e8aa6a1b3e60f97a29394dcf8b6/Application.py
unindex[i] = ()
unindex[i] = []
def index_object(self, i, obj, tupleType=type(()), dictType=type({}), callable=callable): """Recompute index data for data with ids >= start. if 'obj' is passed in, it is indexed instead of _data[i]"""
cc1af03882b20ed1b007f695299ac2363acd450d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cc1af03882b20ed1b007f695299ac2363acd450d/UnTextIndex.py
def _updateProperty(self, id, value):
def _updateProperty(self, id, value, meta=None):
def _updateProperty(self, id, value): # Update the value of an existing property. If value is a string, # an attempt will be made to convert the value to the type of the # existing property. if not self.hasProperty(id): raise 'Bad Request', 'The property %s does not exist.' % id if type(value)==type(''): proptype=self....
f34bb02946e56415a77e27576c0a167304644020 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f34bb02946e56415a77e27576c0a167304644020/PropertySheets.py
def _updateProperty(self, id, value): # Update the value of an existing property. If value is a string, # an attempt will be made to convert the value to the type of the # existing property. if not self.hasProperty(id): raise 'Bad Request', 'The property %s does not exist.' % id if type(value)==type(''): proptype=self....
f34bb02946e56415a77e27576c0a167304644020 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f34bb02946e56415a77e27576c0a167304644020/PropertySheets.py
if parent:
if parent is not None:
def getRolesInContext(self, object): """Return the list of roles assigned to the user, including local roles assigned in context of the passed in object.""" name=self.getUserName() roles=self.getRoles() local={} object=getattr(object, 'aq_inner', object) while 1: local_roles = getattr(object, '__ac_local_roles__', None...
5eb1539a4f671e814fff83e262cfa7e895cb7a5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5eb1539a4f671e814fff83e262cfa7e895cb7a5b/User.py
exc_info=exc_info())
exc_info=True)
def __setstate__(self, state): Globals.Persistent.__setstate__(self, state) if self.connection_string: try: self.connect(self.connection_string) except: logger.error('Error connecting to relational database.', exc_info=exc_info())
2a3e8ea548640e920f3f43a246e45e9a7aaaa0be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2a3e8ea548640e920f3f43a246e45e9a7aaaa0be/Connection.py
error=exc_info())
exc_info=True)
def manage_close_connection(self, REQUEST=None): " " try: if hasattr(self,'_v_database_connection'): self._v_database_connection.close() except: logger.error('Error closing relational database connection.', error=exc_info()) self._v_connected='' if REQUEST is not None: return self.manage_main(self, REQUEST)
2a3e8ea548640e920f3f43a246e45e9a7aaaa0be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2a3e8ea548640e920f3f43a246e45e9a7aaaa0be/Connection.py
klass=self.aq_inner.aq_parent.aq_parent._zclass_
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ klass=self.aq_inner.aq_parent.aq_parent._zclass_ if meta_type: self.setClassAttr('meta_type', meta_type) if file: # and hasattr(file, 'content_type'): if hasattr(klass, 'ziconImage'): klass.ziconImage.manage_upload(fi...
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
if hasattr(klass, 'ziconImage'): klass.ziconImage.manage_upload(file) else:
__traceback_info__=file image=self.getClassAttr('ziconImage', None) if image is None:
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ klass=self.aq_inner.aq_parent.aq_parent._zclass_ if meta_type: self.setClassAttr('meta_type', meta_type) if file: # and hasattr(file, 'content_type'): if hasattr(klass, 'ziconImage'): klass.ziconImage.manage_upload(fi...
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
if not icon: self.setClassAttr('icon', REQUEST['URL1']+'/ziconImage')
else: image.manage_upload(file) if (not icon) and REQUEST: icon=(REQUEST['URL3'][len(REQUEST['BASE1'])+1:] +'/ziconImage')
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ klass=self.aq_inner.aq_parent.aq_parent._zclass_ if meta_type: self.setClassAttr('meta_type', meta_type) if file: # and hasattr(file, 'content_type'): if hasattr(klass, 'ziconImage'): klass.ziconImage.manage_upload(fi...
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
class ziconImage(ExtensionClass.Base): "Computed icon attribute" def __of__(self, parent): return _ziconImage()
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ klass=self.aq_inner.aq_parent.aq_parent._zclass_ if meta_type: self.setClassAttr('meta_type', meta_type) if file: # and hasattr(file, 'content_type'): if hasattr(klass, 'ziconImage'): klass.ziconImage.manage_upload(fi...
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
ziconImage=ziconImage()
def icon(self): return self.getClassAttr('icon','')
def __of__(self, parent): return _ziconImage()
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
def icon_(self): icon=self.aq_inner.aq_parent.aq_parent._zclass_.icon class _ziconImage(ExtensionClass.Base): "The real Computed icon attribute" def __of__(self, ps): klass=ps.aq_inner.aq_parent.aq_parent._zclass_ return klass.ziconImage
def meta_type(self): return self.getClassAttr('meta_type','')
def icon_(self): icon=self.aq_inner.aq_parent.aq_parent._zclass_.icon
e15046bc07bbc7acdb100b4ed05c4d3e3af5048f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e15046bc07bbc7acdb100b4ed05c4d3e3af5048f/Basic.py
$Id: Publish.py,v 1.53 1997/09/23 10:32:57 jim Exp $"""
$Id: Publish.py,v 1.54 1997/09/24 18:47:18 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
e30df7f7307b319c1beffb3e9dd071fe09e39f2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e30df7f7307b319c1beffb3e9dd071fe09e39f2f/Publish.py
__version__='$Revision: 1.53 $'[11:-2]
__version__='$Revision: 1.54 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
e30df7f7307b319c1beffb3e9dd071fe09e39f2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e30df7f7307b319c1beffb3e9dd071fe09e39f2f/Publish.py
if fslist is None: form={'BODY':fs}
if fslist is None: form={'BODY':fs.value}
def __init__(self,
e30df7f7307b319c1beffb3e9dd071fe09e39f2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e30df7f7307b319c1beffb3e9dd071fe09e39f2f/Publish.py
def manage_profile_stats(self, sort='time', limit=200):
def manage_profile_stats(self, sort='time', limit=200, stripDirs=1, mode='stats'):
def manage_profile_stats(self, sort='time', limit=200): """Return profile data if available""" stats=getattr(sys, '_ps_', None) if stats is None: return None output=StringIO() stdout=sys.stdout sys.stdout=output stats.strip_dirs().sort_stats(sort).print_stats(limit) sys.stdout.flush() sys.stdout=stdout return output.ge...
a6b6ca2dac85b96607ed83d69ae54501f29d8aab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6b6ca2dac85b96607ed83d69ae54501f29d8aab/ApplicationManager.py
stats.strip_dirs().sort_stats(sort).print_stats(limit)
getattr(stats,'print_%s' % mode)(limit)
def manage_profile_stats(self, sort='time', limit=200): """Return profile data if available""" stats=getattr(sys, '_ps_', None) if stats is None: return None output=StringIO() stdout=sys.stdout sys.stdout=output stats.strip_dirs().sort_stats(sort).print_stats(limit) sys.stdout.flush() sys.stdout=stdout return output.ge...
a6b6ca2dac85b96607ed83d69ae54501f29d8aab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6b6ca2dac85b96607ed83d69ae54501f29d8aab/ApplicationManager.py
container_class = 'OFS.Folder.Folder'
def __init__(self, section): self.container_class = section.container_class or 'OFS.Folder.Folder' ZODBDatabase.__init__(self, section)
def root_config(section): from ZConfig import ConfigurationError here = os.path.dirname(os.path.abspath(__file__)) swhome = os.path.dirname(os.path.dirname(here)) section.softwarehome = swhome section.zopehome = os.path.dirname(os.path.dirname(swhome)) if section.cgi_environment is None: section.cgi_environment = {} if...
f26d1eed503ca0c13407d67927e22c6fdea7fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d1eed503ca0c13407d67927e22c6fdea7fa54/datatypes.py
print DB, DB.klass
def open(self): DB = self.createDB() if self.config.connection_class: # set the connection class DB.klass = self.config.connection_class print DB, DB.klass if self.config.class_factory is not None: DB.setClassFactory(self.config.class_factory) from ZODB.ActivityMonitor import ActivityMonitor DB.setActivityMonitor(Activ...
f26d1eed503ca0c13407d67927e22c6fdea7fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d1eed503ca0c13407d67927e22c6fdea7fa54/datatypes.py
class_factory=None))
class_factory=None, container_class=None))
def getSectionName(self): return self.name
f26d1eed503ca0c13407d67927e22c6fdea7fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d1eed503ca0c13407d67927e22c6fdea7fa54/datatypes.py
class_factory=None)) temporary.container_class = ('Products.TemporaryFolder.TemporaryFolder.' 'SimpleTemporaryContainer')
class_factory=None, container_class=('Products.TemporaryFolder.' 'TemporaryFolder.' 'SimpleTemporaryContainer') ))
def getSectionName(self): return self.name
f26d1eed503ca0c13407d67927e22c6fdea7fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d1eed503ca0c13407d67927e22c6fdea7fa54/datatypes.py
{'id':'height', 'type':'int'}, {'id':'width', 'type':'int'},
{'id':'height', 'type':'string'}, {'id':'width', 'type':'string'},
def manage_addImage(self,id,file,title='',REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self._setObject(id, Image(id,title,file)) if REQUEST is not None: return self.manage_main(self,REQUEST) return id
6bd79887a07dbc93d57c7722754cb242c0ecaca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6bd79887a07dbc93d57c7722754cb242c0ecaca6/Image.py
return '%s %s' % (url, join(out,' / '))
return '%s%s' % (url, join(out,'/'))
def tabs_path_default(self, REQUEST, # Static var unquote=urllib.unquote, ): steps = REQUEST._steps[:-1] script = REQUEST['BASEPATH1'] linkpat = '<a href="%s/manage_workspace">%s</a>' out = [] url = linkpat % (script, '&nbsp;/') if not steps: return url last = steps.pop() for step in steps: script = '%s/%s' % (script, ...
f00ae92a03e2f8e17bbb2875721627d7cb9c4c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f00ae92a03e2f8e17bbb2875721627d7cb9c4c5d/Management.py
del self._index[entry]
try: del self._index[entry] except KeyError: pass if isinstance(self.__len__, BTrees.Length.Length): self._length = self.__len__ del self.__len__
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1)
7a57f1df31dfda68af941f77aa36ee5c12af91ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a57f1df31dfda68af941f77aa36ee5c12af91ab/UnIndex.py
self._length.change(1)
try: self._length.change(1) except AttributeError: if isinstance(self.__len__, BTrees.Length.Length): self._length = self.__len__ del self.__len__ self._length.change(1)
def insertForwardIndexEntry(self, entry, documentId): """Take the entry provided and put it in the correct place in the forward index.
7a57f1df31dfda68af941f77aa36ee5c12af91ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a57f1df31dfda68af941f77aa36ee5c12af91ab/UnIndex.py
return getattr(self.aq_parent, '%s__roles__' % self.__name__)
imp = getattr(self.aq_parent, '%s__roles__' % self.__name__) return imp.__of__(self)
def _get__roles__(self): return getattr(self.aq_parent, '%s__roles__' % self.__name__)
1bdaa0e92976cff987cde1af6f33227361262c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bdaa0e92976cff987cde1af6f33227361262c37/special_dtml.py
from cStringIO import cStringIO self.ParseStream(cStringIO(s))
from cStringIO import StringIO self.parseStream(StringIO(s))
def parseString(self, s): from cStringIO import cStringIO self.ParseStream(cStringIO(s))
bd2c8f37e751abc2a9953eb8d5ab2ba5e154cb6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd2c8f37e751abc2a9953eb8d5ab2ba5e154cb6d/XMLParser.py
return pt_render(extra_context=bound_names)
return self.pt_render(extra_context=bound_names)
def _exec(self, bound_names, args, kw): """Call a Page Template""" bound_names['options'] = kw
dd9765e487aa0237cbe572a69c2cd7d75dd52f10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dd9765e487aa0237cbe572a69c2cd7d75dd52f10/ZopePageTemplate.py
query_string='?'+query_string[1:]
query_string='?'+query_string[1:]
def __getitem__(self,key):
784d503c5b233b4146c3dc3360497eb711566134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/784d503c5b233b4146c3dc3360497eb711566134/DT_In.py
'<span tal:replace="structure foo" i18n:name="foo_name"/>'
'<span tal:replace="structure foo" i18n:name="foo_name"' ' i18n:translate=""/>'
def test_structure_replace_with_messageid_and_i18nname(self): program, macros = self._compile( '<div i18n:translate="" >' '<span tal:replace="structure foo" i18n:name="foo_name"/>' '</div>') self._check(program, '<div>FOOVALUE</div>\n')
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
'<em i18n:name="foo_name">'
'<em i18n:name="foo_name" tal:omit-tag="">'
def test_complex_replace_with_messageid_and_i18nname(self): program, macros = self._compile( '<div i18n:translate="" >' '<em i18n:name="foo_name">' '<span tal:replace="foo"/>' '</em>' '</div>') self._check(program, '<div>FOOVALUE</div>\n')
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
program = [('version', '1.5'),
program = [('version', '1.6'),
def test_translate_static_text_as_dynamic_from_bytecode(self): program = [('version', '1.5'),
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
def _getCollectingTranslationDomain(self): class CollectingTranslationService(DummyTranslationService): data = [] def translate(self, domain, msgid, mapping=None, context=None, target_language=None, default=None): self.data.append((msgid, mapping)) return DummyTranslationService.translate( self, domain, msgid, mapping...
def _getCollectingTranslationDomain(self): class CollectingTranslationService(DummyTranslationService): data = []
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
xlatdmn = self._getCollectingTranslationDomain()
self.engine.translationDomain.clearMsgids()
def test_for_correct_msgids(self): xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate="">This is text for ' '<span i18n:translate="" tal:content="bar" ' 'i18n:name="bar_name"/>.</div>') self.interpreter = TALInterpreter(program, {}, self.engine, st...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
msgids = list(xlatdmn.data)
msgids = self.engine.translationDomain.getMsgids('default')
def test_for_correct_msgids(self): xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate="">This is text for ' '<span i18n:translate="" tal:content="bar" ' 'i18n:name="bar_name"/>.</div>') self.interpreter = TALInterpreter(program, {}, self.engine, st...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
xlatdmn = self._getCollectingTranslationDomain()
self.engine.translationDomain.clearMsgids()
def test_for_raw_msgids(self): # Test for Issue 314: i18n:translate removes line breaks from # <pre>...</pre> contents # HTML mode xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n' ' \tfor\n div. </div>' '<pre i18n:translate=""...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
msgids = list(xlatdmn.data)
msgids = self.engine.translationDomain.getMsgids('default')
def test_for_raw_msgids(self): # Test for Issue 314: i18n:translate removes line breaks from # <pre>...</pre> contents # HTML mode xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n' ' \tfor\n div. </div>' '<pre i18n:translate=""...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
xlatdmn = self._getCollectingTranslationDomain()
self.engine.translationDomain.clearMsgids()
def test_for_raw_msgids(self): # Test for Issue 314: i18n:translate removes line breaks from # <pre>...</pre> contents # HTML mode xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n' ' \tfor\n div. </div>' '<pre i18n:translate=""...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
msgids = list(xlatdmn.data)
msgids = self.engine.translationDomain.getMsgids('default')
def test_for_raw_msgids(self): # Test for Issue 314: i18n:translate removes line breaks from # <pre>...</pre> contents # HTML mode xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n' ' \tfor\n div. </div>' '<pre i18n:translate=""...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
xlatdmn = self._getCollectingTranslationDomain()
self.engine.translationDomain.clearMsgids()
def test_raw_msgids_and_i18ntranslate_i18nname(self): xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n \tfor\n' '<pre tal:content="raw" i18n:name="raw"' ' i18n:translate=""></pre>.</div>') self.interpreter = TALInterpreter(prog...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
msgids = list(xlatdmn.data)
msgids = self.engine.translationDomain.getMsgids('default')
def test_raw_msgids_and_i18ntranslate_i18nname(self): xlatdmn = self._getCollectingTranslationDomain() result = StringIO() program, macros = self._compile( '<div i18n:translate=""> This is text\n \tfor\n' '<pre tal:content="raw" i18n:name="raw"' ' i18n:translate=""></pre>.</div>') self.interpreter = TALInterpreter(prog...
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
def test_unicode_mixed_unknown_encoding(self): text = u"foo ${bar}" mapping = {u'bar': 'd\xe9j\xe0'} expected = u"foo d\\xe9j\\xe0" self.assertEqual(interpolate(text, mapping), expected)
def test_unicode_mixed_unknown_encoding(self): # This test assumes that sys.getdefaultencoding is ascii... text = u"foo ${bar}" mapping = {u'bar': 'd\xe9j\xe0'} expected = u"foo d\\xe9j\\xe0" self.assertEqual(interpolate(text, mapping), expected)
7a4a610b6943a4f0e0eff9fe7a51800ee82104d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4a610b6943a4f0e0eff9fe7a51800ee82104d5/test_talinterpreter.py
def __init__(self, basepath):
def __init__(self, basepath, verbosity=VERBOSE):
def __init__(self, basepath): # initialize python path self.basepath=path=basepath pjoin=os.path.join if sys.platform == 'win32': sys.path.insert(0, pjoin(path, 'lib/python')) sys.path.insert(1, pjoin(path, 'bin/lib')) sys.path.insert(2, pjoin(path, 'bin/lib/plat-win')) sys.path.insert(3, pjoin(path, 'bin/lib/win32')) ...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
file = open(filepath, 'r') text = file.read() file.close() return ((find(text, 'unittest') > -1) or (find(text, 'framework.py') > -1))
path, name = os.path.split(filepath) fname, ext = os.path.splitext(name) if name[:4]=='test' and name[-3:]=='.py' and \ name != 'testrunner.py': file=open(filepath, 'r') lines=file.readlines() file.close() for line in lines: if (find(line, 'def test_suite(') > -1) or \ (find(line, 'framework(') > -1): return 1 return...
def smellsLikeATest(self, filepath, find=string.find): file = open(filepath, 'r') text = file.read() file.close() return ((find(text, 'unittest') > -1) or (find(text, 'framework.py') > -1))
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
runner=unittest.TextTestRunner(verbosity=VERBOSE)
runner=unittest.TextTestRunner(verbosity=self.verbosity)
def runSuite(self, suite): runner=unittest.TextTestRunner(verbosity=VERBOSE) runner.run(suite)
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
fname, ext=os.path.splitext(name) if name[:4]=='test' and name[-3:]=='.py' and \ name != 'testrunner.py': filepath=os.path.join(pathname, name) if self.smellsLikeATest(filepath): self.runFile(filepath) for name in names:
def runPath(self, pathname): """Run all tests found in the directory named by pathname and all subdirectories.""" if not os.path.isabs(pathname): pathname = os.path.join(self.basepath, pathname) names=os.listdir(pathname) for name in names: fname, ext=os.path.splitext(name) if name[:4]=='test' and name[-3:]=='.py' and ...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
try: suite=self.getSuiteFromFile(filename)
try: suite=self.getSuiteFromFile(name)
def runFile(self, filename): """Run the test suite defined by filename.""" working_dir = os.getcwd() dirname, name = os.path.split(filename) if dirname: os.chdir(dirname) self.report('Running: %s' % filename) try: suite=self.getSuiteFromFile(filename) except: traceback.print_exc() suite=None if suite is None: self.r...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
suite=None if suite is None: self.report('No test suite found in file:\n%s' % filename) return self.runSuite(suite)
suite=None if suite is not None: self.runSuite(suite) else: self.report('No test suite found in file:\n%s\n' % filename)
def runFile(self, filename): """Run the test suite defined by filename.""" working_dir = os.getcwd() dirname, name = os.path.split(filename) if dirname: os.chdir(dirname) self.report('Running: %s' % filename) try: suite=self.getSuiteFromFile(filename) except: traceback.print_exc() suite=None if suite is None: self.r...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
def runFile(self, filename): """Run the test suite defined by filename.""" working_dir = os.getcwd() dirname, name = os.path.split(filename) if dirname: os.chdir(dirname) self.report('Running: %s' % filename) try: suite=self.getSuiteFromFile(filename) except: traceback.print_exc() suite=None if suite is None: self.r...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
whether it succeeded. Quiet mode prints a period as each test runs.
whether it succeeded. Running with -q is the same as running with -v1.
def main(args): usage_msg="""Usage: python testrunner.py options If run without options, testrunner will display this usage message. If you want to run all test suites found in all subdirectories of the current working directory, use the -a option. options: -a Run all tests found in all subdirectories of the curre...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
options, arg=getopt.getopt(args, 'ahd:f:q')
verbosity = VERBOSE options, arg=getopt.getopt(args, 'ahd:f:v:q')
def main(args): usage_msg="""Usage: python testrunner.py options If run without options, testrunner will display this usage message. If you want to run all test suites found in all subdirectories of the current working directory, use the -a option. options: -a Run all tests found in all subdirectories of the curre...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
global VERBOSE VERBOSE = 1
verbosity = 1
def main(args): usage_msg="""Usage: python testrunner.py options If run without options, testrunner will display this usage message. If you want to run all test suites found in all subdirectories of the current working directory, use the -a option. options: -a Run all tests found in all subdirectories of the curre...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
testrunner=TestRunner(os.getcwd())
testrunner = TestRunner(os.getcwd(), verbosity=verbosity)
def main(args): usage_msg="""Usage: python testrunner.py options If run without options, testrunner will display this usage message. If you want to run all test suites found in all subdirectories of the current working directory, use the -a option. options: -a Run all tests found in all subdirectories of the curre...
877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/877d2f5faac346ab0f13fd2a8d682e4d0c5d4ef7/testrunner.py
'--ignore-pyexpat', 'prefix=',
'ignore-pyexpat', 'prefix=',
def main(): # below assumes this script is in the BASE_DIR/inst directory global PREFIX BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BUILD_BASE=os.path.join(os.getcwd(), 'build-base') PYTHON=sys.executable MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() REQUIRE_LF_ENABLED = ...
7e1009e4638ee990d14c441ca6f2182d1d07ed03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7e1009e4638ee990d14c441ca6f2182d1d07ed03/configure.py
if uri[0]=='/': uri=uri[1:] return uri
return urllib.unquote(uri)
def url(self, ftype=urllib.splittype, fhost=urllib.splithost): """Return a SCRIPT_NAME-based url for an object.""" if hasattr(self, 'DestinationURL') and \ callable(self.DestinationURL): url='%s/%s' % (self.DestinationURL(), self.id) else: url=self.absolute_url() type, uri=ftype(url) host, uri=fhost(uri) script_name=se...
6b73e55c3db9929e609f44b4b499e0ff7c024295 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6b73e55c3db9929e609f44b4b499e0ff7c024295/CatalogAwareness.py
if md.has_key(args['header']): output(md.getitem(args['header'],0)(
doc=args['header'] if hasattr(self, doc): doc=getattr(self, doc) elif md.has_key(doc): doc=md.getitem(args['header'],0) else: doc=None if doc is not None: output(doc(
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None): "Render a tree as a table" have_arg=args.has_key if level >= 0: tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url ...
7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84/TreeTag.py
treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) output(md.getitem(args['leaves'],0)( self,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) md._pop(1)
doc=args['leaves'] if hasattr(self, doc): doc=getattr(self, doc) elif md.has_key(doc): doc=md.getitem(args['header'],0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) output(doc( self,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIG...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None): "Render a tree as a table" have_arg=args.has_key if level >= 0: tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url ...
7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84/TreeTag.py
if md.has_key(args['footer']): output(md.getitem(args['footer'],0)(
doc=args['footer'] if hasattr(self, doc): doc=getattr(self, doc) elif md.has_key(doc): doc=md.getitem(args['header'],0) else: doc=None if doc is not None: output(doc(
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None): "Render a tree as a table" have_arg=args.has_key if level >= 0: tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url ...
7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4ebe6c44825ec69cc9b8da8a9f06c33da63e84/TreeTag.py
$Id: Publish.py,v 1.22 1996/10/25 19:34:27 jim Exp $"""
$Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
a9c09bb3ec7b6f1475a6dc3852a4a28ef8626816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c09bb3ec7b6f1475a6dc3852a4a28ef8626816/Publish.py
__version__='$Revision: 1.22 $'[11:-2]
__version__='$Revision: 1.23 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
a9c09bb3ec7b6f1475a6dc3852a4a28ef8626816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c09bb3ec7b6f1475a6dc3852a4a28ef8626816/Publish.py
self.code[at:at]=rcode
self.code[at + 1:at + 1] = [self.code[at]] self.code[at + 1:at + 1] = rcode del self.code[at]
def insert_code(self, rcode, at = None): opn = self.opn # rcode is passed as a (callables, args) pair rcode = map(apply, rcode[0], rcode[1]) if at is None: at = opn self.code[at:at]=rcode self.opn = opn + len(rcode) return rcode
dbede1d87414cf30481c485ea45263ac140151df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dbede1d87414cf30481c485ea45263ac140151df/VSExec.py
result.append(r"fters")
def query(self, pattern): """ """ result = [] for x in self.lexicon.get(pattern): if self.globbing: result.append(self.lexicon._inverseLex[x]) else: result.append(pattern)
c6ec26aa6c146b64a575af8af3bb3a32c806edbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c6ec26aa6c146b64a575af8af3bb3a32c806edbf/Vocabulary.py
LOG('UnTextIndex', PROBLEM,
LOG('UnTextIndex', ERROR,
def unindex_object(self, i, tt=type(()) ): """ carefully unindex document with integer id 'i' from the text index and do not fail if it does not exist """ index = self._index unindex = self._unindex val = unindex.get(i, None) if val is not None: for n in val: v = index.get(n, None) if type(v) is tt: del index[n] elif v...
d1dc226b88d495bb66544f4850d944dbcbc72fcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d1dc226b88d495bb66544f4850d944dbcbc72fcf/UnTextIndex.py
'''Return items in the reciever that are not in the argument'''
'''Return items in the receiver that are not in the argument'''
def and_not(self, x): '''Return items in the reciever that are not in the argument''' result = self.__class__() for key,v in self.items(): try: x[key] except KeyError: result[key] = v return result
21938926dae32d414f4ec813fbb8f02a43bfac4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/21938926dae32d414f4ec813fbb8f02a43bfac4d/InvertedIndex.py
result[key] = positionsr
result[key] = score,positionsr
def near(self, x, distance = 1): '''\ near(rl, distance = 1) Returns a ResultList containing documents which contain''' result = self.__class__() for key, v in self.items(): try: value = x[key] except KeyError: value = None if value is None: continue positions = v[1] + value[1] positions.sort() positionsr = [] rel...
21938926dae32d414f4ec813fbb8f02a43bfac4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/21938926dae32d414f4ec813fbb8f02a43bfac4d/InvertedIndex.py
return self.__snd_request('UNLOCK', self.uri, headers, body)
return self.__snd_request('UNLOCK', self.uri, headers)
def unlock(self, token, **kw): """Remove the lock identified by token from the resource and all other resources included in the lock. If all resources which have been locked under the submitted lock token can not be unlocked the unlock method will fail.""" headers=self.__get_headers(kw) token='<opaquelocktoken:%s>' % ...
61995c12cd4bee320ae675f6232cfe9196319754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/61995c12cd4bee320ae675f6232cfe9196319754/client.py
r.data_record_score__ = 1
r.data_record_score_ = 1
def __getitem__(self, index, ttype=type(())): """ Returns instances of self._v_brains, or whatever is passed into self.useBrains. """ if type(index) is ttype: normalized_score, score, key = index r=self._v_result_class(self.data[key]).__of__(self.aq_parent) r.data_record_id_ = key r.data_record_score_ = score r.data_re...
abb87ad31505c48d7bc291cf4aa615ac0bfc7a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/abb87ad31505c48d7bc291cf4aa615ac0bfc7a68/Catalog.py
return '%s&%s=%s' % (url, name, bid)
return '%s&amp;%s=%s' % (url, name, bid)
def encodeUrl(self, url, create=1): """ encode a URL with the browser id as a postfixed query string element """ bid = self.getBrowserId(create) if bid is None: raise BrowserIdManagerErr, 'There is no current browser id.' name = self.getBrowserIdName() if '?' in url: return '%s&%s=%s' % (url, name, bid) else: return '%...
d0055a1ac336d28e0b45079d863ae496f7924dec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d0055a1ac336d28e0b45079d863ae496f7924dec/BrowserIdManager.py
def objectIds(self,t=None):
def objectIds(self, spec=None):
def objectIds(self,t=None): # Return a list of subobject ids
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
if t is not None: if type(t)==type('s'): t=(t,) return filter(None, map(lambda x,v=t: (x['meta_type'] in v) and x['id'] or None, self._objects))
if spec is not None: if type(spec)==type('s'): spec=[spec] set=[] for ob in self._objects: if ob['meta_type'] in spec: set.append(ob['id']) return set
def objectIds(self,t=None): # Return a list of subobject ids
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
def objectValues(self,t=None):
def objectValues(self, spec=None):
def objectValues(self,t=None): # Return a list of the actual subobjects
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
if t is not None: if type(t)==type('s'): t=(t,) return filter(None, map(lambda x,v=t,s=self: (x['meta_type'] in v) and getattr(s,x['id']) or None, self._objects))
if spec is not None: if type(spec)==type('s'): spec=[spec] set=[] for ob in self._objects: if ob['meta_type'] in spec: set.append(getattr(self, ob['id'])) return set
def objectValues(self,t=None): # Return a list of the actual subobjects
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
def objectItems(self,t=None):
def objectItems(self, spec=None):
def objectItems(self,t=None): # Return a list of (id, subobject) tuples
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
if t is not None: if type(t)==type('s'): t=(t,) return filter(None, map(lambda x,v=t,s=self: (x['meta_type'] in v) and \ (x['id'],getattr(s,x['id'])) or None, self._objects))
if spec is not None: if type(spec)==type('s'): spec=[spec] set=[] for ob in self._objects: if ob['meta_type'] in spec: set.append((ob['id'], getattr(self, ob['id'])))
def objectItems(self,t=None): # Return a list of (id, subobject) tuples
4412eb897eed25f7076a35e60a63e2b4b1dc97f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4412eb897eed25f7076a35e60a63e2b4b1dc97f5/ObjectManager.py
CVS = os.path.normcase("CVS")
CVS_DIRS = [os.path.normcase("CVS"), os.path.normcase(".svn")]
def copyskel(sourcedir, targetdir, uid, gid, **replacements): """ This is an independent function because we'd like to import and call it from mkzopeinstance """ # Create the top of the instance: if not os.path.exists(targetdir): os.makedirs(targetdir) # This is fairly ugly. The chdir() makes path manipulation in the...
e2dae3e07e3173d5bf9c4dc6721fc71adba1ee34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e2dae3e07e3173d5bf9c4dc6721fc71adba1ee34/copyzopeskel.py
if os.path.normcase(name) == CVS:
if os.path.normcase(name) in CVS_DIRS:
def copydir((targetdir, replacements, uid, gid), sourcedir, names): # Don't recurse into CVS directories: for name in names[:]: if os.path.normcase(name) == CVS: names.remove(name) elif os.path.isfile(os.path.join(sourcedir, name)): # Copy the file: sn, ext = os.path.splitext(name) if os.path.normcase(ext) == ".in": ds...
e2dae3e07e3173d5bf9c4dc6721fc71adba1ee34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e2dae3e07e3173d5bf9c4dc6721fc71adba1ee34/copyzopeskel.py
if k=='' or k in '().012FGIJKLMNTUVX]adeghjlpqrstu}':
if k=='' or k in '().012FGIJKLMNTUVXS]adeghjlpqrstu}':
def refuse_to_unpickle(self): raise pickle.UnpicklingError, 'Refused'
0f7afa6d2bd9ffe9bcbff548137dce145b5e8136 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0f7afa6d2bd9ffe9bcbff548137dce145b5e8136/TreeTag.py
elif k in [pickle.STRING]: pass
def refuse_to_unpickle(self): raise pickle.UnpicklingError, 'Refused'
0f7afa6d2bd9ffe9bcbff548137dce145b5e8136 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0f7afa6d2bd9ffe9bcbff548137dce145b5e8136/TreeTag.py
_should_fail('hello',0)
def _test(): _should_fail('hello',0) _should_succeed('hello') _should_succeed(1) _should_succeed(1L) _should_succeed(1.0) _should_succeed((1,2,3)) _should_succeed([1,2,3]) _should_succeed({1:2,3:4}) _should_fail(open) _should_fail(_junk_class) _should_fail(_junk_class())
0f7afa6d2bd9ffe9bcbff548137dce145b5e8136 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0f7afa6d2bd9ffe9bcbff548137dce145b5e8136/TreeTag.py
manage_menu =HTMLFile('dtml/menu', globals())
manage_menu =DTMLFile('dtml/menu', globals())
def tabs_path_info(self, script, path, # Static vars quote=urllib.quote, ): out=[] while path[:1]=='/': path=path[1:] while path[-1:]=='/': path=path[:-1] while script[:1]=='/': script=script[1:] while script[-1:]=='/': script=script[:-1] path=split(path,'/')[:-1] if script: path=[script]+path if not path: return '' sc...
8f292c1be20e547bd8de0628deb9bbce762eed80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f292c1be20e547bd8de0628deb9bbce762eed80/Management.py
manage_zmi_prefs=HTMLFile('dtml/manage_zmi_prefs', globals())
manage_zmi_prefs=DTMLFile('dtml/manage_zmi_prefs', globals())
def manage_zmi_logout(self, REQUEST, RESPONSE): """Logout current user""" p = getattr(REQUEST, '_logout_path', None) if p is not None: return apply(self.restrictedTraverse(p))
8f292c1be20e547bd8de0628deb9bbce762eed80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f292c1be20e547bd8de0628deb9bbce762eed80/Management.py
else: hide_tracebacks=None
else: hide_tracebacks=1
def get_module_info(module_name, modules={}, acquire=_l.acquire, release=_l.release, ): if modules.has_key(module_name): return modules[module_name] if module_name[-4:]=='.cgi': module_name=module_name[:-4] acquire() tb=None try: try: module=__import__(module_name, globals(), globals(), ('__doc__',)) realm=module_n...
85a3536746b2d943046a43eb7bcaa11de8848e76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/85a3536746b2d943046a43eb7bcaa11de8848e76/Publish.py
self.pt_edit(REQUEST.get('BODY', ''))
text = REQUEST.get('BODY', '') content_type = guess_type('', text) self.pt_edit(text, content_type, self.output_encoding)
def PUT(self, REQUEST, RESPONSE): """ Handle HTTP PUT requests """ self.dav__init(REQUEST, RESPONSE) self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1) ## XXX this should be unicode or we must pass an encoding self.pt_edit(REQUEST.get('BODY', '')) RESPONSE.setStatus(204) return RESPONSE
c81a09c8042d7dbba800e0f6f0621b5909243537 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c81a09c8042d7dbba800e0f6f0621b5909243537/ZopePageTemplate.py
self.REQUEST.RESPONSE.setHeader('Content-Type', self.content_type) return self.read()
return self.pt_render()
def manage_FTPget(self): "Get source for FTP download" self.REQUEST.RESPONSE.setHeader('Content-Type', self.content_type) return self.read()
c81a09c8042d7dbba800e0f6f0621b5909243537 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c81a09c8042d7dbba800e0f6f0621b5909243537/ZopePageTemplate.py
for sub in ast[2][2][1:]:
for sub in ast[i][2][1:]:
def item_munge(ast, i): # Munge an item access into a function call name=ast[i][2][1] args=[arglist] append=args.append a=(factor, (power, (atom, (NAME, '_vars')))) a=(argument, (test, (and_test, (not_test, (comparison, (expr, (xor_expr, (and_expr, (shift_expr, (arith_expr, (term, a))))))))))) append(a) append([COMMA,...
c40ace88f846709a5fc46043f857f2dc2cf09d7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c40ace88f846709a5fc46043f857f2dc2cf09d7f/gparse.py
[trailer, [LPAR, '('], args, [RPAR, ')'], ]
[trailer, [LPAR, '('], args, [RPAR, ')']],
def dot_munge(ast, i): # Munge an attribute access into a function call name=ast[i][2][1] args=[arglist] append=args.append a=(factor, (power, (atom, (NAME, '_vars')))) a=(argument, (test, (and_test, (not_test, (comparison, (expr, (xor_expr, (and_expr, (shift_expr, (arith_expr, (term, a))))))))))) append(a) append([CO...
c40ace88f846709a5fc46043f857f2dc2cf09d7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c40ace88f846709a5fc46043f857f2dc2cf09d7f/gparse.py
def spam(): # Regression test import traceback ok=1 for expr1, expr2 in ( ("a*b", "__guarded_mul__(_vars, a, b)"), ("a*b*c", "__guarded_mul__(_vars, __guarded_mul__(_vars, a, b), c)" ), ("a.b", "__guarded_getattr__(_vars, a, 'b')"), ("a[b]", "__guarded_getitem__(_vars, a, b)"), ("a[b,c]", "__guarded_getitem__(_vars...
c40ace88f846709a5fc46043f857f2dc2cf09d7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c40ace88f846709a5fc46043f857f2dc2cf09d7f/gparse.py
def unindex_object(self, i): """ Unindex the object with integer id 'i' """ index = self._index unindex = self._unindex
98f35321cf8fda0a7001bab839f869968aef3aaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/98f35321cf8fda0a7001bab839f869968aef3aaf/UnKeywordIndex.py
if not hasattr(Folder, name): setattr(Folder, name, method)
if not hasattr(Folder.Folder, name): setattr(Folder.Folder, name, method)
def install_product(app, product_dir, product_name, meta_types, folder_permissions, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists DictType=type({}) global_dict=globals() silly=('__doc__',) if 1: # Preserve indentation for diff :-) package_dir=path_join(product_dir, product...
55aea706df39bbe0c5a6760e178e99c8b3c2dd36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/55aea706df39bbe0c5a6760e178e99c8b3c2dd36/Application.py
tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl
if level >= 0: tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None): "Render a tree as a table" have_arg=args.has_key tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-...
bad17ae311a8a52df030437d07b35ad36eaddba1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bad17ae311a8a52df030437d07b35ad36eaddba1/TreeTag.py
header_re=regex.compile(
header_re=ts_regex.compile(
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'),
space_re=ts_regex.compile('\([ \t]+\)'), name_re=ts_regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'),
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
if header_re.match(html) < 0:
ts_results = header_re.match_group(html, (1,3)) if not ts_results:
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
headers, html = header_re.group(1,3)
headers, html = ts_results[1]
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
elif space_re.match(headers[i]) >= 0:
continue ts_results = space_re.match_group(headers[i], (1,)) if ts_results:
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
headers[i][len(space_re.group(1)):])
headers[i][len(ts_results[1]):])
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py
else: i=i+1
continue i=i+1
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\n\0\- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0\- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re....
fb76d2fc46a3786951890b362b197fc303527dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb76d2fc46a3786951890b362b197fc303527dc3/DTMLMethod.py