rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
if 'Shared' in roles: | if 'Shared' in object_roles: | def allowed(self, object, object_roles=None): """Check whether the user has access to object, assuming that object.__roles__ is the given roles.""" if object_roles is None or 'Anonymous' in object_roles: return 1 usr_roles=self.getRolesInContext(object) for role in object_roles: if role in usr_roles: # The user apparen... | 995ab4d721e0d0e83a1b565d61aad7f69e7f302a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/995ab4d721e0d0e83a1b565d61aad7f69e7f302a/User.py |
roles=self._shared_roles(object) if roles is None or 'Anonymous' in roles: return 1 while 'Shared' in roles: roles.remove('Shared') return self.allowed(object,roles) | object_roles=self._shared_roles(object) if object_roles is None or 'Anonymous' in object_roles: return 1 while 'Shared' in object_roles: object_roles.remove('Shared') return self.allowed(object,object_roles) | def allowed(self, object, object_roles=None): """Check whether the user has access to object, assuming that object.__roles__ is the given roles.""" if object_roles is None or 'Anonymous' in object_roles: return 1 usr_roles=self.getRolesInContext(object) for role in object_roles: if role in usr_roles: # The user apparen... | 995ab4d721e0d0e83a1b565d61aad7f69e7f302a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/995ab4d721e0d0e83a1b565d61aad7f69e7f302a/User.py |
return self.manage_main(self, REQUEST, cb_dataValid=1) | REQUEST['__cp'] = cp return self.manage_main(REQUEST) | def manage_cutObjects(self, ids=None, REQUEST=None): """Put a reference to the objects named in ids in the clip board""" if ids is None and REQUEST is not None: return eNoItemsSpecified elif ids is None: raise ValueError, 'ids must be specified' | 559d3b90df51a36d4e23565e889fa99b3663fca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/559d3b90df51a36d4e23565e889fa99b3663fca6/CopySupport.py |
return self.manage_main(self, REQUEST, cb_dataValid=1) | REQUEST['__cp'] = cp return self.manage_main(REQUEST) | def manage_copyObjects(self, ids=None, REQUEST=None, RESPONSE=None): """Put a reference to the objects named in ids in the clip board""" if ids is None and REQUEST is not None: return eNoItemsSpecified elif ids is None: raise ValueError, 'ids must be specified' | 559d3b90df51a36d4e23565e889fa99b3663fca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/559d3b90df51a36d4e23565e889fa99b3663fca6/CopySupport.py |
if v: v="CHECKET" | if v: v="CHECKED" | def _booleanInput(self,n,t,v): | 197cce8df3c342feb7c2599c5bf774d2323e5eb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/197cce8df3c342feb7c2599c5bf774d2323e5eb1/ObjectManager.py |
return ('<INPUT TYPE= "CHECKBOX" NAME="%s:%s" SIZE="50" %s></TD>' | return ('<INPUT TYPE="CHECKBOX" NAME="%s:%s" SIZE="50" %s></TD>' | def _booleanInput(self,n,t,v): | 197cce8df3c342feb7c2599c5bf774d2323e5eb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/197cce8df3c342feb7c2599c5bf774d2323e5eb1/ObjectManager.py |
'boolean': _booleanInput, | def _textInput(self,n,t,v): return ('<TEXTAREA NAME="%s" ROWS="10" COLS="50">%s</TEXTAREA>' | 197cce8df3c342feb7c2599c5bf774d2323e5eb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/197cce8df3c342feb7c2599c5bf774d2323e5eb1/ObjectManager.py | |
d=j(j(CUSTOMER_HOME,'var'),'gadfly') | d=j(j(INSTANCE_HOME,'var'),'gadfly') | def manage_addZGadflyConnection( self, id, title, connection, check=None, REQUEST=None): " " return getDA().manage_addZGadflyConnection( self, id, title, connection, check, REQUEST) | 4332e29bcd3f09c6d81fd5aaf961aa874f1548c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4332e29bcd3f09c6d81fd5aaf961aa874f1548c4/__init__.py |
errend = find(text, '-->') | errend = text.find('-->') | def write(self, text): assert type(text) is type('') if text[:len(self._error_start)] == self._error_start: errend = find(text, '-->') if errend >= 0: text = text[errend + 4:] if self._text != text: self._text = text self._cook() | 879a01f01b863516658d2296441f4e5fdfc6fa62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/879a01f01b863516658d2296441f4e5fdfc6fa62/PageTemplate.py |
if not exists(path_join(package_dir, '__init__.py')): continue | if not exists(path_join(package_dir, '__init__.py')): if not exists(path_join(package_dir, '__init__.pyc')): continue | def install_products(): # 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,'lib/python/Products') isdir=os.path.isdir exists=os.path.exists DictType=type({}) meta_types=list(Folder.Folder... | 663b0e0d5654a16d65dc52ffdd80ea0714b96d87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/663b0e0d5654a16d65dc52ffdd80ea0714b96d87/Application.py |
env['PATH_TRANSLATED']= os.path.normpath( os.path.join(os.getcwd(), env['PATH_INFO'])) | env['PATH_TRANSLATED']= posixpath.normpath( posixpath.join(os.getcwd(), env['PATH_INFO'])) | def get_env(self, req): env = self._ENV.copy() (path, params, query, fragment) = req.split_uri() if params: path = path + params # undo medusa bug while path and path[0] == '/': path = path[1:] if '%' in path: path = unquote(path) if query: # ZPublisher doesn't want the leading '?' query = query[1:] env['PATH_INFO']= '... | f8eab23b81963af0405e9be57ece55b7fef6f25b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8eab23b81963af0405e9be57ece55b7fef6f25b/ClockServer.py |
s = open(fn).read() | s = open(fn).read().strip() | def _prep_version_data(): global _version_string, _zope_version if _version_string is None: v = sys.version_info pyver = "python %d.%d.%d, %s" % (v[0], v[1], v[2], sys.platform) cfg = getConfiguration() fn = os.path.join(cfg.softwarehome, 'version.txt') expr = re.compile( r'(?P<product>[A-Za-z0-9]+) +(?P<major>[0-9]+)'... | b593571d86fc78f6472c9d2c553a3a10efb32e81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b593571d86fc78f6472c9d2c553a3a10efb32e81/version_txt.py |
doc, localName = self.engine.findMacroDocument(macroName) if not doc: macro = self.macros[localName] else: macroDict = macroIndexer(doc) if not macroDict.has_key(localName): print "Macro", macroName, "not found" return macroNode = macroDict[localName] macro, dummy = TALCompiler(macroNode)() | macro = self.engine.evaluateMacro(macroName) | def do_useMacro(self, macroName, compiledSlots): doc, localName = self.engine.findMacroDocument(macroName) if not doc: # Local macro macro = self.macros[localName] else: # External macro macroDict = macroIndexer(doc) if not macroDict.has_key(localName): print "Macro", macroName, "not found" return macroNode = macroDict... | b45815367f9a39076c922a0a6561ab276b1e1972 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b45815367f9a39076c922a0a6561ab276b1e1972/TALInterpreter.py |
<select name="<!-- | <select name="%(id)s"> | def _edit_widget_for_type(self, t, id, p): if t in ('int', 'long', 'float', 'date', 'string'): if t=='string': q=' html_quote' else: q='' return (''' <input name="%s:%s" size="35" value="<!--#var %s%s-->">''' % (id, t, id, q) ) if t=='boolean': return (''' <input type="checkbox" name="%s:boolean" size="35" <!--#if %s--... | 2812d8e5f082b6b063ca272b9bb14ea18773083a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2812d8e5f082b6b063ca272b9bb14ea18773083a/Property.py |
working directory. This is the default if no options are specified. | working directory. | 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... | dc50791ca5f2ca00bea841eb5f02d505400400c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dc50791ca5f2ca00bea841eb5f02d505400400c3/testrunner.py |
self._delObject(id) | def manage_renameObject(self, id, new_id, REQUEST=None): """Rename a particular sub-object""" try: self._checkId(new_id) except: raise CopyError, MessageDialog( title='Invalid Id', message=sys.exc_info()[1], action ='manage_main') ob=self._getOb(id) if not ob.cb_isMoveable(): raise CopyError, eNotSupported % id self._v... | bca2545e5b0bda0be3f0e956ea57df5bff0f2876 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bca2545e5b0bda0be3f0e956ea57df5bff0f2876/CopySupport.py | |
key = self.getBrowserIdManager().getToken(create=0) if key: if self._hasSessionDataObject(key): return 1 | return not not self.getSessionData(create=0) | def hasSessionData(self): """ """ key = self.getBrowserIdManager().getToken(create=0) if key: if self._hasSessionDataObject(key): return 1 | 67b8dd175c3ef74d2bcdc7855fd892673337035e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/67b8dd175c3ef74d2bcdc7855fd892673337035e/SessionDataManager.py |
$Id: Publish.py,v 1.8 1996/07/18 14:59:54 jfulton Exp $""" | $Id: Publish.py,v 1.9 1996/07/23 19:59:29 jfulton Exp $""" | def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
__version__='$Revision: 1.8 $'[11:-2] | __version__='$Revision: 1.9 $'[11:-2] | def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
except TypeError: | except (TypeError,AttributeError): | def publish(self, module_name, published='web_objects', | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
('Documentation for' + | ('Documentation for ' + | def publish(self, module_name, published='web_objects', | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
try: transaction=get_transaction() transaction.begin() except: transaction=None | def function_with_empty_signature(): pass | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py | |
def flatten_field(v,converter): | def flatten_field(v,converter=None): | def flatten_field(v,converter): if type(v) is types.ListType: if len(v) > 1: return map(flatten_field,v) v=v[0] try: if v.file: v=v.file else: v=v.value except: pass if converter: v=converter(v) return v | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
""" | """ | def __getitem__(self,key): | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
if b[-1]=='/': b=b[:-1] | while b and b[-1]=='/': b=b[:-1] | def __init__(self, | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
if p >= 0: self.base=b[:p+1] else: self.base='' | if p >= 0: b=b[:p+1] else: b='' while b and b[0]=='/': b=b[1:] try: server_url= string.strip(self.environ['SERVER_URL' ]) except: server_url='http://'+string.strip(self.environ['SERVER_NAME']) self.base="%s/%s" % (server_url,b) | def __init__(self, | 2418690bd14be709545ae105d236c1ebadc220dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2418690bd14be709545ae105d236c1ebadc220dc/Publish.py |
+RoleManager.manage_options | def add(self, id, title='', smtp_host=None, localhost='localhost', smtp_port=25, timeout=1.0, REQUEST=None): ' add a MailHost into the system ' id=str(id) title=str(title) if smtp_host is not None: smtp_host=str(smtp_host) if type(smtp_port) is not type(1): smtp_port=string.atoi(smtp_port) i=MailHost() #cr... | 9882dc71a67c04933aa92feee065a21bc8b37c0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9882dc71a67c04933aa92feee065a21bc8b37c0a/MailHost.py | |
meth=None | def __init__(self, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr, environ=os.environ): self.environ=environ fp=None try: if environ['REQUEST_METHOD'] != 'GET': fp=stdin except: pass | 92a74752f5cd31a09a53655ad29c0cb89bc40018 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92a74752f5cd31a09a53655ad29c0cb89bc40018/Publish.py | |
if not string.strip(part): break raise TALError("invalid z:define syntax: " + `part`) | raise TALError("invalid define syntax: " + `part`) | def emitDefines(self, defines): for part in splitParts(defines): m = re.match( r"\s*(?:(global|local)\s+)?(%s)\s+(.*)" % NAME_RE, part) if not m: if not string.strip(part): break # extra space after semi raise TALError("invalid z:define syntax: " + `part`) scope, name, expr = m.group(1, 2, 3) scope = scope or "local" c... | be82517174cba087c9d9be7c22b930a94d28ef72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/be82517174cba087c9d9be7c22b930a94d28ef72/TALGenerator.py |
raise TALError("invalid z:repeat syntax: " + `repeat`) | raise TALError("invalid repeat syntax: " + `repeat`) | def emitRepeat(self, arg): m = re.match("\s*(%s)\s+(.*)" % NAME_RE, arg) if not m: raise TALError("invalid z:repeat syntax: " + `repeat`) name, expr = m.group(1, 2) cexpr = self.compileExpression(expr) program = self.popProgram() self.emit("loop", name, cexpr, program) | be82517174cba087c9d9be7c22b930a94d28ef72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/be82517174cba087c9d9be7c22b930a94d28ef72/TALGenerator.py |
raise TALError("Bad syntax in z:insert/z:replace: " + `arg`) | raise TALError("Bad syntax in insert/replace: " + `arg`) | def emitSubstitution(self, arg, attrDict={}): key, expr = parseSubstitution(arg) if not key: raise TALError("Bad syntax in z:insert/z:replace: " + `arg`) cexpr = self.compileExpression(expr) program = self.popProgram() if key == "text": self.emit("insertText", cexpr, program) else: assert key == "structure" self.emit("... | be82517174cba087c9d9be7c22b930a94d28ef72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/be82517174cba087c9d9be7c22b930a94d28ef72/TALGenerator.py |
<<<<<<< Application.py examples_path = os.path.join(Globals.INSTANCE_HOME, 'import', 'Examples.zexp') ======= | 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 ... | af157ae624c0eef2a776539a9ec7004d025242bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/af157ae624c0eef2a776539a9ec7004d025242bd/Application.py | |
>>>>>>> 1.176.2.2 | 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 ... | af157ae624c0eef2a776539a9ec7004d025242bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/af157ae624c0eef2a776539a9ec7004d025242bd/Application.py | |
else: del attr.__roles__ | else: try: del attr.__roles__ except: pass | def delRoles(self, roles): | 191a9d6075aa9c1751283cdf093587f732469cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/191a9d6075aa9c1751283cdf093587f732469cb2/Role.py |
self.obj =obj | if hasattr(obj, 'aq_self'): obj=obj.aq_self self.obj=obj | def __init__(self,name,data,obj): | 191a9d6075aa9c1751283cdf093587f732469cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/191a9d6075aa9c1751283cdf093587f732469cb2/Role.py |
def marshal_long(n,f): return ('%s:long=%s' % (n,f))[:-1] | def marshal_long(n,f): value = '%s:long=%s' % (n, f) if value[-1] == 'L': value = value[:-1] return value | def marshal_long(n,f): return ('%s:long=%s' % (n,f))[:-1] | 1392c45f67e3b1855fc7b3b70d155dfad722cdb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1392c45f67e3b1855fc7b3b70d155dfad722cdb0/Client.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... | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/ObjectManager.py |
files=self.objectItems() | files = list(self.objectItems()) | def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=() | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/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=() | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/ObjectManager.py |
else: all_files.append(f) | def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=() | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/ObjectManager.py | |
files = list(files) | def manage_FTPlist(self, REQUEST): """Directory listing for FTP. """ out=() | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/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... | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/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... | 62fd608a28a6ec86172e8ef8adbd0362880180ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62fd608a28a6ec86172e8ef8adbd0362880180ad/ObjectManager.py |
elif name=='secure': cookie = '%s; Secure' % cookie | elif name=='secure' and v: cookie = '%s; Secure' % cookie | def _cookie_list(self): cookie_list=[] for name, attrs in self.cookies.items(): | 0b1bdf0e0240874e7f16a4b70e6890d9dd9e4e9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0b1bdf0e0240874e7f16a4b70e6890d9dd9e4e9b/HTTPResponse.py |
entry = (permission_name, tuple(names), tuple(roles)) | entry = (permission_name, tuple(names), tuple(roles.keys())) | def apply(self, classobj): """Apply security information to the given class object.""" dict = classobj.__dict__ | c3a2e1fb2807990ba4e2fd20d2ea00d695069d81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c3a2e1fb2807990ba4e2fd20d2ea00d695069d81/SecurityInfo.py |
self.emit("startTag", node.nodeName, getAttributeList(node)) | self.emit("startTag", node.nodeName, self.getFullAttrList(node)) | def emitStartTag(self, node): self.emit("startTag", node.nodeName, getAttributeList(node)) | c659402696fad3dd11679a2cf8e453db705b8578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c659402696fad3dd11679a2cf8e453db705b8578/TALCompiler.py |
self.emit("startEndTag", node.nodeName, getAttributeList(node)) | self.emit("startEndTag", node.nodeName, self.getFullAttrList(node)) | def emitStartEndTag(self, node): self.emit("startEndTag", node.nodeName, getAttributeList(node)) | c659402696fad3dd11679a2cf8e453db705b8578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c659402696fad3dd11679a2cf8e453db705b8578/TALCompiler.py |
return | else: self.expandElement(node) self.popNS() def expandElement(self, node): | def visitElement(self, node): if not node.hasAttributes(): self.emitElement(node) return macroName = node.getAttributeNS(ZOPE_METAL_NS, "use-macro") if macroName: slotDict = slotIndexer(node) compiledSlots = {} if slotDict: # Compile the slots for slotName, slotNode in slotDict.items(): self.pushProgram() self.visitEle... | c659402696fad3dd11679a2cf8e453db705b8578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c659402696fad3dd11679a2cf8e453db705b8578/TALCompiler.py |
c = ctxt.vars | def testVariables(self): '''Test variables''' ctxt = self.getContext() c = ctxt.vars ctxt.beginScope() ctxt.setLocal('v1', 1) ctxt.setLocal('v2', 2) | 718fe8f2b6cc327d54dd1185c84c9a2d5b95e557 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/718fe8f2b6cc327d54dd1185c84c9a2d5b95e557/testTALES.py | |
self._old = __builtins__.__dict__.get('INSTANCE_HOME') __builtins__.INSTANCE_HOME = os.path.split( | self._old = builtinsdict.get('INSTANCE_HOME') builtinsdict['INSTANCE_HOME'] = os.path.split( | def setUp(self): self._old = __builtins__.__dict__.get('INSTANCE_HOME') __builtins__.INSTANCE_HOME = os.path.split( Products.ExternalMethod.tests.__file__)[0] | 47d61f5bc90934cf904d9d02ca7df29c13400cf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/47d61f5bc90934cf904d9d02ca7df29c13400cf9/testExternalMethod.py |
del __builtins__.INSTANCE_HOME | del builtinsdict['INSTANCE_HOME'] | def tearDown(self): if self._old is None: del __builtins__.INSTANCE_HOME else: __builtins__.INSTANCE_HOME = self._old | 47d61f5bc90934cf904d9d02ca7df29c13400cf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/47d61f5bc90934cf904d9d02ca7df29c13400cf9/testExternalMethod.py |
__builtins__.INSTANCE_HOME = self._old | builtinsdict['INSTANCE_HOME'] = self._old | def tearDown(self): if self._old is None: del __builtins__.INSTANCE_HOME else: __builtins__.INSTANCE_HOME = self._old | 47d61f5bc90934cf904d9d02ca7df29c13400cf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/47d61f5bc90934cf904d9d02ca7df29c13400cf9/testExternalMethod.py |
if not hasattr(fs,'list'): form['BODY']=other['BODY']=fs.value | if not hasattr(fs,'list') or fs.list is None: form['BODY']=other['BODY']=fs.value | def __init__(self, | 5a194cb1e8ac4dfaf8df47395c0af4d00c62b4dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5a194cb1e8ac4dfaf8df47395c0af4d00c62b4dc/Publish.py |
if getattr(last, 'id', last) is not last: | if getattr(last, 'id', last) is last: | def load_binput(self): i = mloads('i' + self.read(1) + '\000\000\000') last = self.stack[-1] if getattr(last, 'id', last) is not last: last.id = self.idprefix + `i` | 717644bc08c45fa49539a37b8bb3b30ba10cba78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/717644bc08c45fa49539a37b8bb3b30ba10cba78/ppml.py |
if getattr(last, 'id', last) is not last: | if getattr(last, 'id', last) is last: | def load_long_binput(self): i = mloads('i' + self.read(4)) last = self.stack[-1] if getattr(last, 'id', last) is not last: last.id = self.idprefix + `i` | 717644bc08c45fa49539a37b8bb3b30ba10cba78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/717644bc08c45fa49539a37b8bb3b30ba10cba78/ppml.py |
'pickle': lambda self, tag, data: data[2]+'.', | 'pickle': lambda self, tag, data: str(data[2])+'.', | def save_persis(self, tag, data): v=data[2] if self.binary: v=v+'Q' else: v='P'+v return v | 717644bc08c45fa49539a37b8bb3b30ba10cba78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/717644bc08c45fa49539a37b8bb3b30ba10cba78/ppml.py |
'long': lambda self, tag, data: 'L'+data[2]+'L\012', | 'long': lambda self, tag, data: 'L'+str(data[2])+'L\012', | def save_persis(self, tag, data): v=data[2] if self.binary: v=v+'Q' else: v='P'+v return v | 717644bc08c45fa49539a37b8bb3b30ba10cba78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/717644bc08c45fa49539a37b8bb3b30ba10cba78/ppml.py |
from DocumentTemplate import HTML, String | from DocumentTemplate.DT_HTML import HTML, String | def read_file(name): f = open(os.path.join(here, name), 'rb') res = f.read() f.close() return res | 23543b7fa8d141189b49c2fe2eedd8cb945e120a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23543b7fa8d141189b49c2fe2eedd8cb945e120a/testDTML.py |
if v is not None: v(self.namespace,inst,key,r) | if v is not None: v(inst,inst,key,r,self.namespace) | def __getitem__(self,key): | e0fbaf588daa74aaa81a4b0b7dc28154a3ba9596 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e0fbaf588daa74aaa81a4b0b7dc28154a3ba9596/pDocumentTemplate.py |
r=1 | def careful_mul(env, *factors): s=None r=1 for factor in factors: try: l=len(factor) s=1 except: l=factor if s and (l*r) > 1000: raise TypeError, 'Illegal sequence repeat' r=r*factor return r | 43726a52b76a685ace800472f23a7b19da37de37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/43726a52b76a685ace800472f23a7b19da37de37/VSEval.py | |
except: l=factor if s and (l*r) > 1000: raise TypeError, 'Illegal sequence repeat' | except TypeError: c=c*factor if s and c > 1000: raise TypeError, \ 'Illegal sequence repeat (too many repetitions: %d)' % c | def careful_mul(env, *factors): s=None r=1 for factor in factors: try: l=len(factor) s=1 except: l=factor if s and (l*r) > 1000: raise TypeError, 'Illegal sequence repeat' r=r*factor return r | 43726a52b76a685ace800472f23a7b19da37de37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/43726a52b76a685ace800472f23a7b19da37de37/VSEval.py |
def careful_mul(env, *factors): s=None r=1 for factor in factors: try: l=len(factor) s=1 except: l=factor if s and (l*r) > 1000: raise TypeError, 'Illegal sequence repeat' r=r*factor return r | 43726a52b76a685ace800472f23a7b19da37de37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/43726a52b76a685ace800472f23a7b19da37de37/VSEval.py | ||
def dav__propstat(self, name, propstat=propstat, propdesc=propdesc, | def dav__propstat(self, name, result, propstat=propstat, propdesc=propdesc, join=string.join): xml_id=self.xml_namespace() propdict=self._propdict() if not propdict.has_key(name): prop='<n:%s xmlns:n="%s"/>\n' % (name, xml_id) code='404 Not Found' if not result.has_key(code): result[code]=[prop] else: result[code].a... | def dav__propstat(self, name, propstat=propstat, propdesc=propdesc, join=string.join): # DAV helper method - return a propstat element indicating # property name and value for the requested property. xml_id=self.xml_namespace() propdict=self._propdict() if not propdict.has_key(name): prop=' <n:%s/>' % name error=propd... | eaf5dcbe814f97576ad852572b7bebdeb8cb55b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eaf5dcbe814f97576ad852572b7bebdeb8cb55b8/PropertySheets.py |
if parent is None: return fields return fields.__of__(parent) | return fields | def __getitem__(self,index): if index==self._index: return self._row parent=self._parent fields=self._class(self._data[index], parent) self._index=index self._row=fields if parent is None: return fields return fields.__of__(parent) | 0badf153d8aaa1c59683ff1e71050828cf00ca4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0badf153d8aaa1c59683ff1e71050828cf00ca4f/Results.py |
type = "var" | type = "path" | def evaluate(self, expression): m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression) if m: type, expr = m.group(1, 2) else: type = "var" expr = expression if type == "str": return expr if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "v... | b27a4c428030f2a4a0260d005b057b59964935e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b27a4c428030f2a4a0260d005b057b59964935e9/DummyEngine.py |
if type == "str": | if type in ("string", "str"): | def evaluate(self, expression): m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression) if m: type, expr = m.group(1, 2) else: type = "var" expr = expression if type == "str": return expr if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "v... | b27a4c428030f2a4a0260d005b057b59964935e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b27a4c428030f2a4a0260d005b057b59964935e9/DummyEngine.py |
if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "var": | if type in ("path", "var", "global", "local"): | def evaluate(self, expression): m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression) if m: type, expr = m.group(1, 2) else: type = "var" expr = expression if type == "str": return expr if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "v... | b27a4c428030f2a4a0260d005b057b59964935e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b27a4c428030f2a4a0260d005b057b59964935e9/DummyEngine.py |
return self.globals[expr] | raise TALESError("unknown variable: %s", expr) if type == "not": v = self.evaluate(expr) return not v if type == "exists": return self.locals.has_key(expr) or self.globals.has_key(expr) | def evaluate(self, expression): m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression) if m: type, expr = m.group(1, 2) else: type = "var" expr = expression if type == "str": return expr if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "v... | b27a4c428030f2a4a0260d005b057b59964935e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b27a4c428030f2a4a0260d005b057b59964935e9/DummyEngine.py |
return eval(expr, self.globals, self.locals) | try: return eval(expr, self.globals, self.locals) except: t, v, tb = info = sys.exc_info() raise TALESError("evaluation error in %s" % `expr`, info=sys.exc_info()) | def evaluate(self, expression): m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression) if m: type, expr = m.group(1, 2) else: type = "var" expr = expression if type == "str": return expr if type == "local": return self.locals[string.strip(expr)] if type == "global": return self.globals[string.strip(expr)] if type == "v... | b27a4c428030f2a4a0260d005b057b59964935e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b27a4c428030f2a4a0260d005b057b59964935e9/DummyEngine.py |
sdc = root['folder'] = OFS.Folder.Folder() | sdc = root['folder'] = Folder() | def _getMountRoot(self, root): sdc = root.get('folder', None) if sdc is None: sdc = root['folder'] = OFS.Folder.Folder() self._populate(sdc, root) | 77cfe5909cf47f4f7aae2217cd711a348d3ac527 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/77cfe5909cf47f4f7aae2217cd711a348d3ac527/TemporaryFolder.py |
_v_rcs=None _v_rst=None | def db_size(self): if Globals.DatabaseVersion=='2': s=os.stat(self.db_name())[6] else: s=self._p_jar.db().getSize() if s >= 1048576.0: return '%.1fM' % (s/1048576.0) return '%.1fK' % (s/1024.0) | c8fa7d8a049f215f4bd03d4294a7e526676a458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c8fa7d8a049f215f4bd03d4294a7e526676a458b/ApplicationManager.py | |
self._v_rcs=self.refdict() self._v_rst=DateTime() | global _v_rcs global _v_rst _v_rcs=self.refdict() _v_rst=DateTime() | def rcsnapshot(self): self._v_rcs=self.refdict() self._v_rst=DateTime() | c8fa7d8a049f215f4bd03d4294a7e526676a458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c8fa7d8a049f215f4bd03d4294a7e526676a458b/ApplicationManager.py |
return self._v_rst | return _v_rst | def rcdate(self): return self._v_rst | c8fa7d8a049f215f4bd03d4294a7e526676a458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c8fa7d8a049f215f4bd03d4294a7e526676a458b/ApplicationManager.py |
if self._v_rcs is None: | if _v_rcs is None: | def rcdeltas(self): if self._v_rcs is None: self.rcsnapshot() nc=self.refdict() rc=self._v_rcs rd=[] for n, c in nc.items(): prev=rc[n] if c > prev: rd.append( (c - prev, (c, prev, n)) ) rd.sort() rd.reverse() | c8fa7d8a049f215f4bd03d4294a7e526676a458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c8fa7d8a049f215f4bd03d4294a7e526676a458b/ApplicationManager.py |
rc=self._v_rcs | rc=_v_rcs | def rcdeltas(self): if self._v_rcs is None: self.rcsnapshot() nc=self.refdict() rc=self._v_rcs rd=[] for n, c in nc.items(): prev=rc[n] if c > prev: rd.append( (c - prev, (c, prev, n)) ) rd.sort() rd.reverse() | c8fa7d8a049f215f4bd03d4294a7e526676a458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c8fa7d8a049f215f4bd03d4294a7e526676a458b/ApplicationManager.py |
meta_type='', CreateFactory=0, REQUEST=None): | meta_type='', CreateAFactory=0, REQUEST=None): | def manage_addZClass(self, id, title='', baseclasses=[], meta_type='', CreateFactory=0, REQUEST=None): """Add a Z Class """ bases=[] for b in baseclasses: if Products.meta_classes.has_key(b): bases.append(Products.meta_classes[b]) else: base=find_class(self, b) bases.append(base) Z=ZClass(id,title,bases) if meta_type... | 1940792881cb2309996c475bf00cedcbb6892aef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1940792881cb2309996c475bf00cedcbb6892aef/ZClass.py |
if flags&records: | if flags&RECORDS: | def __init__(self, stdin, environ, response, clean=0, # "static" variables that we want to be local for speed SEQUENCE=1, DEFAULT=2, RECORD=4, RECORDS=8, REC=12, # RECORD|RECORDS EMPTY=16, CONVERTED=32, hasattr=hasattr, getattr=getattr, setattr=setattr, search_type=regex.compile( ':[a-zA-Z][a-zA-Z0-9_]+$' ).search, rfi... | 61eaceb62f9e9cbb359b1947fb1d0a2c8c506379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/61eaceb62f9e9cbb359b1947fb1d0a2c8c506379/HTTPRequest.py |
positions = v[1] + value[1] | positions = map(None, v[1] + value[1]) | 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 | 9407653d9fadbe33c9539677333c5ee5c1da312c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9407653d9fadbe33c9539677333c5ee5c1da312c/InvertedIndex.py |
val = md[name] | if have_arg('url'): val=md.getitem(name,0) val=val.absolute_url() else: val = md[name] | def render(self, md): args=self.args have_arg=args.has_key name=self.__name__ | 44efe88b5ca439fc0763ca96134b1023b2cb198e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/44efe88b5ca439fc0763ca96134b1023b2cb198e/DT_Var.py |
raise KeyError | raise KeyError, name | def render(self, md): args=self.args have_arg=args.has_key name=self.__name__ | 44efe88b5ca439fc0763ca96134b1023b2cb198e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/44efe88b5ca439fc0763ca96134b1023b2cb198e/DT_Var.py |
if have_arg('url'): val=val.absolute_url() | def render(self, md): args=self.args have_arg=args.has_key name=self.__name__ | 44efe88b5ca439fc0763ca96134b1023b2cb198e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/44efe88b5ca439fc0763ca96134b1023b2cb198e/DT_Var.py | |
return () | return () | def tpValues(self): | 29754727407f3e81d09c0781576d9a7cf05c4c8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/29754727407f3e81d09c0781576d9a7cf05c4c8e/SimpleItem.py |
elif module[-4:]=='.py': module=module[:-4] | elif module[-4:]=='.pyc': module=module[:-4] | def manage_edit(self, title, module, function, REQUEST=None): """Change the external method | 50430b60e98b50a3cc2dd514f50b5594ac4cdbfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/50430b60e98b50a3cc2dd514f50b5594ac4cdbfc/ExternalMethod.py |
def redirect(self, location, status=302): | def redirect(self, location, status=302, lock=0): | def redirect(self, location, status=302): """Cause a redirection without raising an error""" self.setStatus(status) self.setHeader('Location', location) | 8deb5f2bdbec3082a99cd377cf9b6b01ac4e27d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8deb5f2bdbec3082a99cd377cf9b6b01ac4e27d4/HTTPResponse.py |
self._locked_status = 1 | if lock: self._locked_status = 1 | def redirect(self, location, status=302): """Cause a redirection without raising an error""" self.setStatus(status) self.setHeader('Location', location) | 8deb5f2bdbec3082a99cd377cf9b6b01ac4e27d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8deb5f2bdbec3082a99cd377cf9b6b01ac4e27d4/HTTPResponse.py |
manage_options=Folder.manage_options+( {'label':'Distribution', 'action':'manage_distributionView'}, ) | manage_options=( {'label':'Contents', 'action':'manage_main'}, {'label':'Properties', 'action':'manage_propertiesForm'}, {'label':'Security', 'action':'manage_access'}, {'label':'Undo', 'action':'manage_UndoForm'}, {'label':'Find', 'action':'manage_findFrame'}, {'label':'Distribution', 'action':'manage_distributionView... | def new_version(self, _intending=regex.compile("[.]?[0-9]+$").search, ): # Return a new version number based on the existing version. v=str(self.version) if not v: return '1.0' if _intending(v) < 0: return v l=rfind(v,'.') return v[:l+1]+str(1+atoi(v[l+1:])) | e967b5053236b6c81de831c9e954a2230c2aa600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e967b5053236b6c81de831c9e954a2230c2aa600/Product.py |
def manage_addPropertySheet(self, id, ns): | def manage_addPropertySheet(self, id, ns, REQUEST=None): | def manage_addPropertySheet(self, id, ns): """ """ md={'xmlns':ns} ps=PropertySheet(id, md) self.addPropertySheet(ps) return 'OK' | 94603fc92aaaea303d2f1c60e52011a01b1deb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/94603fc92aaaea303d2f1c60e52011a01b1deb28/PropertySheets.py |
ps=PropertySheet(id, md) | ps= self.PropertySheetClass(id, md) | def manage_addPropertySheet(self, id, ns): """ """ md={'xmlns':ns} ps=PropertySheet(id, md) self.addPropertySheet(ps) return 'OK' | 94603fc92aaaea303d2f1c60e52011a01b1deb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/94603fc92aaaea303d2f1c60e52011a01b1deb28/PropertySheets.py |
return 'OK' | if REQUEST is None: return ps ps= self.get(id) REQUEST.RESPONSE.redirect('%s/manage' % ps.absolute_url()) | def manage_addPropertySheet(self, id, ns): """ """ md={'xmlns':ns} ps=PropertySheet(id, md) self.addPropertySheet(ps) return 'OK' | 94603fc92aaaea303d2f1c60e52011a01b1deb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/94603fc92aaaea303d2f1c60e52011a01b1deb28/PropertySheets.py |
pre=r['URL'] | pre=r['URLPATH0'] | def manage_options(self): """Return a manage option data structure for me instance """ try: r=self.REQUEST except: r=None if r is None: pre='../' else: pre=r['URL'] for i in (1,2): l=pre.rfind('/') if l >= 0: pre=pre[:l] pre=pre+'/' | 94603fc92aaaea303d2f1c60e52011a01b1deb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/94603fc92aaaea303d2f1c60e52011a01b1deb28/PropertySheets.py |
def test_dont_break_getPhysicalPath(self): item = SimpleItem() self.assertEqual(item.getPhysicalPath(), ('',)) self.assertEqual(item.getPhysicalPath(), makerequest(item).getPhysicalPath()) | def test_dont_break_getPhysicalPath(self): # see http://www.zope.org/Collectors/Zope/2057 item = SimpleItem() self.assertEqual(item.getPhysicalPath(), ('',)) self.assertEqual(item.getPhysicalPath(), makerequest(item).getPhysicalPath()) | f05875c0833fa00d6c847d130321e14316e656ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f05875c0833fa00d6c847d130321e14316e656ea/test_makerequest.py | |
self.conn.send("helo "+localHost+"\r\n") | self.conn.send("helo "+localHost+"\015\012") | def __init__(self, smtpHost, smtpPort, localHost="localhost", timeout=1): self.conn = socket(AF_INET, SOCK_STREAM) self.conn.connect(smtpHost, smtpPort) self.timeout=timeout self.fd=self.conn.fileno() self.conn.send("helo "+localHost+"\r\n") while 1: if not self._check(): break | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
if code > 500: | if code > 400: | def _check(self, lev='250'): line = self.getLine() if not line: return 0 #can't check an empty line, eh? try: code=string.atoi(line[:3]) except: raise smtpError, "Cannot convert line from SMTP: %s" % line | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("mail from:<%s>\n" % mfrom) | self.conn.send("mail from:<%s>\015\012" % mfrom) | def send(self, mfrom, mto, subj='No Subject', body='Blank Message'): self.conn.send("mail from:<%s>\n" % mfrom) self._check() if type(mto) in [types.ListType, types.TupleType]: for person in mto: self.conn.send("rcpt to:<%s>\n" % person) self._check() else: self.conn.send("rcpt to:<%s>\n" % mto) self._check() self.conn... | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("rcpt to:<%s>\n" % person) | self.conn.send("rcpt to:<%s>\015\012" % person) | def send(self, mfrom, mto, subj='No Subject', body='Blank Message'): self.conn.send("mail from:<%s>\n" % mfrom) self._check() if type(mto) in [types.ListType, types.TupleType]: for person in mto: self.conn.send("rcpt to:<%s>\n" % person) self._check() else: self.conn.send("rcpt to:<%s>\n" % mto) self._check() self.conn... | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("rcpt to:<%s>\n" % mto) | self.conn.send("rcpt to:<%s>\015\012" % mto) | def send(self, mfrom, mto, subj='No Subject', body='Blank Message'): self.conn.send("mail from:<%s>\n" % mfrom) self._check() if type(mto) in [types.ListType, types.TupleType]: for person in mto: self.conn.send("rcpt to:<%s>\n" % person) self._check() else: self.conn.send("rcpt to:<%s>\n" % mto) self._check() self.conn... | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("data\n") | self.conn.send("data\015\012") | def send(self, mfrom, mto, subj='No Subject', body='Blank Message'): self.conn.send("mail from:<%s>\n" % mfrom) self._check() if type(mto) in [types.ListType, types.TupleType]: for person in mto: self.conn.send("rcpt to:<%s>\n" % person) self._check() else: self.conn.send("rcpt to:<%s>\n" % mto) self._check() self.conn... | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("\n.\n") | self.conn.send("\015\012.\015\012") | def send(self, mfrom, mto, subj='No Subject', body='Blank Message'): self.conn.send("mail from:<%s>\n" % mfrom) self._check() if type(mto) in [types.ListType, types.TupleType]: for person in mto: self.conn.send("rcpt to:<%s>\n" % person) self._check() else: self.conn.send("rcpt to:<%s>\n" % mto) self._check() self.conn... | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
self.conn.send("quit\n") | self.conn.send("quit\015\012") | def _close(self): self.conn.send("quit\n") self.conn.close() | 0cd72037947e4b20833b896769634c2951088c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cd72037947e4b20833b896769634c2951088c4f/MailHost.py |
opts, args = getopt.getopt(sys.argv[1:], 'p:u:v9') | opts, args = getopt.getopt(sys.argv[1:], 'p:u:DIv9') | def main(): user, password = 'superuser', '123' opts, args = getopt.getopt(sys.argv[1:], 'p:u:v9') global verbose global old for o, v in opts: if o=='-p': d, f = os.path.split(v) if f=='ZPublisher': sys.path.insert(0,d) else: sys.path.insert(0,v) elif o=='-u': v = string.split(v,':') user, password = v[0], string.join(... | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.