rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
class _TextTestResult(TestResult):
class _JUnitTextTestResult(TestResult):
def writeln(self, *args): if args: apply(self.write, args) self.write(os.linesep)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
self.printNumberedErrors('error',self.errors)
self.printNumberedErrors("error",self.errors)
def printErrors(self): self.printNumberedErrors('error',self.errors)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
self.printNumberedErrors('failure',self.failures)
self.printNumberedErrors("failure",self.failures)
def printFailures(self): self.printNumberedErrors('failure',self.failures)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
self.stream.writeln("Run: %i ; Failures: %i; Errors: %i" %
self.stream.writeln("Run: %i ; Failures: %i ; Errors: %i" %
def printHeader(self): self.stream.writeln() if self.wasSuccessful(): self.stream.writeln("OK (%i tests)" % self.testsRun) else: self.stream.writeln("!!!FAILURES!!!") self.stream.writeln("Test Results") self.stream.writeln() self.stream.writeln("Run: %i ; Failures: %i; Errors: %i" % (self.testsRun, len(self.failures), ...
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
class TextTestRunner:
class JUnitTextTestRunner:
def printResult(self): self.printHeader() self.printErrors() self.printFailures()
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
Uses TextTestResult.
The display format approximates that of JUnit's 'textui' test runner. This test runner may be removed in a future version of PyUnit.
def printResult(self): self.printHeader() self.printErrors() self.printFailures()
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
"""Run the given test case or test suite. """ result = _TextTestResult(self.stream)
"Run the given test case or test suite." result = _JUnitTextTestResult(self.stream)
def run(self, test): """Run the given test case or test suite. """ result = _TextTestResult(self.stream) startTime = time.time() test(result) stopTime = time.time() self.stream.writeln() self.stream.writeln("Time: %.3fs" % float(stopTime - startTime)) result.printResult() return result
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
def createTestInstance(name): """Looks up and calls a callable object by its string name, which should include its module name, e.g. 'widgettests.WidgetTestSuite'. """ if '.' not in name: raise ValueError,"Incomplete name; expected 'package.suiteobj'" dotPos = string.rfind(name,'.') last = name[dotPos+1:] if not len(la...
class _VerboseTextTestResult(TestResult): """A test result class that can print formatted text results to a stream. Used by VerboseTextTestRunner. """ def __init__(self, stream, descriptions): TestResult.__init__(self) self.stream = stream self.lastFailure = None self.descriptions = descriptions def startTest(se...
def createTestInstance(name): """Looks up and calls a callable object by its string name, which should include its module name, e.g. 'widgettests.WidgetTestSuite'. """ if '.' not in name: raise ValueError,"Incomplete name; expected 'package.suiteobj'" dotPos = string.rfind(name,'.') last = name[dotPos+1:] if not len(la...
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
if len(sys.argv) == 2 and sys.argv[1] not in ('-help','-h','--help'): testClass = createTestInstance(sys.argv[1]) result = TextTestRunner().run(testClass) if result.wasSuccessful(): sys.exit(0) else: sys.exit(1) else: print "usage:", sys.argv[0], "package1.YourTestSuite" sys.exit(2)
main(module=None)
def makeSuite(testCaseClass, prefix='test', sortUsing=cmp): """Returns a TestSuite instance built from all of the test functions in the given test case class whose names begin with the given prefix. The cases are sorted by their function names using the supplied comparison function, which defaults to 'cmp'. """ cases =...
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
def cache_detail(self): try: db=self._p_jar.db() except: detail={} for oid, ob in Globals.Bobobase._jar.cache.items(): if hasattr(ob, '__class__'): ob=ob.__class__ decor='' else: decor=' class' c="%s.%s%s" % (ob.__module__ or '', ob.__name__, decor) if detail.has_key(c): detail[c]=detail[c]+1 else: detail[c]=1 detail=...
def cache_detail(self, REQUEST=None): """ Returns the name of the classes of the objects in the cache and the number of objects in the cache for each class. """ db=self._p_jar.db() detail = db.cacheDetail() if REQUEST is not None: REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain') return string.join(map(lambda (...
def cache_detail(self): try: db=self._p_jar.db() except: # BoboPOS2 detail={} for oid, ob in Globals.Bobobase._jar.cache.items(): if hasattr(ob, '__class__'): ob=ob.__class__ decor='' else: decor=' class' c="%s.%s%s" % (ob.__module__ or '', ob.__name__, decor) if detail.has_key(c): detail[c]=detail[c]+1 else: detail[c]...
dcd0edcaa04205b5837e8b007af641aa19cf23d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dcd0edcaa04205b5837e8b007af641aa19cf23d8/CacheManager.py
else: return db.cacheExtremeDetail()
def cache_extreme_detail(self, REQUEST=None): """ Returns information about each object in the cache. """ db=self._p_jar.db() detail = db.cacheExtremeDetail() if REQUEST is not None: lst = map(lambda dict: ((dict['conn_no'], dict['oid']), dict), detail) lst.sort() res = [ ' 'and class.', ' for sortkey, dict in lst: ...
def cache_extreme_detail(self): try: db=self._p_jar.db() except: # BoboPOS2 detail=[] rc=sys.getrefcount db=Globals.Bobobase._jar.db for oid, ob in Globals.Bobobase._jar.cache.items(): id=oid
dcd0edcaa04205b5837e8b007af641aa19cf23d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dcd0edcaa04205b5837e8b007af641aa19cf23d8/CacheManager.py
getattr(self, id).write(file)
self._getOb(id).write(file)
def manage_addPythonScript(self, id, REQUEST=None): """Add a Python script to a folder. """ id = str(id) id = self._setObject(id, PythonScript(id)) if REQUEST is not None: file = REQUEST.form.get('file', None) if file: if type(file) is not type(''): file = file.read() getattr(self, id).write(file) try: u = self.Destina...
916c5be9775cc7add586069cb81b01ab3746f1d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/916c5be9775cc7add586069cb81b01ab3746f1d4/PythonScript.py
content_type='application/octet-stream'
type='application/octet-stream'
def PUT(self, REQUEST, RESPONSE): """Adds a document, image or file to the folder when a PUT request is received.""" name=self.id type=REQUEST.get_header('content-type', None) body=REQUEST.get('BODY', '') if type is None: type, enc=mimetypes.guess_type(name) if type is None: if content_types.find_binary(body) >= 0: con...
3ab7fd4e93c3305fe534b8dada23670ed06c9b1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3ab7fd4e93c3305fe534b8dada23670ed06c9b1b/Folder.py
self.extends.append(names[2], url)
self.extends.append((names[2], url))
def __init__(self, klass): # Creates an APIDoc instance given a python class. # the class describes the API; it contains # methods, arguments and doc strings. # # The name of the API is deduced from the name # of the class. # # The base APIs are deduced from the __extends__ # attribute. self.name=klass.__name__ self.d...
9e595533da4755a1db48b13796679c002f23a009 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9e595533da4755a1db48b13796679c002f23a009/APIHelpTopic.py
r=db().undoLog()
r=db().undoLog(first_transaction, last_transaction)
def undoable_transactions(self, AUTHENTICATION_PATH=None, first_transaction=None, last_transaction=None, PrincipiaUndoBatchSize=None):
2c0fd90a5ec78284b2e81354a10de8269d71305f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2c0fd90a5ec78284b2e81354a10de8269d71305f/Undo.py
for d in r: r['time']=DateTime(r['time'])
for d in r: d['time']=DateTime(d['time'])
def undoable_transactions(self, AUTHENTICATION_PATH=None, first_transaction=None, last_transaction=None, PrincipiaUndoBatchSize=None):
2c0fd90a5ec78284b2e81354a10de8269d71305f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2c0fd90a5ec78284b2e81354a10de8269d71305f/Undo.py
self.__attrs=attrs
def __init__(self, name, bases=(), attrs=None, __doc__=None): """Create a new interface """ for b in bases: if not isinstance(b, Interface): raise TypeError, 'Expected base interfaces' self.__bases__=bases self.__name__=name
1e479c3ef6694168b5a56840a052f5efd32ef517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1e479c3ef6694168b5a56840a052f5efd32ef517/iclass.py
if __doc__ is not None: self.__doc__=__doc__
if __doc__ is not None: self.__doc__=__doc__ else: self.__doc__ = ""
def __init__(self, name, bases=(), attrs=None, __doc__=None): """Create a new interface """ for b in bases: if not isinstance(b, Interface): raise TypeError, 'Expected base interfaces' self.__bases__=bases self.__name__=name
1e479c3ef6694168b5a56840a052f5efd32ef517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1e479c3ef6694168b5a56840a052f5efd32ef517/iclass.py
for k, v in self.__dict__.items():
for k, v in self.__attrs.items():
def __d(self, dict):
1e479c3ef6694168b5a56840a052f5efd32ef517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1e479c3ef6694168b5a56840a052f5efd32ef517/iclass.py
dtpref_cols='50', dtpref_rows='20'):
dtpref_cols='100%', dtpref_rows='20'):
def pt_changePrefs(self, REQUEST, height=None, width=None, dtpref_cols='50', dtpref_rows='20'): """Change editing preferences.""" # The <textarea> can have dimensions expressed in percentages; # strip the percent sign so int() below won't fail if dtpref_cols[-1:] == "%": dtpref_cols = dtpref_cols[:-1] or '50' if dtpref...
537a21a6fc3d202925bbb3c4ac9cc86776310a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/537a21a6fc3d202925bbb3c4ac9cc86776310a89/ZopePageTemplate.py
if dtpref_cols[-1:] == "%": dtpref_cols = dtpref_cols[:-1] or '50' if dtpref_rows[-1:] == "%": dtpref_rows = dtpref_rows[:-1] or '20'
def pt_changePrefs(self, REQUEST, height=None, width=None, dtpref_cols='50', dtpref_rows='20'): """Change editing preferences.""" # The <textarea> can have dimensions expressed in percentages; # strip the percent sign so int() below won't fail if dtpref_cols[-1:] == "%": dtpref_cols = dtpref_cols[:-1] or '50' if dtpref...
537a21a6fc3d202925bbb3c4ac9cc86776310a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/537a21a6fc3d202925bbb3c4ac9cc86776310a89/ZopePageTemplate.py
try: cols = int(width) except: cols = max(40, int(dtpref_cols) + szchw.get(width, 0))
def pt_changePrefs(self, REQUEST, height=None, width=None, dtpref_cols='50', dtpref_rows='20'): """Change editing preferences.""" # The <textarea> can have dimensions expressed in percentages; # strip the percent sign so int() below won't fail if dtpref_cols[-1:] == "%": dtpref_cols = dtpref_cols[:-1] or '50' if dtpref...
537a21a6fc3d202925bbb3c4ac9cc86776310a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/537a21a6fc3d202925bbb3c4ac9cc86776310a89/ZopePageTemplate.py
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
81025cda3d9c7eb023cefe9a94cdefc370f1bbc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/81025cda3d9c7eb023cefe9a94cdefc370f1bbc5/testHTTPRequest.py
from zExceptions import NotFound env = TEST_ENVIRON.copy() req = HTTPRequest(None, env, None) req['PARENTS'] = ['Nobody', 'cares', 'here'] testmethod = req.resolve_url self.assertRaises(NotFound, testmethod, 'http://localhost/does_not_exist')
from zExceptions import NotFound env = TEST_ENVIRON.copy() req = HTTPRequest(None, env, None) req['PARENTS'] = ['Nobody', 'cares', 'here'] testmethod = req.resolve_url self.assertRaises(NotFound, testmethod, 'http://localhost/does_not_exist')
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
81025cda3d9c7eb023cefe9a94cdefc370f1bbc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/81025cda3d9c7eb023cefe9a94cdefc370f1bbc5/testHTTPRequest.py
if file and (type(file) is type('') or hasattr(file, 'content-type')):
if file and (type(file) is type('') or file.filename):
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ if meta_type: self.setClassAttr('meta_type', meta_type)
97201e832883bdf3289275e29b5640d18012580d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/97201e832883bdf3289275e29b5640d18012580d/Basic.py
db_name = ApplicationManager.db_name db_size = ApplicationManager.db_size manage_pack = ApplicationManager.manage_pack
db_name = ApplicationManager.db_name.im_func db_size = ApplicationManager.db_size.im_func manage_pack = ApplicationManager.manage_pack.im_func
def objectIds(self, spec=None): """ this is a patch for pre-2.4 Zope installations. Such installations don't have an entry for the WebDAV LockManager introduced in 2.4. """
10fff08a067353e96fbc2101e0e898c1a0cce320 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/10fff08a067353e96fbc2101e0e898c1a0cce320/ApplicationManager.py
return folder._getOb(i.id)
id = i.getId() return folder._getOb(id)
def createInObjectManager(self, id, REQUEST, RESPONSE=None): """ Create Z instance. If called with a RESPONSE, the RESPONSE will be redirected to the management screen of the new instance's parent Folder. Otherwise, the instance will be returned. """ i=mapply(self._zclass_, (), REQUEST) try: i._setId(id) except Attribu...
ec461eb93b9542e6894df16ae36608cb01b10129 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ec461eb93b9542e6894df16ae36608cb01b10129/ZClass.py
result[name]=value
if not already_have(name): result[name]=value
def parse_cookie(text, result=None, qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0;-=\"]*\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), ): if result is None: result={} if qparmre.match(text) >= 0: # Match quoted correct...
bd5142940bf866ae23c9af7b36e6caf93eb3f7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd5142940bf866ae23c9af7b36e6caf93eb3f7b1/Publish.py
def _range_request_handler(self, REQUEST, RESPONSE): # HTTP Range header handling: return True if we've served a range # chunk out of our data. range = REQUEST.get_header('Range', None) request_range = REQUEST.get_header('Request-Range', None) if request_range is not None: # Netscape 2 through 4 and MSIE 3 implement a ...
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
RESPONSE.setBase(None)
RESPONSE.setBase(None)
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
transaction.savepoint()
transaction.savepoint(optimistic=True)
def _read_data(self, file):
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
def _read_data(self, file):
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
transaction.savepoint()
transaction.savepoint(optimistic=True)
def _read_data(self, file):
da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py
lg = logger.syslog_logger((addr, int(port))
lg = logger.syslog_logger((addr, int(port)))
def set_locale(val): try: import locale except: raise SystemExit, ( 'The locale module could not be imported.\n' 'To use localization options, you must ensure\n' 'that the locale module is compiled into your\n' 'Python installation.' ) try: locale.setlocale(locale.LC_ALL, val) except: raise SystemExit, ( 'The specified...
935ba2b8eb3ef1f15b6a363aa1afcf022faf0890 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/935ba2b8eb3ef1f15b6a363aa1afcf022faf0890/z2.py
for name in os.listdir(ed): suffix='' if name[:lpp]==pp: path=os.path.join(ed, name) try: f=open(path) data=f.read() f.close() if name[-3:]=='.py': data=rot.encrypt(zlib.compress(data)) suffix='p' except: data=None if data: ar.add("%sExtensions/%s%s" % (prefix,name[lpp:],suffix), data)
if os.path.exists(ed): for name in os.listdir(ed): suffix='' if name[:lpp]==pp: path=os.path.join(ed, name) try: f=open(path) data=f.read() f.close() if name[-3:]=='.py': data=rot.encrypt(zlib.compress(data)) suffix='p' except: data=None if data: ar.add("%sExtensions/%s%s" % (prefix,name[lpp:],suffix), data)
def _distribution(self): # Return a distribution if self.__dict__.has_key('manage_options'): raise TypeError, 'This product is <b>not</b> redistributable.'
475584bcfc4f12ac7d924db076ec20430da3af9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/475584bcfc4f12ac7d924db076ec20430da3af9a/Product.py
except Except:
except AttributeError:
def index_object(self, documentId, obj, threshold=None): """ index an object 'obj' with integer id 'i'
bc531604a3c7067ab35a68651def1200f7e3cf30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bc531604a3c7067ab35a68651def1200f7e3cf30/UnKeywordIndex.py
finished=[] idx=0 while(idx < len(items)): name, ob = items[idx]
finished_dict={} finished = finished_dict.has_key while items: name, ob = items.pop()
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
if base in finished: idx=idx+1
if finished(id(base)):
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
finished.append(base)
finished_dict[id(base)] = None
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
if hasattr(ob, '_register') and hasattr(ob, '_zclass_'): class_id=getattr(ob._zclass_, '__module__', None)
if hasattr(base,'_register') and hasattr(base,'_zclass_'): class_id=getattr(base._zclass_, '__module__', None)
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
if hasattr(ob, 'objectItems'):
if hasattr(base, 'objectItems'):
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
if hasattr(ob, 'propertysheets'):
if hasattr(base, 'propertysheets'):
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
'Broken objects exist in product %s.' % product.id) idx = idx + 1
'Broken objects exist in product %s.' % product.id, error=sys.exc_info())
def fixupZClassDependencies(self, rebuild=0): # Note that callers should not catch exceptions from this method # to ensure that the transaction gets aborted if the registry # cannot be rebuilt for some reason. Returns true if any ZClasses # were registered as a result of the call or the registry was # rebuilt. jar=self...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
try: keys=list(self._p_jar.root()['ZGlobals'].keys()) except: return 1
try: keys=list(self._p_jar.root()['ZGlobals'].keys()) except: LOG('Zope', ERROR, 'A problem was found when checking the global product '\ 'registry. This is probably due to a Product being '\ 'uninstalled or renamed. The traceback follows.', error=sys.exc_info()) return 1
def checkGlobalRegistry(self): """Check the global (zclass) registry for problems, which can be caused by things like disk-based products being deleted. Return true if a problem is found""" try: keys=list(self._p_jar.root()['ZGlobals'].keys()) except: return 1 return 0
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
'A broken ZClass dependency was found in the global ' \ 'class registry. This is probably due to a product ' \ 'being uninstalled. The registry has successfully ' \ 'been rebuilt.')
'The global ZClass registry has successfully been rebuilt.')
def initialize(app): # Initialize the application # Initialize the cache: app.Control_Panel.initialize_cache() # The following items marked b/c are backward compatibility hacks # which make sure that expected system objects are added to the # bobobase. This is required because the bobobase in use may pre- # date the ...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
LOG('Zope', ERROR, 'A problem was found in the global product registry but ' 'the attempt to rebuild the registry failed.',
LOG('Zope', ERROR, 'The attempt to rebuild the registry failed.',
def initialize(app): # Initialize the application # Initialize the cache: app.Control_Panel.initialize_cache() # The following items marked b/c are backward compatibility hacks # which make sure that expected system objects are added to the # bobobase. This is required because the bobobase in use may pre- # date the ...
b3cbcc17ebb543bd146fa427d70436119a037aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cbcc17ebb543bd146fa427d70436119a037aed/Application.py
def __init__(self, args, fmt=''):
def __init__(self, args, fmt='s'):
def __init__(self, args, fmt=''):
bbb979a9bb87723383f645121f927b77a20e734b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bbb979a9bb87723383f645121f927b77a20e734b/DT_Var.py
if len(args)==1:
if len(args)==1 and fmt=='s':
def __init__(self, args, fmt=''):
bbb979a9bb87723383f645121f927b77a20e734b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bbb979a9bb87723383f645121f927b77a20e734b/DT_Var.py
val = ('%'+self.fmt) % val
fmt=self.fmt if fmt=='s': val=str(val) else: val = ('%'+self.fmt) % (val,)
def render(self, md):
bbb979a9bb87723383f645121f927b77a20e734b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bbb979a9bb87723383f645121f927b77a20e734b/DT_Var.py
if meta is None: meta={}
if meta is None: meta={}
def _setProperty(self, id, value, type='string', meta=None): # Set a new property with the given id, value and optional type. # Note that different property sets may support different typing # systems. if not self.valid_property_id(id): raise 'Bad Request', 'Invalid property id.' self=self.v_self() if meta is None: met...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
def dav__propstat(self, allprop, vals, join=string.join):
def dav__propstat(self, allprop, names, join=string.join):
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
propstat='<d:propstat%s>\n' \
propstat='<d:propstat xmlns:ps="%s">\n' \
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
'%s\n' \
'%%s\n' \
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
' <d:status>HTTP/1.1 %s</d:status>\n' \ '</d:propstat>\n'
' <d:status>HTTP/1.1 %%s</d:status>\n%%s' \ '</d:propstat>\n' % self.xml_namespace() errormsg=' <d:responsedescription>%s</d:responsedescription>\n'
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
if not self.propertyMap(): return '' if not allprop and not vals:
if not allprop and not names:
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
result.append(' <ns0:%s/>' % name)
result.append(' <ps:%s/>' % name) if not result: return ''
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
nsdef=' xmlns:ns0="%s"' % self.xml_namespace() return propstat % (nsdef, result, '200 OK')
return propstat % (result, '200 OK', '')
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
for name, value in self.propertyItems(): prop=' <ns0:%s>%s</ns0:%s>' % (name, value, name)
for item in self.propertyMap(): name, type=item['id'], item.get('type','string') meta=item.get('meta', {}) value=self.getProperty(name) if type=='tokens': value=join(value, ' ') elif type=='lines': value=join(value, '\n') if meta.get('dav_xml', 0): prop=value else: prop=' <ps:%s>%s</ps:%s>' % (name, value, name)
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
nsdef=' xmlns:ns0="%s"' % self.xml_namespace() return propstat % (nsdef, result, '200 OK')
return propstat % (result, '200 OK', '')
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
xml_ns=self.xml_namespace()
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
nsdef=' xmlns:ns0="%s"' % self.xml_namespace() for name, ns in vals: if ns==xml_ns: if propdict.has_key(name):
xml_id=self.xml_namespace() for name, ns in names: if ns==xml_id: if not propdict.has_key(name): prop=' <ps:%s/>' % name emsg=errormsg % 'No such property: %s' % name result.append(propstat % (prop, '404 Not Found', emsg)) else: item=propdict[name] name, type=item['id'], item.get('type','string') meta=item.get('meta',...
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
prop=' <ns0:%s>%s</ns0:%s>' % (name, value, name) result.append(propstat % (nsdef, prop, '200 OK')) else: prop=' <ns0:%s/>' % name result.append(propstat % (nsdef, prop,'404 Not Found')) return join(result, '\n') def odav__propstat(self, url, allprop, vals, iscol, join=string.join): result=[] propstat='<d:propsta...
def dav__propstat(self, allprop, vals, join=string.join): # The dav__propstat method returns a chunk of xml containing # one or more propstat elements indicating property names, # values, errors and status codes. This is called by some # of the WebDAV support machinery. If a property set does # not support WebDAV, just...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
else: value=str(value) prop='<z:%s>%s</z:%s>' % (name, value, name) result.append(propstat % ('', prop, '200 OK')) else: prop='<n:%s/>' % name ns=' xmlns:n="%s"' % ns result.append(propstat % (ns, prop, '404 Not Found')) result='<d:response>\n' \ '<d:href>%s</d:href>\n' \ '%s\n' \ '</d:response>' % (url, join(result,...
if meta.get('dav_xml', 0): prop=value else: prop=' <ps:%s>%s</ps:%s>' % (name, value, name) result.append(propstat % (prop, '200 OK', '')) if not result: return '' return join(result, '')
def odav__propstat(self, url, allprop, vals, iscol, join=string.join): # The dav__propstat method returns an xml response element # containing one or more propstats indicating property names, # values, errors and status codes. result=[] propstat='<d:propstat>\n' \ '<d:prop%s>\n' \ '%s\n' \ '</d:prop>\n' \ '<d:status>HT...
62ae26da026a782b337b19b00b172786a89e5123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62ae26da026a782b337b19b00b172786a89e5123/PropertySheets.py
Apply the test parameters. provided by the dictionary 'argvars'.
Apply the test parameters provided by the dictionary 'argvars'.
def ZScriptHTML_tryAction(REQUEST, argvars): """
cc3b4b3c4e34065637e9d7bcd4ce6d4a218001d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cc3b4b3c4e34065637e9d7bcd4ce6d4a218001d5/Script.py
self.size = len(dumps(index)) + len(dumps(data))
sizer = _ByteCounter() pickler = Pickler(sizer, HIGHEST_PROTOCOL) pickler.dump(index) pickler.dump(data) self.size = sizer.getCount()
def __init__(self, index, data, view_name): try: # This is a protective barrier that hopefully prevents # us from caching something that might result in memory # leaks. It's also convenient for determining the # approximate memory usage of the cache entry. self.size = len(dumps(index)) + len(dumps(data)) except: raise...
bc5096504575897d674221b100d588233a8257c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bc5096504575897d674221b100d588233a8257c7/RAMCacheManager.py
start, end = ws.pos(position) text = text[:start] + before + text[start:end] + after + text[end:]
if lpos != position: lpos=position start, end = ws.pos(position) text = (text[:start] + before + text[start:end] + after + text[end:])
def highlight(self, text, positions, before, after): ws = WordSequence(text, self.synstop) positions = map(None, positions)
c30ec163a1ea2470a24ae78f3576dcc0223af124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c30ec163a1ea2470a24ae78f3576dcc0223af124/InvertedIndex.py
product=getattr(__import__("Products.%s" % product_name), product_name)
product=__import__("Products.%s" % product_name, global_dict, global_dict, silly)
def install_products(app): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products path_join=os.path.join product_dir=path_join(SOFTWARE_HOME,'Products') isdir=os.path.isdir exists=os.path.exists DictType=type({}) from Folder import Folder folder_perm...
5ca75ac9bc9b3e87204d8872f1e58ad59604c14f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5ca75ac9bc9b3e87204d8872f1e58ad59604c14f/Application.py
self.emit("insertStructure", cexpr, attrDict, [])
self.emit("insertStructure", cexpr, {}, [])
def emitOnError(self, name, onError, position): block = self.popProgram() key, expr = parseSubstitution(onError, position) cexpr = self.compileExpression(expr) if key == "text": self.emit("insertText", cexpr, []) else: assert key == "structure" self.emit("insertStructure", cexpr, attrDict, []) self.emitEndTag(name) han...
1b977b625fc2f248ed21e424233300c7b2eb06a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1b977b625fc2f248ed21e424233300c7b2eb06a9/TALGenerator.py
mod_since=DateTime(header).timeTime() last_mod =self._p_mtime
mod_since=int(DateTime(header).timeTime()) last_mod =int(self._p_mtime)
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
a51ff439e66fa8dcebaa5719bacd5c4bb951c068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a51ff439e66fa8dcebaa5719bacd5c4bb951c068/Image.py
if m.find('/'): raise 'Redirect', ( "%s/%s" % (REQUEST['URL1'], m))
if m.find('/') >= 0: prefix= m.startswith('/') and REQUEST['BASE0'] or REQUEST['URL1'] raise 'Redirect', ( "%s/%s" % (prefix, m))
def manage_workspace(self, REQUEST): """Dispatch to first interface in manage_options """ options=self.filtered_manage_options(REQUEST) try: m=options[0]['action'] if m=='manage_workspace': raise TypeError except: raise Unauthorized, ( 'You are not authorized to view this object.')
f03de0b3be7049dfc2b308e00644e4686e88a673 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f03de0b3be7049dfc2b308e00644e4686e88a673/Management.py
def declareProtected(self, permission_name, *names):
def declareProtected(self, permission_name, name, *names):
def declareProtected(self, permission_name, *names): """Declare names to be associated with a permission.""" self._setaccess(names, permission_name)
5fe40d29e3c75b0fb9e8de2e71aab493c1cab9b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5fe40d29e3c75b0fb9e8de2e71aab493c1cab9b0/SecurityInfo.py
self._setaccess(names, permission_name)
self._setaccess((name,) + names, permission_name)
def declareProtected(self, permission_name, *names): """Declare names to be associated with a permission.""" self._setaccess(names, permission_name)
5fe40d29e3c75b0fb9e8de2e71aab493c1cab9b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5fe40d29e3c75b0fb9e8de2e71aab493c1cab9b0/SecurityInfo.py
if not force: self.appendHeader('Vary', 'Accept-Encoding')
def enableHTTPCompression(self,REQUEST={},force=0,disable=0,query=0): """Enable HTTP Content Encoding with gzip compression if possible
41de516661a00b386f9df0b11ad0968a69ffa722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/41de516661a00b386f9df0b11ad0968a69ffa722/HTTPResponse.py
Append a value to a cookie
Append a value to a header.
def appendHeader(self, name, value, delimiter=","): '''\ Append a value to a cookie Sets an HTTP return header "name" with value "value", appending it following a comma if there was a previous value set for the header. ''' headers=self.headers if headers.has_key(name): h=self.header[name] h="%s%s\n\t%s" % (h,delimiter...
36e57a07af0e3923f9abef5f083a14c623c5873f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/36e57a07af0e3923f9abef5f083a14c623c5873f/HTTPResponse.py
h=self.header[name]
h=headers[name]
def appendHeader(self, name, value, delimiter=","): '''\ Append a value to a cookie Sets an HTTP return header "name" with value "value", appending it following a comma if there was a previous value set for the header. ''' headers=self.headers if headers.has_key(name): h=self.header[name] h="%s%s\n\t%s" % (h,delimiter...
36e57a07af0e3923f9abef5f083a14c623c5873f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/36e57a07af0e3923f9abef5f083a14c623c5873f/HTTPResponse.py
main()
unittest.main(defaultTest='test_suite')
def test_suite(): return unittest.makeSuite(TALESTests)
8732f7f4bec76b30fd547e018cd580135756e648 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8732f7f4bec76b30fd547e018cd580135756e648/testTALES.py
self.setHeader('content-length', len(self.body))
def insertBase(self, base_re_search=regex.compile('\(<base[\0- ]+[^>]+>\)', regex.casefold).search ): if (self.headers.has_key('content-type') and self.headers['content-type'] != 'text/html'): return
ca8854ed33903e9ddd4a8613a736cc03e5b1a8dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ca8854ed33903e9ddd4a8613a736cc03e5b1a8dc/HTTPResponse.py
raise exepctions.RuntimeError,"operator not valid: %s" % operator
raise RuntimeError,"operator not valid: %s" % operator
def _apply_index(self, request, cid='', type=type, None=None): """Apply the index to query parameters given in the request arg.
35e0afe687696e775a088facdac6ccc37e0cc7ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/35e0afe687696e775a088facdac6ccc37e0cc7ea/UnIndex.py
if hasattr(o, 'isPrincipiaFolderish') and \
if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
def tpValues(self): # Return a list of subobjects, used by tree tag. r=[] if hasattr(aq_base(self), 'tree_ids'): tree_ids=self.tree_ids try: tree_ids=list(tree_ids) except TypeError: pass if hasattr(tree_ids, 'sort'): tree_ids.sort() for id in tree_ids: if hasattr(self, id): r.append(self._getOb(id)) else: obj_ids=se...
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
files=self.objectItems()
files = list(self.objectItems())
def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=()
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
if f[1].meta_type == "Folder":
if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and f[1].isPrincipiaFolderish:
def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=()
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
else: all_files.append(f)
def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=()
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
files = list(files)
def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=()
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
lst =[] for name,child in obj.objectItems(): if child.meta_type=="Folder": lst.extend(findChildren(child,dirname+ obj.id + '/'))
lst = [] for name, child in obj.objectItems(): if hasattr(aq_base(child), 'isPrincipiaFolderish') and child.isPrincipiaFolderish: lst.extend(findChildren(child, dirname + obj.id + '/'))
def findChildren(obj,dirname=''): """ recursive walk through the object hierarchy to find all children of an object (ajung) """ lst =[] for name,child in obj.objectItems(): if child.meta_type=="Folder": lst.extend(findChildren(child,dirname+ obj.id + '/')) else: lst.append( (dirname + obj.id + "/" + name,child) ) ret...
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
lst.append( (dirname + obj.id + "/" + name,child) )
lst.append((dirname + obj.id + "/" + name, child))
def findChildren(obj,dirname=''): """ recursive walk through the object hierarchy to find all children of an object (ajung) """ lst =[] for name,child in obj.objectItems(): if child.meta_type=="Folder": lst.extend(findChildren(child,dirname+ obj.id + '/')) else: lst.append( (dirname + obj.id + "/" + name,child) ) ret...
aa16e4594e7c5987bb70b83ee24ff70996bf7aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa16e4594e7c5987bb70b83ee24ff70996bf7aa3/ObjectManager.py
w, h = struct.unpack(">LL", data[16:24])
w, h = struct.unpack(">LL", data[16:24]) self.width=str(int(w)) self.height=str(int(h))
def update_data(self, data, content_type=None, size=None): if content_type is not None: self.content_type=content_type if size is None: size=len(data)
a8bcb4e8a8c4e9bf4e6ec2740c25ec97efd6b051 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a8bcb4e8a8c4e9bf4e6ec2740c25ec97efd6b051/Image.py
ts_results = indent_tab.search_group(rest, (1,2))
ts_results = indent_tab(rest, (1,2))
def untabify(aString): '''\ Convert indentation tabs to spaces. ''' result='' rest=aString while 1: ts_results = indent_tab.search_group(rest, (1,2)) if ts_results: start, grps = ts_results lnl=len(grps[0]) indent=len(grps[1]) result=result+rest[:start] rest="\n%s%s" % (' ' * ((indent/8+1)*8), rest[start+indent+1+lnl:]...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
def indent_level(aString):
def indent_level(aString, indent_space=ts_regex.compile('\n\( *\)').search_group, ):
def indent_level(aString): '''\ Find the minimum indentation for a string, not counting blank lines. ''' start=0 text='\n'+aString indent=l=len(text) while 1: ts_results = indent_space.search_group(text, (1,2), start) if ts_results: start, grps = ts_results i=len(grps[0]) start=start+i+1 if start < l and text[start] !...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
ts_results = indent_space.search_group(text, (1,2), start)
ts_results = indent_space(text, (1,2), start)
def indent_level(aString): '''\ Find the minimum indentation for a string, not counting blank lines. ''' start=0 text='\n'+aString indent=l=len(text) while 1: ts_results = indent_space.search_group(text, (1,2), start) if ts_results: start, grps = ts_results i=len(grps[0]) start=start+i+1 if start < l and text[start] !...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
bullet=ts_regex.compile('[ \t\n]*[o*-][ \t\n]+\([^\0]*\)') example=ts_regex.compile('[\0- ]examples?:[\0- ]*$').search dl=ts_regex.compile('\([^\n]+\)[ \t]+--[ \t\n]+\([^\0]*\)') nl=ts_regex.compile('\n').search ol=ts_regex.compile('[ \t]*\(\([0-9]+\|[a-zA-Z]+\)[.)]\)+[ \t\n]+\([^\0]*\|$\)') olp=ts_regex.compile('[ \t]...
def structure(list): if not list: return [] i=0 l=len(list) r=[] while i < l: sublen=paragraphs(list,i) i=i+1 r.append((list[i-1][1],structure(list[i:i+sublen]))) i=i+sublen return r
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
def __init__(self, aStructuredString, level=0):
def __init__(self, aStructuredString, level=0, paragraph_divider=regex.compile('\(\n *\)+\n'), ):
def __init__(self, aStructuredString, level=0): '''Convert a structured text string into a structured text object.
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
em =ts_regex.compile(ctag_prefix+(ctag_middle % (("*",)*6) )+ctag_suffix) strong=ts_regex.compile(ctag_prefix+(ctag_middl2 % (("*",)*8))+ctag_suffix) under =ts_regex.compile(ctag_prefix+(ctag_middle % (("_",)*6) )+ctag_suffix) code =ts_regex.compile(ctag_prefix+(ctag_middle % (("\'",)*6))+ctag_suffix)
def __str__(self): return str(self.structure)
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
def ctag(s):
def ctag(s, em=regex.compile( ctag_prefix+(ctag_middle % (("*",)*6) )+ctag_suffix), strong=regex.compile( ctag_prefix+(ctag_middl2 % (("*",)*8))+ctag_suffix), under=regex.compile( ctag_prefix+(ctag_middle % (("_",)*6) )+ctag_suffix), code=regex.compile( ctag_prefix+(ctag_middle % (("\'",)*6))+ctag_suffix), ):
def ctag(s): if s is None: s='' s=gsub(strong,'\\1<strong>\\2</strong>\\3',s) s=gsub(under, '\\1<u>\\2</u>\\3',s) s=gsub(code, '\\1<code>\\2</code>\\3',s) s=gsub(em, '\\1<em>\\2</em>\\3',s) return s
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
extra_dl=ts_regex.compile("</dl>\n<dl>"), extra_ul=ts_regex.compile("</ul>\n<ul>"), extra_ol=ts_regex.compile("</ol>\n<ol>"),
extra_dl=regex.compile("</dl>\n<dl>"), extra_ul=regex.compile("</ul>\n<ul>"), extra_ol=regex.compile("</ol>\n<ol>"),
def __str__(self, extra_dl=ts_regex.compile("</dl>\n<dl>"), extra_ul=ts_regex.compile("</ul>\n<ul>"), extra_ol=ts_regex.compile("</ol>\n<ol>"), ): '''\ Return an HTML string representation of the structured text data.
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
def _str(self,structure,level):
def _str(self,structure,level, bullet=ts_regex.compile('[ \t\n]*[o*-][ \t\n]+\([^\0]*\)' ).match_group, example=ts_regex.compile('[\0- ]examples?:[\0- ]*$' ).search, dl=ts_regex.compile('\([^\n]+\)[ \t]+--[ \t\n]+\([^\0]*\)' ).match_group, nl=ts_regex.compile('\n').search, ol=ts_regex.compile( '[ \t]*\(\([0-9]+\|[a-zA...
def _str(self,structure,level): r='' for s in structure: # print s[0],'\n', len(s[1]), '\n\n' ts_results = bullet.match_group(s[0], (1,)) if ts_results: p = ts_results[1] r=self.ul(r,p,self._str(s[1],level)) else: ts_results = ol.match_group(s[0], (3,)) if ts_results: p = ts_results[1] r=self.ol(r,p,self._str(s[1],lev...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
ts_results = bullet.match_group(s[0], (1,))
ts_results = bullet(s[0], (1,))
def _str(self,structure,level): r='' for s in structure: # print s[0],'\n', len(s[1]), '\n\n' ts_results = bullet.match_group(s[0], (1,)) if ts_results: p = ts_results[1] r=self.ul(r,p,self._str(s[1],level)) else: ts_results = ol.match_group(s[0], (3,)) if ts_results: p = ts_results[1] r=self.ol(r,p,self._str(s[1],lev...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
ts_results = ol.match_group(s[0], (3,))
ts_results = ol(s[0], (3,))
def _str(self,structure,level): r='' for s in structure: # print s[0],'\n', len(s[1]), '\n\n' ts_results = bullet.match_group(s[0], (1,)) if ts_results: p = ts_results[1] r=self.ul(r,p,self._str(s[1],level)) else: ts_results = ol.match_group(s[0], (3,)) if ts_results: p = ts_results[1] r=self.ol(r,p,self._str(s[1],lev...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
ts_results = olp.match_group(s[0], (1,))
ts_results = olp(s[0], (1,))
def _str(self,structure,level): r='' for s in structure: # print s[0],'\n', len(s[1]), '\n\n' ts_results = bullet.match_group(s[0], (1,)) if ts_results: p = ts_results[1] r=self.ul(r,p,self._str(s[1],level)) else: ts_results = ol.match_group(s[0], (3,)) if ts_results: p = ts_results[1] r=self.ol(r,p,self._str(s[1],lev...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py
ts_results = dl.match_group(s[0], (1,2))
ts_results = dl(s[0], (1,2))
def _str(self,structure,level): r='' for s in structure: # print s[0],'\n', len(s[1]), '\n\n' ts_results = bullet.match_group(s[0], (1,)) if ts_results: p = ts_results[1] r=self.ul(r,p,self._str(s[1],level)) else: ts_results = ol.match_group(s[0], (3,)) if ts_results: p = ts_results[1] r=self.ol(r,p,self._str(s[1],lev...
b0fc40be7f6311ce8b53427d0435318a0e976412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0fc40be7f6311ce8b53427d0435318a0e976412/StructuredText.py