bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def ISO(): """Return the object in ISO standard format
def ISO(): """Return the object in ISO standard format
2,500
def HTML4(): """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime
def HTML4(): """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime
2,501
def HTML4(): """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime
def HTML4(): """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime
2,502
def __init__(self,file,brains=NoBrains, parent=None, zbrains=None):
def __init__(self,file,brains=NoBrains, parent=None, zbrains=None):
2,503
for _def in defs: _def=strip(_def) if not _def: raise ValueError, ('Empty column definition for %s' % names[i]) if defre.match(_def) < 0: raise ValueError, ( 'Invalid column definition for, %s, for %s' % _def, names[i]) type=lower(defre.group(2)) width=defre.group(1) if width: width=atoi(width) else: width=8
for _def in defs: _def=strip(_def) if not _def: raise ValueError, ('Empty column definition for %s' % names[i]) if defre.match(_def) < 0: raise ValueError, ( 'Invalid column definition for, %s, for %s' % _def, names[i]) type=lower(defre.group(2)) width=defre.group(1) if width: width=atoi(width) else: width=8
2,504
def add(self, id, title='', smtp_host=None, smtp_port=25, 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() #create new mail host i.id=id ...
def add(self, id, title='', smtp_host=None, smtp_port=25, 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() #create new mail host i.id=id ...
2,505
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ if meta_type: self.setClassAttr('meta_type', meta_type)
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None): """Set basic item properties. """ if meta_type: self.setClassAttr('meta_type', meta_type)
2,506
def text_type(s): return "text/" + (html_re.search(s) >= 0 and 'html' or 'plain')
def text_type(s): if (lower(strip(s)[:6]) == '<html>' or find(s, '</') > 0): return 'text/html' return 'text/plain'
2,507
def __init__(self,*args): c=len(args) if c==1: name,val=None,args[0] elif c==2: name,val=args[0],args[1] else: raise ValueError, 'Invalid arguments'
def __init__(self,*args): c=len(args) if c==1: name,val=None,args[0] elif c==2: name,val=args[0],args[1] else: raise ValueError, 'Invalid arguments'
2,508
def main(): import getopt from string import split user=None try: optlist, args = getopt.getopt(sys.argv[1:],'u:') url=args[0] u =filter(lambda o: o[0]=='-u', optlist) if u: [user, pw] = split(u[0][1],':') kw={} for arg in args[1:]: [name,v]=split(arg,'=') if name[-5:]==':file': name=name[:-5] if v=='-': v=sys.stdin...
def main(): import getopt from string import split user=None try: optlist, args = getopt.getopt(sys.argv[1:],'u:') url=args[0] u =filter(lambda o: o[0]=='-u', optlist) if u: [user, pw] = split(u[0][1],':') kw={} for arg in args[1:]: [name,v]=split(arg,'=') if name[-5:]==':file': name=name[:-5] if v=='-': v=sys.stdin...
2,509
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,510
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,511
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,512
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,513
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,514
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,515
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,516
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
2,517
def save_reduce(self, callable, arg_tup, state = None): write = self.write save = self.save
def save_reduce(self, callable, arg_tup, state = None): write = self.write save = self.save
2,518
def save_none(self, object): self.write(NONE)
def save_none(self, object): self.write(NONE)
2,519
def save_int(self, object): if (self.bin): i = mdumps(object)[1:] if (i[-2:] == '\000\000'): if (i[-3] == '\000'): self.write(BININT1 + i[:-3]) return
def save_int(self, object): if (self.bin): i = mdumps(object)[1:] if (i[-2:] == '\000\000'): if (i[-3] == '\000'): self.write(BININT1 + i[:-3]) return
2,520
def save_float(self, object): self.write(FLOAT + `object` + '\n')
def save_float(self, object): self.write(FLOAT + `object` + '\n')
2,521
def save_tuple(self, object): d = id(object)
def save_tuple(self, object): d = id(object)
2,522
def save_tuple(self, object): d = id(object)
def save_tuple(self, object): d = id(object)
2,523
def save_list(self, object): d = id(object)
def save_list(self, object): d = id(object)
2,524
def save_dict(self, object): d = id(object)
def save_dict(self, object): d = id(object)
2,525
def whichmodule(cls, clsname): """Figure out the module in which a class occurs. Search sys.modules for the module. Cache in classmap. Return a module name. If the class cannot be found, return __main__. """ if classmap.has_key(cls): return classmap[cls] import sys for name, module in sys.modules.items(): if name != ...
def whichmodule(cls, clsname): """Figure out the module in which a class occurs. Search sys.modules for the module. Cache in classmap. Return a module name. If the class cannot be found, return __main__. """ if classmap.has_key(cls): return classmap[cls] import sys for name, module in sys.modules.items(): if hasattr(...
2,526
def load_short_binstring(self): len = mloads('i' + self.read(1)) self.append(self.read(len))
def load_short_binstring(self): len = mloads('i' + self.read(1) + '\000\000\000') self.append(self.read(len))
2,527
def setUp(self): self._values = ( (0, Dummy('a', None)), # None (1, Dummy('b', DateTime(0))), # 1055335680 (2, Dummy('c', DateTime('2002-05-08 15:16:17'))), # 1072667236 (3, Dummy('d', DateTime('2032-05-08 15:16:17'))), # 1088737636 (4, Dummy('e', DateTime('2062-05-08 15:1...
def setUp(self): self._values = ( (0, Dummy('a', None)), # None (1, Dummy('b', DateTime(0))), # 1055335680 (2, Dummy('c', DateTime('2002-05-08 15:16:17'))), # 1072667236 (3, Dummy('d', DateTime('2032-05-08 15:16:17'))), # 1088737636 (4, Dummy('e', DateTime('2062-05-08 15:1...
2,528
def setUp(self): self._values = ( (0, Dummy('a', None)), # None (1, Dummy('b', DateTime(0))), # 1055335680 (2, Dummy('c', DateTime('2002-05-08 15:16:17'))), # 1072667236 (3, Dummy('d', DateTime('2032-05-08 15:16:17'))), # 1088737636 (4, Dummy('e', DateTime('2062-05-08 15:1...
def setUp(self): self._values = ( (0, Dummy('a', None)), # None (1, Dummy('b', DateTime(0))), # 1055335680 (2, Dummy('c', DateTime('2002-05-08 15:16:17'))), # 1072667236 (3, Dummy('d', DateTime('2032-05-08 15:16:17'))), # 1088737636 (4, Dummy('e', DateTime('2062-05-08 15:1...
2,529
def __bobo_traverse__(self, REQUEST, name=None):
def __bobo_traverse__(self, REQUEST, name=None):
2,530
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase if bobobase is None: return 1 try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getattr(__im...
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase safe=bobobase.has_key('Application') try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getat...
2,531
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase if bobobase is None: return 1 try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getattr(__im...
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase if bobobase is None: return 1 try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getattr(__im...
2,532
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase if bobobase is None: return 1 try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getattr(__im...
def lic_check(product_name): path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase if bobobase is None: return 1 try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: try: product=getattr(__im...
2,533
def log(self, subsystem, severity, summary, detail, error): if _log_dest is None or severity < _log_level: return
def log(self, subsystem, severity, summary, detail, error): if _log_dest is None or severity < _log_level: return
2,534
def log(self, subsystem, severity, summary, detail, error): if _log_dest is None or severity < _log_level: return
def log(self, subsystem, severity, summary, detail, error): if _log_dest is None or severity < _log_level: return
2,535
def HTML(src, level=0, type=type, StringType=type('')): if type(src) is StringType: return ClassicHTML(src, level) return HTMLNG(src, level)
def HTML(src, level=0, type=type, StringType=type('')): if type(src) is StringType: return ClassicHTML(src, level) return HTMLNG(src, level)
2,536
def _setBasesHoldOnToYourButts(self, bases): # Eeeek copy=self.__class__(self.id, self.title, bases)
def _setBasesHoldOnToYourButts(self, bases): # Eeeek copy=self.__class__(self.id, self.title, bases)
2,537
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]+$').match, BASEmatch=regex.compile('BASE[0-9]+$').match, ): """Get a variable value
2,538
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
2,539
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
2,540
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
def __getitem__(self,key, default=_marker, # Any special internal marker will do URLmatch=regex.compile('URL[0-9]$').match, BASEmatch=regex.compile('BASE[0-9]$').match, ): """Get a variable value
2,541
def keys(self): keys = {} keys.update(self.common)
def keys(self): keys = {} keys.update(self.common)
2,542
def sort(sequence, sort=(), _=None, mapping=0): """ - sequence is a sequence of objects to be sorted - sort is a sequence of tuples (key,func,direction) that define the sort order: - key is the name of an attribute to sort the objects by - func is the name of a comparison function. This parameter is optional allowe...
def sort(sequence, sort=(), _=None, mapping=0): """ - sequence is a sequence of objects to be sorted - sort is a sequence of tuples (key,func,direction) that define the sort order: - key is the name of an attribute to sort the objects by - func is the name of a comparison function. This parameter is optional allowe...
2,543
def _apply_index(self, request, cid='', ListType=[]):
def _apply_index(self, request, cid='', ListType=[]):
2,544
def near(self, x): result = {}
def near(self, x): result = {}
2,545
def quotes(s, ws = (string.whitespace,)): # split up quoted regions splitted = regsub.split(s, '[%s]*\"[%s]*' % (ws * 2)) split=string.split if (len(splitted) > 1): if ((len(splitted) % 2) == 0): raise QueryError, "Mismatched quotes" for i in range(1, len(splitted), 2): # split the quoted region into words splitted[i...
def quotes(s, ws = (string.whitespace,)): # split up quoted regions splitted = regsub.split(s, '[%s]*\"[%s]*' % (ws * 2)) split=string.split if (len(splitted) > 1): if ((len(splitted) % 2) == 0): raise QueryError, "Mismatched quotes" for i in range(1, len(splitted), 2): # split the quoted region into words splitted[i...
2,546
def get_operands(q, i, index, ListType=type([])): '''Evaluate and return the left and right operands for an operator''' try: left = q[i - 1] right = q[i + 1] except IndexError: raise QueryError, "Malformed query" if (type(left) is ListType): left = evaluate(left, index) else: left=index[left] if (type(right) is List...
def get_operands(q, i, index, ListType=type([]), StringType=type('')): '''Evaluate and return the left and right operands for an operator''' try: left = q[i - 1] right = q[i + 1] except IndexError: raise QueryError, "Malformed query" if (type(left) is ListType): left = evaluate(left, index) else: left=index[left] if...
2,547
def get_operands(q, i, index, ListType=type([])): '''Evaluate and return the left and right operands for an operator''' try: left = q[i - 1] right = q[i + 1] except IndexError: raise QueryError, "Malformed query" if (type(left) is ListType): left = evaluate(left, index) else: left=index[left] if (type(right) is List...
def get_operands(q, i, index, ListType=type([])): '''Evaluate and return the left and right operands for an operator''' try: left = q[i - 1] right = q[i + 1] except IndexError: raise QueryError, "Malformed query" t=type(left) if t is ListType: left = evaluate(left, index) elif t is StringType: left=index[left] t=typ...
2,548
def evaluate(q, index,ListType=type([])): '''Evaluate a parsed query''' if (len(q) == 1): if (type(q[0]) is ListType): return evaluate(q[0], index) return index[q[0]] i = 0 while (i < len(q)): if q[i] is AndNot: left, right = get_operands(q, i, index) val = left.and_not(right) q[(i - 1) : (i + 2)] = [ val ] else: i ...
def evaluate(q, index,ListType=type([])): '''Evaluate a parsed query''' if (len(q) == 1): if (type(q[0]) is ListType): return evaluate(q[0], index) return index[q[0]] i = 0 while (i < len(q)): if q[i] is AndNot: left, right = get_operands(q, i, index) val = left.and_not(right) q[(i - 1) : (i + 2)] = [ val ] else: i ...
2,549
def getSize(self): """Get the size of a file or image.
defget_size=getSize getSize(self):get_size=getSize """Getget_size=getSize theget_size=getSize sizeget_size=getSize ofget_size=getSize aget_size=getSize fileget_size=getSize orget_size=getSize image.
2,550
def __init__(self, stdin, environ, response, clean=0): # Avoid the overhead of scrubbing the environment in the # case of request cloning for traversal purposes. If the # clean flag is set, we know we can use the passed in # environ dict directly.
def __init__(self, stdin, environ, response, clean=0): # Avoid the overhead of scrubbing the environment in the # case of request cloning for traversal purposes. If the # clean flag is set, we know we can use the passed in # environ dict directly.
2,551
def __init__(self, id, title='', vocab_id=None, container=None): self=self.__of__(container) self.id=id self.title=title self.threshold = 10000 self._v_total = 0
def __init__(self, id, title='', vocab_id=None, container=None): if vocab_id is not None and container is None: raise CatalogError, ("You cannot specify a vocab_id without " "also specifying a container.") if container is not None: self=self.__of__(container) self.id=id self.title=title self.threshold = 10000 self._v_...
2,552
def _manage_add_product_permission( self, product, permission, methods=(), default=('Manager',) ):
def _manage_add_product_permission( self, product, permission, methods=(), default=('Manager',) ):
2,553
def _manage_add_product_permission( self, product, permission, methods=(), default=('Manager',) ):
def _manage_add_product_permission( self, product, permission, methods=(), default=('Manager',) ):
2,554
def field2text(v, nl=re.compile('\r\n\|\n\r').search): if hasattr(v,'read'): v=v.read() else: v=str(v) mo = nl(v) if mo is None: return v l = mo.start(0) r=[] s=0 while l >= s: r.append(v[s:l]) s=l+2 mo=nl(v,s) if mo is None: l=-1 else: l=mo.start(0) r.append(v[s:]) return join(r,'\n')
def field2text(v, nl=re.compile('\r\n|\n\r').search): if hasattr(v,'read'): v=v.read() else: v=str(v) mo = nl(v) if mo is None: return v l = mo.start(0) r=[] s=0 while l >= s: r.append(v[s:l]) s=l+2 mo=nl(v,s) if mo is None: l=-1 else: l=mo.start(0) r.append(v[s:]) return join(r,'\n')
2,555
def dav__supportedlock(self): return '\n <n:lockentry>\n' \ ' <d:lockscope><d:exclusive/></d:lockscope>\n' \ ' <d:locktype><d:write/></d:locktype>\n' \ ' </n:lockentry>\n '
def dav__supportedlock(self): return '\n <n:lockentry>\n' \ ' <d:lockscope><d:exclusive/></d:lockscope>\n' \ ' <d:locktype><d:write/></d:locktype>\n' \ ' </n:lockentry>\n '
2,556
def enter(self, REQUEST, RESPONSE): """Begin working in a version""" RESPONSE.setCookie( Globals.VersionNameName, self.cookie, path=REQUEST['SCRIPT_NAME'], ) if (REQUEST.has_key('SERVER_SOFTWARE') and REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'): # IIS doesn't handle redirect headers correctly return MessageDialog( act...
def enter(self, REQUEST, RESPONSE): """Begin working in a version""" RESPONSE.setCookie( Globals.VersionNameName, self.cookie, path=(REQUEST['BASEPATH1'] or '/'), ) if (REQUEST.has_key('SERVER_SOFTWARE') and REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'): # IIS doesn't handle redirect headers correctly return MessageDial...
2,557
def manage_addExternalMethod(self, id, title, module, function, REQUEST=None): """Add an external method to a folder Un addition to the standard object-creation arguments, 'id' and title, the following arguments are defined: function -- The name of the python function. This can be a an ordinary Python function, or a ...
def manage_addExternalMethod(self, id, title, module, function, REQUEST=None): """Add an external method to a folder Un addition to the standard object-creation arguments, 'id' and title, the following arguments are defined: function -- The name of the python function. This can be a an ordinary Python function, or a ...
2,558
def getFunction(self, reload=0):
def getFunction(self, reload=0):
2,559
def getFunction(self, reload=0):
defdef reloadIfChanged(self): ts=os.stat(self.filepath())[stat.ST_MTIME] if (not hasattr(self, '_v_last_read') or (ts != self._v_last_read)): self._v_f=self.getFunction(1) self._v_last_read=ts if DevelopmentMode: def getFuncDefaults(self): self.reloadIfChanged() if not hasattr(self, '_v_func_defaults'): self._v_f =...
2,560
def __call__(self, *args, **kw): """Call an ExternalMethod
def__call__(self,*args,**kw):"""CallanExternalMethod
2,561
def __call__(self, *args, **kw): """Call an ExternalMethod
def __call__(self, *args, **kw): """Call an ExternalMethod
2,562
def version_txt(self): try: return open(os.path.join(SOFTWARE_HOME,'version.txt')).read() except: return '(unreleased version)' return self._v_version_txt
def version_txt(): try: return open(os.path.join(SOFTWARE_HOME,'version.txt')).read() except: return '(unreleased version)' return self._v_version_txt
2,563
def __class_init__(self): pass
def __class_init__(self): pass
2,564
def manage_addZClass(self, id, title='', baseclasses=[], meta_type='', CreateAFactory=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_typ...
def manage_addZClass(self, id, title='', baseclasses=[], meta_type='', CreateAFactory=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_typ...
2,565
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
2,566
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
2,567
def apply(self, obj, url=None, depth=0, result=None, top=1): if result is None: result=StringIO() depth=self.depth url=urlfix(self.request['URL'], 'PROPFIND') url=urlbase(url) result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ '<d:multistatus xmlns:d="DAV:">\n') iscol=hasattr(obj, '__dav_collection__') if iscol ...
def apply(self, obj, url=None, depth=0, result=None, top=1): if result is None: result=StringIO() depth=self.depth url=urlfix(self.request['URL'], 'PROPFIND') url=urlbase(url) result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ '<d:multistatus xmlns:d="DAV:">\n') iscol=hasattr(obj, '__dav_collection__') if iscol ...
2,568
def apply(self, obj): url=urlfix(self.request['URL'], 'PROPPATCH') if hasattr(obj, '__dav_collection__'): url=url+'/' result=StringIO() errors=[] result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ '<d:multistatus xmlns:d="DAV:">\n' \ '<d:response>\n' \ '<d:href>%s</d:href>\n' % url) propsets=obj.propertysheets f...
def apply(self, obj): url=urlfix(self.request['URL'], 'PROPPATCH') if hasattr(obj, '__dav_collection__'): url=url+'/' result=StringIO() errors=[] result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ '<d:multistatus xmlns:d="DAV:">\n' \ '<d:response>\n' \ '<d:href>%s</d:href>\n' % quote(url)) propsets=obj.propertys...
2,569
def HEAD(self, REQUEST, RESPONSE): """Retrieve resource information without a response body.""" self.dav__init(REQUEST, RESPONSE) if hasattr(self, 'aq_base') and hasattr(self.aq_base, 'index_html'): if hasattr(self.index_html, 'HEAD'): return self.index_html.HEAD(REQUEST, RESPONSE) raise 'Method Not Allowed', ( 'Method...
def HEAD(self, REQUEST, RESPONSE): """Retrieve resource information without a response body.""" self.dav__init(REQUEST, RESPONSE) if hasattr(self, 'index_html'): if hasattr(self.index_html, 'HEAD'): return self.index_html.HEAD(REQUEST, RESPONSE) raise 'Method Not Allowed', ( 'Method not supported for this resource.'...
2,570
def __str__(self): return self.name
def__str__(self):returnself.name
2,571
def manage_paste(self, moniker, clip_id, REQUEST=None): """ """
def manage_paste(self, moniker, clip_id, REQUEST=None): """ """
2,572
def _apply_index(self, request, cid='', ListType=[]):
def _apply_index(self, request, cid='', ListType=[]):
2,573
def _apply_index(self, request, cid='', ListType=[]):
defreturn intSet(), (id,) _apply_index(self,return intSet(), (id,) request,return intSet(), (id,) cid='',return intSet(), (id,) ListType=[]):
2,574
def _doAddUser(self, name, password, roles, domains, **kw): """Create a new user""" if password is not None and self.encrypt_passwords: password = self._encryptPassword(password) self.data[name]=User(name,password,roles,domains)
def _doAddUser(self, name, password, roles, domains, **kw): """Create a new user""" if password is not None and self.encrypt_passwords \ and not self._isPasswordEncrypted(password): password = self._encryptPassword(password) self.data[name]=User(name,password,roles,domains)
2,575
def publishTraverse(self, request, name): object = self.context URL=request['URL']
def publishTraverse(self, request, name): object = self.context URL=request['URL']
2,576
def publishTraverse(self, request, name): object = self.context URL=request['URL']
def publishTraverse(self, request, name): object = self.context URL=request['URL']
2,577
def publishTraverse(self, request, name): object = self.context URL=request['URL']
def publishTraverse(self, request, name): object = self.context URL=request['URL']
2,578
def publishTraverse(self, request, name): object = self.context URL=request['URL']
def publishTraverse(self, request, name): object = self.context URL=request['URL']
2,579
def publishTraverse(self, request, name): object = self.context URL=request['URL']
def publishTraverse(self, request, name): object = self.context URL=request['URL']
2,580
def generate_salt(): """Generate a salt value for the crypt function.""" salt_choices = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "abcdefghijklmnopqrstuvwxyz" \ "0123456789./" return whrandom.choice(salt_choices)
def generate_salt(): """Generate a salt value for the crypt function.""" salt_choices = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "abcdefghijklmnopqrstuvwxyz" \ "0123456789./" return whrandom.choice(salt_choices)+whrandom.choice(salt_choices)
2,581
def uniqueValues(self,name=None,withLength=0): """ need to be consistent with the interface """
def uniqueValues(self,name=None,withLength=0): """ need to be consistent with the interface """
2,582
def uniqueValues(self,name=None,withLength=0): """ need to be consistent with the interface """
defuniqueValues(self,name=None,withLength=0):"""needtobeconsistentwiththeinterface"""
2,583
def availableSplitter(self): """ splitter we can add """ return Splitter.availableSplitters
def availableSplitters(self): """ splitter we can add """ return Splitter.availableSplitters
2,584
def manage_test(self, REQUEST):
def manage_test(self, REQUEST):
2,585
def manage_test(self, REQUEST):
def manage_test(self, REQUEST):
2,586
def check_attr_funky_names(self): self._run_check("""<a a.b='v' c:d='v' e-f='v'/>""", [ ("starttag", "a", ["a.b", "v", "c:d", "v", "e-f", "v"]), ("endtag", "a"), ])
def check_attr_funky_names(self): self._run_check("""<a a.b='v' e-f='v'/>""", [ ("starttag", "a", ["a.b", "v", "e-f", "v"]), ("endtag", "a"), ])
2,587
def __bobo_traverse__(self, REQUEST, key): name=self._name da=self.__dict__['_da'] args=self._args if name: if args.has_key(name): v=args[name] if type(v) is not ListType: v=[v] v.append(key) key=v
def __bobo_traverse__(self, REQUEST, key): name=self._name da=self.__dict__['_da'] args=self._args if name: if args.has_key(name): v=args[name] if type(v) is not ListType: v=[v] v.append(key) key=v
2,588
def __getitem__(self,index):
def__getitem__(self,index):
2,589
def __getitem__(self,index):
def __getitem__(self,index):
2,590
def render(self): ''' Render the source to HTML ''' # format with strings pub = docutils.core.Publisher() pub.set_reader('standalone', None, 'restructuredtext') pub.set_writer('html')
def render(self): ''' Render the source to HTML ''' # format with strings pub = docutils.core.Publisher() pub.set_reader('standalone', None, 'restructuredtext') pub.set_writer('html')
2,591
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...
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...
2,592
def ZopeAttributionButton(self): """Returns an HTML fragment that displays the 'powered by zope' button along with a link to the Zope site.""" return '<a href="http://www.zope.org/Credits"><img ' \ 'src="%s/p_/ZopeButton" width="115" height="50" ' \ 'border="0" alt="Powered by Zope"></a>' % self.REQUEST.BASE1
def ZopeAttributionButton(self): """Returns an HTML fragment that displays the 'powered by zope' button along with a link to the Zope site.""" return '<a href="http://www.zope.org/Credits" target="_top"><img ' \ 'src="%s/p_/ZopeButton" width="115" height="50" ' \ 'border="0" alt="Powered by Zope"></a>' % self.REQUEST.B...
2,593
def tabs_path_info(self, script, path): url=script out=[] while path[:1]=='/': path=path[1:] while path[-1:]=='/': path=path[:-1] while script[:1]=='/': script=script[1:] while script[-1:]=='/': script=script[:-1] path=split(path,'/')[:-1] if path: path=[script]+path else: path=[script] script='' last=path[-1] del path...
def tabs_path_info(self, script, path): url=script out=[] while path[:1]=='/': path=path[1:] while path[-1:]=='/': path=path[:-1] while script[:1]=='/': script=script[1:] while script[-1:]=='/': script=script[:-1] path=split(path,'/')[:-1] if script: path=[script]+path if not path: return '' script='' last=path[-1] del...
2,594
def parse(text, result=None, unparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)\)'), parmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)=\([^\0- =\"]+\)\)'), qparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)="\([^"]+\)\"\)'), ): if result is None: result = {} __traceback_info__=text if parmre.match(text) >= 0: name=parmre...
def parse(text, result=None, unparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)\)'), parmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)=\([^\0- =\"]+\)\)'), qparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)="\([^"]+\)\"\)'), ): if result is None: result = {} __traceback_info__=text if parmre.match(text) >= 0: name=parmre...
2,595
def manage_FTPstat(self,REQUEST): "psuedo stat, used by FTP for directory listings" from AccessControl.User import nobody mode=0100000 # check read permissions if hasattr(self.aq_base,'manage_FTPget'): if REQUEST['AUTHENTICATED_USER'].allowed(self.manage_FTPget, self.manage_FTPget.__roles__): mode=mode | 0440 if nobody...
def manage_FTPstat(self,REQUEST): "psuedo stat, used by FTP for directory listings" from AccessControl.User import nobody mode=0100000 # check read permissions if hasattr(self.aq_base,'manage_FTPget') and \ hasattr(self.manage_FTPget, '__roles__'): if REQUEST['AUTHENTICATED_USER'].allowed(self.manage_FTPget, self.manag...
2,596
def manage_FTPstat(self,REQUEST): "psuedo stat, used by FTP for directory listings" from AccessControl.User import nobody mode=0100000 # check read permissions if hasattr(self.aq_base,'manage_FTPget'): if REQUEST['AUTHENTICATED_USER'].allowed(self.manage_FTPget, self.manage_FTPget.__roles__): mode=mode | 0440 if nobody...
def manage_FTPstat(self,REQUEST): "psuedo stat, used by FTP for directory listings" from AccessControl.User import nobody mode=0100000 # check read permissions if hasattr(self.aq_base,'manage_FTPget'): if REQUEST['AUTHENTICATED_USER'].allowed(self.manage_FTPget, self.manage_FTPget.__roles__): mode=mode | 0440 if nobody...
2,597
def testUnderscoresInLiteral1(self): """ underscores in literals shouldn't do unterlining """
def testUnderscoresInLiteral1(self): """ underscores in literals shouldn't do unterlining """
2,598
def testUnderscoresInLiteral2(self): """ underscores in literals shouldn't do unterlining """
def testUnderscoresInLiteral2(self): """ underscores in literals shouldn't do unterlining """
2,599