bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def setCookie(self,name,value,**kw): | defsetCookie(self,name,value,**kw): | 3,000 |
def _cookie_list(self): | def _cookie_list(self): | 3,001 |
def _cookie_list(self): | def _cookie_list(self): | 3,002 |
def _cookie_list(self): | def _cookie_list(self): | 3,003 |
def _cookie_list(self): | def _cookie_list(self): | 3,004 |
def doc_strong(self, s, expr = re.compile(r'\s*\*\*([ \na-zA-Z0-9.:/;\-,!\?\'\"]+)\*\*').search ): | def doc_strong(self, s, expr = re.compile(r'\s*\*\*([ \na-zA-Z0-9.:/;\-,!\?\'\"]+)\*\*').search ): | 3,005 |
def render(ob): """ Calls the object, possibly a document template, or just returns it if not callable. (From DT_Util.py) """ base = aq_base(ob) if callable(base): try: if getattr(base, 'isDocTemp', 0): ob = ob(ob, ob.REQUEST) else: ob = ob() except AttributeError, n: if n != '__call__': raise return ob | def render(ob): """ Calls the object, possibly a document template, or just returns it if not callable. (From DT_Util.py) """ base = aq_base(ob) if callable(base): try: if getattr(base, 'isDocTemp', 0): ob = ob(ob, ob.REQUEST) else: ob = ob() except AttributeError, n: if str(n) != '__call__': raise return ob | 3,006 |
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | 3,007 |
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam | 3,008 |
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr... | def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr... | 3,009 |
def get_earliest_file_data(files): temp = {} earliest_fromepoch = 0 earliest = None retn = None for file in files: line = file.readline() if not line: continue linelen = len(line) line = string.strip(line) tup = parsebigmlogline(line) if tup is None: print "Could not interpret line: %s" % line continue code, id, timest... | def get_earliest_file_data(files): temp = {} earliest_fromepoch = 0 earliest = None retn = None for file in files: line = file.readline() if not line: continue linelen = len(line) line = string.strip(line) tup = parsebigmlogline(line) if tup is None: print "Could not interpret line: %s" % line continue code, id, timest... | 3,010 |
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | 3,011 |
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | 3,012 |
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch... | 3,013 |
def timewrite(requests, start, end, resolution): max_requests = 0 print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t)... | def timewrite(requests, start, end, resolution): print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t) if d.has_key(slic... | 3,014 |
def timewrite(requests, start, end, resolution): max_requests = 0 print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t)... | def timewrite(requests, start, end, resolution): max_requests = 0 print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t)... | 3,015 |
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | 3,016 |
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | 3,017 |
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """ | 3,018 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,019 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,020 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,021 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,022 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,023 |
def usage(basic=1): usage = ( """ | defusage(basic=1):usage=(""" | 3,024 |
def usage(basic=1): usage = ( """ | defif opt=='--urlfocus': mode='urlfocus' urlfocusurl = val if opt=='--urlfocustime': urlfocustime=int(val) usage(basic=1):if opt=='--urlfocus': mode='urlfocus' urlfocusurl = val if opt=='--urlfocustime': urlfocustime=int(val) usageif opt=='--urlfocus': mode='urlfocus' urlfocusurl = val if opt=='--urlfocustime': urlfocu... | 3,025 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,026 |
def usage(basic=1): usage = ( """ | def usage(basic=1): usage = ( """ | 3,027 |
def _apply_index(self, request, cid=''): | def _apply_index(self, request, cid=''): | 3,028 |
def __getitem__(self, key): # Hm, getattr didn't work, maybe this is a put: if key[:19]=='manage_draftFolder-': id=key[19:] if hasattr(self, id): return getattr(self, id).manage_supervisor() raise KeyError, key try: if self.REQUEST['REQUEST_METHOD']=='PUT': return PUTer(self,key) except: pass raise KeyError, key | def __getitem__(self, key): # Hm, getattr didn't work, maybe this is a put: if key[:19]=='manage_draftFolder-': id=key[19:] if hasattr(self, id): return getattr(self, id).manage_supervisor() raise KeyError, key try: if self.REQUEST['REQUEST_METHOD']=='PUT': return PUTer(self,key).__of__(self) except: pass raise KeyErro... | 3,029 |
def manage_importHack(self, REQUEST=None): "Imports a previously exported object from /var/export.bbe" f=Globals.data_dir+'/export.bbe' o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) return 'OK, I imported %s' % id | def manage_importHack(self, REQUEST=None): "Imports a previously exported object from /var/export.bbe" f=Globals.data_dir+'/export.bbe' o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) return 'OK, I imported %s' % id | 3,030 |
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | 3,031 |
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | 3,032 |
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f... | 3,033 |
def manage_editProperties(self, REQUEST): """Edit object properties via the web.""" for prop in self._properties: name=prop['id'] if REQUEST.has_key(name): if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name) self._setPropValue(name, value) return MessageDialog( title ='Success!', message='Your changes have been ... | def manage_editProperties(self, REQUEST): """Edit object properties via the web. The purpose of this method is to change all property values, even those not listed in REQUEST; otherwise checkboxes that get turned off will be ignored. Use manage_changeProperties() instead for most situations. """ for prop in self._prop... | 3,034 |
def manage_editProperties(self, REQUEST): """Edit object properties via the web.""" for prop in self._properties: name=prop['id'] if REQUEST.has_key(name): if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name) self._setPropValue(name, value) return MessageDialog( title ='Success!', message='Your changes have been ... | def manage_editProperties(self, REQUEST): """Edit object properties via the web.""" for prop in self._properties: name=prop['id'] if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name, '') self._setPropValue(name, value) return MessageDialog( title ='Success!', message='Your changes have been saved', action ='manag... | 3,035 |
def __call__(self,*args,**kw): method=self.method if method=='PUT' and len(args)==1 and not kw: query=[args[0]] args=() else: query=[] for i in range(len(args)): try: k=self.args[i] if kw.has_key(k): raise TypeError, 'Keyword arg redefined' kw[k]=args[i] except IndexError: raise TypeError, 'Too many arguments' | def __call__(self,*args,**kw): method=self.method if method=='PUT' and len(args)==1 and not kw: query=[args[0]] args=() else: query=[] for i in range(len(args)): try: k=self.args[i] if kw.has_key(k): raise TypeError, 'Keyword arg redefined' kw[k]=args[i] except IndexError: raise TypeError, 'Too many arguments' | 3,036 |
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | 3,037 |
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | 3,038 |
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | 3,039 |
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start)) | 3,040 |
def _null_import_products(): pass | def _null_import_products(): pass | 3,041 |
def _null_initialize(app): pass | def _null_initialize(app): pass | 3,042 |
def _null_register_help(self,directory='',clear=1,title_re=None): pass | def _null_register_help(self,directory='',clear=1,title_re=None): pass | 3,043 |
def hasProduct(name): '''Tests if a product can be found along Products.__path__''' return name in [n[1] for n in get_products()] | def hasProduct(name): '''Checks if a product can be found along Products.__path__''' return name in [n[1] for n in get_products()] | 3,044 |
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to fail immediatel... | 3,045 |
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | 3,046 |
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | 3,047 |
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | 3,048 |
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f... | 3,049 |
def sandbox(base=None): '''Returns what amounts to a sandbox copy of the base ZODB.''' if base is None: base = Zope2.DB base_storage = base._storage quota = getattr(base_storage, '_quota', None) storage = DemoStorage(base=base_storage, quota=quota) return ZODB.DB(storage) | def sandbox(base=None): '''Returns a sandbox copy of the base ZODB.''' if base is None: base = Zope2.DB base_storage = base._storage quota = getattr(base_storage, '_quota', None) storage = DemoStorage(base=base_storage, quota=quota) return ZODB.DB(storage) | 3,050 |
def sane_environment(env): # return an environment mapping which has been cleaned of # funny business such as REDIRECT_ prefixes added by Apache # or HTTP_CGI_AUTHORIZATION hacks. dict={} for key, val in env.items(): while key[:9]=='REDIRECT_': key=key[9:] dict[key]=val if env.has_key('HTTP_CGI_AUTHORIZATION'): dict['H... | def sane_environment(env): # return an environment mapping which has been cleaned of # funny business such as REDIRECT_ prefixes added by Apache # or HTTP_CGI_AUTHORIZATION hacks. dict={} for key, val in env.items(): while key[:9]=='REDIRECT_': key=key[9:] dict[key]=val if dict.has_key('HTTP_CGI_AUTHORIZATION'): dict['... | 3,051 |
def testNotValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None) | def testValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None) | 3,052 |
def testNotValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None) | def testNotValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None) | 3,053 |
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UserFolderTests)) suite.addTest(unittest.makeSuite(UserTests)) return suite | deftest_suite():suite=unittest.TestSuite()suite.addTest(unittest.makeSuite(UserFolderTests))suite.addTest(unittest.makeSuite(UserTests))returnsuite | 3,054 |
def _cached_result(self, DB__, query, compressed=0): | def _cached_result(self, DB__, query, compressed=0): | 3,055 |
def _findLocalTimeZoneName(isDST): if not daylight: # Daylight savings does not occur in this time zone. isDST = 0 try: # Get the name of the current time zone depending # on DST. _localzone = _cache._zmap[tzname[isDST].lower()] except: try: # Generate a GMT-offset zone name. if isDST: localzone = altzone else: localzo... | def _findLocalTimeZoneName(isDST): if not daylight: # Daylight savings does not occur in this time zone. isDST = 0 try: # Get the name of the current time zone depending # on DST. _localzone = _cache._zmap[tzname[isDST].lower()] except: try: # Generate a GMT-offset zone name. if isDST: localzone = altzone else: localzo... | 3,056 |
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.title... | def manage_addFolder(self, id, title='', createPublic=0, createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.t... | 3,057 |
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.title... | def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ ob=Folder() ob.id=id ob.ti... | 3,058 |
def __call__(self, *args, **kw): """Call an ExternalMethod | def __call__(self, *args, **kw): """Call an ExternalMethod | 3,059 |
def valid_roles(self): "Return list of valid roles" obj=self dict={} dup =dict.has_key x=0 while x < 100: if hasattr(obj, '__ac_roles__'): roles=obj.__ac_roles__ for role in roles: if not dup(role): dict[role]=1 if not hasattr(obj, 'aq_parent'): break obj=obj.aq_parent x=x+1 roles=dict.keys() roles.sort() return roles | def valid_roles(self): "Return list of valid roles" obj=self dict={} dup =dict.has_key x=0 while x < 100: if hasattr(obj, '__ac_roles__'): roles=obj.__ac_roles__ for role in roles: if not dup(role): dict[role]=1 if not hasattr(obj, 'aq_parent'): break obj=obj.aq_parent x=x+1 roles=dict.keys() roles.sort() return roles | 3,060 |
def resolve_url(self, path, REQUEST): """ Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path) pri... | def resolve_url(self, path, REQUEST): """ """ while path and path[0]=='/': path=path[1:] while path and path[-1]=='/': path=path[:-1] req=REQUEST.clone() rsp=req.response req['PATH_INFO']=path object=None try: object=req.traverse(path) except: pass if object is not None: if hasattr(object, 'id'): if callable(object.i... | 3,061 |
def resolve_url(self, path, REQUEST): """ Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path) pri... | def resolve_url(self, path, REQUEST): """ Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path) pri... | 3,062 |
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding | def __init__(self, id, text=None, content_type=None, strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding | 3,063 |
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding | def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding | 3,064 |
def pt_edit(self, text, content_type, keep_output_encoding=False): | def pt_edit(self, text, content_type, keep_output_encoding=False): | 3,065 |
def pt_edit(self, text, content_type, keep_output_encoding=False): | def pt_edit(self, text, content_type, keep_output_encoding=False): | 3,066 |
def pt_edit(self, text, content_type, keep_output_encoding=False): | defpt_edit(self,text,content_type,keep_output_encoding=False): | 3,067 |
def pt_edit(self, text, content_type, keep_output_encoding=False): | def pt_edit(self, text, content_type, keep_output_encoding=False): | 3,068 |
def _exec(self, bound_names, args, kw): """Call a Page Template""" if not kw.has_key('args'): kw['args'] = args bound_names['options'] = kw | def _exec(self, bound_names, args, kw): """Call a Page Template""" if not kw.has_key('args'): kw['args'] = args bound_names['options'] = kw | 3,069 |
def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea... | def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea... | 3,070 |
def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea... | def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea... | 3,071 |
def url_quote(s): """ Convert characters that have special meaning in URLS to HTML character entities using decimal values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_quote' function. """ | def url_quote(s): """ Convert characters that have special meaning in URLS to HTML character entities using decimal values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'quote' function. """ | 3,072 |
def url_quote_plus(s): """ Like url_quote but also replace blank space characters with '+'. This is needed for building query strings in some cases. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_quote_plus' function. """ | def url_quote_plus(s): """ Like url_quote but also replace blank space characters with '+'. This is needed for building query strings in some cases. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'quote_plus' function. """ | 3,073 |
def url_unquote(s): """ Convert HTML character entities in strings back to their real values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote' function. """ | def url_unquote(s): """ Convert HTML %xx character entities into the characters they represent. (Undoes the affects of url_quote). See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'unquote' function. """ def url_unquote_plus(s): """ Like url_unquote but also replace '+' ch... | 3,074 |
def url_unquote(s): """ Convert HTML character entities in strings back to their real values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote' function. """ | def url_unquote(s): """ Convert HTML character entities in strings back to their real values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote' function. """ | 3,075 |
def url_unquote(s): """ Like url_unquote, but also replace '+' characters with spaces. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote_plus' function. """ | def url_unquote(s): """ Like url_unquote, but also replace '+' characters with spaces. """ | 3,076 |
def __init__(self, subs, **kw): t=[]; a=t.append for s in subs: a(s.getNodeValue()) apply(ST.StructuredTextParagraph.__init__, (self, join(t,'\n\n'), ()), kw) | def __init__(self, subs, **kw): t=[]; a=t.append for s in subs: a(s.getNodeValue()) apply(ST.StructuredTextParagraph.__init__, (self, join(t,'\n\n'), ()), kw) | 3,077 |
def manage_addFile(self,id,file='',title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) self=self... | def manage_addFile(self,id,file='',title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) self=self... | 3,078 |
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) se... | def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) se... | 3,079 |
def test_suite(): return unittest.makeSuite(HTMLTests, 'check') | def test_suite(): return unittest.makeSuite(HTMLTests, 'check') | 3,080 |
def manage_main(trueself, self, REQUEST, update_menu=0): """IMplement a contents view by redirecting to the true view """ d = update_menu and '/manage_main?update_menu=1' or '/manage_main' REQUEST['RESPONSE'].redirect(self.DestinationURL()+d) | def manage_main(trueself, self, REQUEST, update_menu=0): """Implement a contents view by redirecting to the true view """ d = update_menu and '/manage_main?update_menu=1' or '/manage_main' REQUEST['RESPONSE'].redirect(self.DestinationURL()+d) | 3,081 |
def __call__(self, econtext): base = self._base path = list(self._path) # Copy! contexts = econtext.contexts var = contexts['var'] # Expand dynamic path parts from right to left. for i, varname in self._dynparts: val = var[varname] if type(val) is type(''): path[i] = val else: # If the value isn't a string, assume it's... | def __call__(self, econtext): base = self._base path = list(self._path) # Copy! contexts = econtext.contexts var = contexts['var'] # Expand dynamic path parts from right to left. for i, varname in self._dynparts: val = var[varname] if type(val) is type(''): path[i] = val else: # If the value isn't a string, assume it's... | 3,082 |
def dav__allprop(self, propstat=propstat, join=string.join): # DAV helper method - return one or more propstat elements # indicating property names and values for all properties. result=[] for item in self._propertyMap(): name, type=item['id'], item.get('type','string') value=self.getProperty(name) if type=='tokens': v... | def dav__allprop(self, propstat=propstat, join=string.join): # DAV helper method - return one or more propstat elements # indicating property names and values for all properties. result=[] for item in self._propertyMap(): name, type=item['id'], item.get('type','string') value=self.getProperty(name) if type=='tokens': v... | 3,083 |
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global... | def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global... | 3,084 |
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global... | def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global... | 3,085 |
def parse_error(self, mess, tag, text, start): raise ParseError, "%s, for tag %s, on line %s of %s<p>" % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) | def parse_error(self, mess, tag, text, start): raise ParseError, "%s, for tag %s, on line %s of %s" % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) | 3,086 |
def __init__(self, id, extra=None, caller=None, index_factory=None, field_name=None, lexicon_id=None): self.id = id | def __init__(self, id, extra=None, caller=None, index_factory=None, field_name=None, lexicon_id=None): self.id = id | 3,087 |
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) print tag, self.nsdict if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitStartTag(tag, attrs) | def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitStartTag(tag, attrs) | 3,088 |
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) print tag, self.nsdict if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitStartTag(tag, attrs) | def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) print tag, self.nsdict if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() self.gen.emitStartTag(tag, attrs) | 3,089 |
def finish_endtag(self, tag): if tag not in EMPTY_HTML_TAGS: if not tag: tag = self.tagstack.pop() else: assert tag in self.tagstack while self.tagstack[-1] != tag: self.finish_endtag(None) self.tagstack.pop() self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitEndTag(tag) | def finish_endtag(self, tag): if tag not in EMPTY_HTML_TAGS: if not tag: tag = self.tagstack.pop() else: assert tag in self.tagstack while self.tagstack[-1] != tag: self.finish_endtag(None) self.tagstack.pop() self.pop_xmlns() self.gen.emitEndTag(tag) | 3,090 |
def pasteFromClipboard(self,clip_id='',clip_data='',REQUEST=None): """ """ | def pasteFromClipboard(self,clip_id='',clip_data='',REQUEST=None): """ """ | 3,091 |
def safe_callable(ob): # Works with ExtensionClasses and Acquisition. if hasattr(ob, '__class__'): if hasattr(ob, '__call__'): return 1 else: return isinstance(ob, types.ClassType) else: return callable(ob) | def safe_callable(ob): # Works with ExtensionClasses and Acquisition. if hasattr(ob, '__class__'): return hasattr(ob, '__call__') or isinstance(ob, types.ClassType) else: return callable(ob) | 3,092 |
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | 3,093 |
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | 3,094 |
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes. | 3,095 |
def __getitem__(self,index): | def __getitem__(self,index): | 3,096 |
def _delOb(self, id, value): delattr(self, id) pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class delattr(pc,id) pc.__propset_attrs__=tuple(map(lambda o: o[0], self._objects)) rclass(pc) | def _delOb(self, id): delattr(self, id) pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class delattr(pc,id) pc.__propset_attrs__=tuple(map(lambda o: o[0], self._objects)) rclass(pc) | 3,097 |
def reindex_all(obj=None): """ | def reindex_all(obj=None): """ | 3,098 |
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... | 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... | 3,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.