bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def html_quote(v, character_entities=( (ts_regex.compile('&'), '&'), (ts_regex.compile("<"), '<' ), (ts_regex.compile(">"), '>' ), (ts_regex.compile('"'), '"'))): #" text=str(v) for re,name in character_entities: text=gsub(re,name,text) return text | def html_quote(v, character_entities=( (regex.compile('&'), '&'), (regex.compile("<"), '<' ), (regex.compile(">"), '>' ), (regex.compile('"'), '"') )): #" text=str(v) for re,name in character_entities: text=gsub(re,name,text) return text | 3,600 |
def insertEntry(self,comp,id,level): """ k is a path component (generated by splitPath() ) v is the documentId level is the level of the component inside the path """ | def insertEntry(self,comp,id,level): """ k is a path component (generated by splitPath() ) v is the documentId level is the level of the component inside the path """ | 3,601 |
def __init__(self, vocabulary=None, brains=None): # Catalogs no longer care about vocabularies and lexicons # so the vocabulary argument is ignored. (Casey) | def __init__(self, vocabulary=None, brains=None): # Catalogs no longer care about vocabularies and lexicons # so the vocabulary argument is ignored. (Casey) | 3,602 |
def clear(self): """ clear catalog """ | def clear(self): """ clear catalog """ | 3,603 |
def exception(self, fatal=0): | def exception(self, fatal=0): | 3,604 |
def exception(self, fatal=0): | def exception(self, fatal=0): | 3,605 |
def exception(self, fatal=0): | def exception(self, fatal=0): | 3,606 |
def exception(self, fatal=0): | def exception(self, fatal=0): | 3,607 |
def _cookie_list(self): | def _cookie_list(self): | 3,608 |
def selectedRoles(self): | def selectedRoles(self): | 3,609 |
def manage_editRoles(self,REQUEST,acl_type='A',acl_roles=[]): """ """ | def manage_editRoles(self,REQUEST,acl_type='A',acl_roles=[]): """ """ | 3,610 |
def oldmanage_editRoles(self,REQUEST,roles=[]): | def oldmanage_editRoles(self,REQUEST,roles=[]): | 3,611 |
def _setRoles(self,acl_type,acl_roles): | def _setRoles(self,acl_type,acl_roles): | 3,612 |
def publish(script,path_info,u=None,p=None,d=None,t=None,e={},s=None): import sys, os, getopt, string profile=p debug=d timeit=t silent=s if not script: script='+Main' if script[0]=='+': script='../../lib/python/'+script[1:] env=e env['SERVER_NAME']='bobo.server' env['SERVER_PORT']='80' env['REQUEST_METHOD']='GET' ... | def publish(script,path_info,u=None,p=None,d=None,t=None,e={},s=None,pm=0): import sys, os, getopt, string profile=p debug=d timeit=t silent=s if not script: script='+Main' if script[0]=='+': script='../../lib/python/'+script[1:] env=e env['SERVER_NAME']='bobo.server' env['SERVER_PORT']='80' env['REQUEST_METHOD']='... | 3,613 |
def changeClassId(self, newid=None): if Globals.DatabaseVersion!='3': return if newid is None: newid=self._new_class_id() self._unregister() if newid: if not newid[:1] == '*': newid='*'+newid self.setClassAttr('__module__', newid) self._register() | def changeClassId(self, newid=None): if not dbVersionEquals('3'): return if newid is None: newid=self._new_class_id() self._unregister() if newid: if not newid[:1] == '*': newid='*'+newid self.setClassAttr('__module__', newid) self._register() | 3,614 |
def _register(self): if Globals.DatabaseVersion!='3': return z=self._zclass_ class_id=z.__module__ if not class_id: return | def _register(self): if not dbVersionEquals('3'): return z=self._zclass_ class_id=z.__module__ if not class_id: return | 3,615 |
def _unregister(self): if Globals.DatabaseVersion!='3': return class_id=self._zclass_.__module__ if not class_id: return globals=self._p_jar.root()['ZGlobals'] if globals.has_key(class_id): del globals[class_id] | def _unregister(self): if not dbVersionEquals('3'): return class_id=self._zclass_.__module__ if not class_id: return globals=self._p_jar.root()['ZGlobals'] if globals.has_key(class_id): del globals[class_id] | 3,616 |
def _unregister(self): if Globals.DatabaseVersion!='3': return class_id=self._zclass_.__module__ if not class_id: return globals=self._p_jar.root()['ZGlobals'] if globals.has_key(class_id): del globals[class_id] | def_unregister(self):ifGlobals.DatabaseVersion!='3':returnclass_id=self._zclass_.__module__ifnotclass_id:returnglobals=self._p_jar.root()['ZGlobals']ifglobals.has_key(class_id):delglobals[class_id] | 3,617 |
def manage_afterAdd(self, item, container): if Globals.DatabaseVersion!='3': return if not self._zclass_.__module__: self.setClassAttr('__module__', self._new_class_id()) self._register() self.propertysheets.methods.manage_afterAdd(item, container) | def manage_afterAdd(self, item, container): if not dbVersionEquals('3'): return if not self._zclass_.__module__: self.setClassAttr('__module__', self._new_class_id()) self._register() self.propertysheets.methods.manage_afterAdd(item, container) | 3,618 |
def manage_beforeDelete(self, item, container): if Globals.DatabaseVersion!='3': return self._unregister() self.propertysheets.methods.manage_beforeDelete(item, container) | def manage_beforeDelete(self, item, container): if not dbVersionEquals('3'): return self._unregister() self.propertysheets.methods.manage_beforeDelete(item, container) | 3,619 |
def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if rawdata[j:j+2] == "/>": return j + 2 if next == "": # end of input return -1 if next in ("abcdefghijklmnopqrstuvwxyz=" "ABCDEFGHIJKLMNOPQRSTUVWXY... | def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if next == "/": s = rawdata[j:j+2] if s == "/>": return j + 2 if s == "/": return -1 self.updatepos(i, j + 1) raise HTMLParseError("malformed empt... | 3,620 |
def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if rawdata[j:j+2] == "/>": return j + 2 if next == "": # end of input return -1 if next in ("abcdefghijklmnopqrstuvwxyz=" "ABCDEFGHIJKLMNOPQRSTUVWXY... | def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if rawdata[j:j+2] == "/>": return j + 2 if next == "": # end of input return -1 if next in ("abcdefghijklmnopqrstuvwxyz=/" "ABCDEFGHIJKLMNOPQRSTUVWX... | 3,621 |
def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if rawdata[j:j+2] == "/>": return j + 2 if next == "": # end of input return -1 if next in ("abcdefghijklmnopqrstuvwxyz=" "ABCDEFGHIJKLMNOPQRSTUVWXY... | def check_for_whole_start_tag(self, i): rawdata = self.rawdata m = locatestarttagend.match(rawdata, i) if m: j = m.end() next = rawdata[j:j+1] if next == ">": return j + 1 if rawdata[j:j+2] == "/>": return j + 2 if next == "": # end of input return -1 if next in ("abcdefgh... | 3,622 |
def __init__(self): Shared.DC.xml.xmllib.XMLParser.__init__(self) self.root=None self.node=None | def __init__(self): Shared.DC.xml.xmllib.XMLParser.__init__(self) self.root=None self.node=None | 3,623 |
def parse(self, data): # prepending a XML preample to make xmllib happy # (Collector #863) if not data.startswith("<?xml"): data = '<?xml version="1.0" ?>\n' + data self.feed(data) self.close() return self.root | def parse(self, data): # prepending a XML preample to make xmllib happy # (Collector #863) if not data.startswith("<?xml"): data = '<?xml version="1.0" ?>\n' + data self.feed(data) self.close() return self.root | 3,624 |
def filtered_manage_options(self, REQUEST=None): | def filtered_manage_options(self, REQUEST=None): | 3,625 |
def manage_workspace(self, REQUEST): """Dispatch to first interface in manage_options """ from AccessControl.User import nobody if aq_base(getSecurityManager().getUser()) is aq_base(nobody): # No authentication credentials presented. raise 'Unauthorized', ( 'You are not authorized to view this object.') options=self.fi... | def manage_workspace(self, REQUEST): """Dispatch to first interface in manage_options """ from AccessControl.User import nobody if aq_base(getSecurityManager().getUser()) is aq_base(nobody): # No authentication credentials presented. raise 'Unauthorized', ( 'You are not authorized to view this object.') options=self.fi... | 3,626 |
def manage_cutObjects(self, ids, REQUEST=None): """Put a reference to the objects named in ids in the clip board""" if type(ids) is type(''): ids=[ids] oblist=[] for id in ids: ob=self._getOb(id) if not ob.cb_isMoveable(): raise CopyError, eNotSupported % id m=Moniker.Moniker(ob) oblist.append(m.dump()) cp=(1, oblist) ... | def manage_cutObjects(self, ids=None, REQUEST=None): """Put a reference to the objects named in ids in the clip board""" if type(ids) is type(''): ids=[ids] oblist=[] for id in ids: ob=self._getOb(id) if not ob.cb_isMoveable(): raise CopyError, eNotSupported % id m=Moniker.Moniker(ob) oblist.append(m.dump()) cp=(1, obl... | 3,627 |
def manage_copyObjects(self, ids, REQUEST=None, RESPONSE=None): """Put a reference to the objects named in ids in the clip board""" if type(ids) is type(''): ids=[ids] oblist=[] for id in ids: ob=self._getOb(id) if not ob.cb_isCopyable(): raise CopyError, eNotSupported % id m=Moniker.Moniker(ob) oblist.append(m.dump())... | def manage_copyObjects(self, ids=None, REQUEST=None, RESPONSE=None): """Put a reference to the objects named in ids in the clip board""" if type(ids) is type(''): ids=[ids] oblist=[] for id in ids: ob=self._getOb(id) if not ob.cb_isCopyable(): raise CopyError, eNotSupported % id m=Moniker.Moniker(ob) oblist.append(m.du... | 3,628 |
def getRoles(self): | def getRoles(self): | 3,629 |
def __before_publishing_traverse__(self, self2, request): path = request['TraversalRequestNameStack'] names = self.getBindingAssignments() if (not names.isNameAssigned('name_subpath') or (path and hasattr(self.aq_explicit, path[-1])) ): return subpath = path[:] path[:] = [] subpath.reverse() request.set('traverse_subpa... | def __before_publishing_traverse__(self, self2, request): path = request['TraversalRequestNameStack'] names = self.getBindingAssignments() if (not names.isNameAssigned('name_subpath') or (path and hasattr(self.aq_base, path[-1])) ): return subpath = path[:] path[:] = [] subpath.reverse() request.set('traverse_subpath',... | 3,630 |
def constructSessionDataManager(self, id, title='', path=None, automatic=None, REQUEST=None): """ """ ob = SessionDataManager(id, path, title, automatic) self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) | def constructSessionDataManager(self, id, title='', path=None, requestName=None, REQUEST=None): """ """ ob = SessionDataManager(id, path, title, automatic) self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) | 3,631 |
def constructSessionDataManager(self, id, title='', path=None, automatic=None, REQUEST=None): """ """ ob = SessionDataManager(id, path, title, automatic) self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) | def constructSessionDataManager(self, id, title='', path=None, automatic=None, REQUEST=None): """ """ ob = SessionDataManager(id, path, title, requestName) self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) | 3,632 |
def __init__(self, id, path=None, title='', automatic=None): self.id = id self.setContainerPath(path) self.setTitle(title) | def __init__(self, id, path=None, title='', requestName=None): self.id = id self.setContainerPath(path) self.setTitle(title) | 3,633 |
def __init__(self, id, path=None, title='', automatic=None): self.id = id self.setContainerPath(path) self.setTitle(title) | def __init__(self, id, path=None, title='', automatic=None): self.id = id self.setContainerPath(path) self.setTitle(title) | 3,634 |
def manage_changeSDM(self, title, path=None, automatic=None, REQUEST=None): """ """ self.setContainerPath(path) self.setTitle(title) if automatic: self.updateTraversalData('SESSION') else: self.updateTraversalData(None) if REQUEST is not None: return self.manage_sessiondatamgr(self, REQUEST) | def manage_changeSDM(self, title, path=None, requestName=None, REQUEST=None): """ """ self.setContainerPath(path) self.setTitle(title) if automatic: self.updateTraversalData('SESSION') else: self.updateTraversalData(None) if REQUEST is not None: return self.manage_sessiondatamgr(self, REQUEST) | 3,635 |
def manage_changeSDM(self, title, path=None, automatic=None, REQUEST=None): """ """ self.setContainerPath(path) self.setTitle(title) if automatic: self.updateTraversalData('SESSION') else: self.updateTraversalData(None) if REQUEST is not None: return self.manage_sessiondatamgr(self, REQUEST) | def manage_changeSDM(self, title, path=None, automatic=None, REQUEST=None): """ """ self.setContainerPath(path) self.setTitle(title) if requestName: self.updateTraversalData(requestName) else: self.updateTraversalData(None) if REQUEST is not None: return self.manage_sessiondatamgr(self, REQUEST) | 3,636 |
def _getSessionDataContainer(self): """ Do not cache the results of this call. Doing so breaks the transactions for mounted storages. """ if self.obpath is None: err = 'Session data container is unspecified in %s' % self.getId() if DEBUG: LOG('Session Tracking', 0, err) raise SessionIdManagerErr, err # return an exter... | def _getSessionDataContainer(self): """ Do not cache the results of this call. Doing so breaks the transactions for mounted storages. """ if self.obpath is None: err = 'Session data container is unspecified in %s' % self.getId() if DEBUG: LOG('Session Tracking', 0, err) raise SessionIdManagerErr, err # return an exter... | 3,637 |
def updatefolder(self, f, msgs): self.watchfolders[f.name] = self.getmtime(f.name) for n in msgs: path = "%s/%s" % (f.name, n) docid = self.path2docid.get(path, 0) if docid and self.getmtime(path) == self.doctimes.get(docid, 0): print "unchanged", docid, path continue docid = self.newdocid(path) try: m = f.openmessage(... | def updatefolder(self, f, msgs): self.watchfolders[f.name] = self.getmtime(f.name) for n in msgs: path = "%s/%s" % (f.name, n) docid = self.path2docid.get(path, 0) if docid and self.getmtime(path) == self.doctimes.get(docid, 0): print "unchanged", docid, path continue docid = self.newdocid(path) try: m = f.openmessage(... | 3,638 |
def html_quote(v, name='(Unknown name)', md={}, character_entities=( (('&'), '&'), (("<"), '<' ), ((">"), '>' ), (('"'), '"'))): #" text=str(v) for re,name in character_entities: if find(text, re) >= 0: text=join(split(text,re),name) return text | def html_quote(v, name='(Unknown name)', md={}, character_entities=( (('&'), '&'), (('<'), '<' ), (('>'), '>' ), (('\213'), '<' ), (('\233'), '>' ), (('"'), '"'))): #" text=str(v) for re,name in character_entities: if find(text, re) >= 0: text=join(split(text,re),name) return text | 3,639 |
def _roles_debug(self,hier,expected_roles,got_roles): | def _roles_debug(self,hier,expected_roles,got_roles): | 3,640 |
def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" kw['document_id'] =self.id kw['document_title']=self.title if client is None: # Called as subtemplate, so don't need error propigation! r=apply(HTML.__c... | def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" kw['document_id'] =self.id kw['document_title']=self.title if client is None: # Called as subtemplate, so don't need error propigation! r=apply(HTML.__c... | 3,641 |
def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" kw['document_id'] =self.id kw['document_title']=self.title if client is None: # Called as subtemplate, so don't need error propigation! r=apply(HTML.__c... | def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" kw['document_id'] =self.id kw['document_title']=self.title if client is None: # Called as subtemplate, so don't need error propigation! r=apply(HTML.__c... | 3,642 |
def log (self, bytes): user_agent=self.get_header('user-agent') if not user_agent: user_agent='' referer=self.get_header('referer') if not referer: referer='' auth=self.get_header('Authorization') name='Anonymous' if auth is not None: if string.lower(auth[:6]) == 'basic ': try: decoded=base64.decodestring(auth[6:]) ex... | def log (self, bytes): user_agent=self.get_header('user-agent') if not user_agent: user_agent='' referer=self.get_header('referer') if not referer: referer='' auth=self.get_header('Authorization') name='Anonymous' if auth is not None: if string.lower(auth[:6]) == 'basic ': try: decoded=base64.decodestring(auth[6:]) ex... | 3,643 |
def __init__(self,*args): """Return a new date-time object | def __init__(self,*args): """Return a new date-time object | 3,644 |
def source_txt(self, REQUEST=None): ''' Getting the source text ''' REQUEST.RESPONSE.setHeader('content-type', 'text/plain; charset=%s' % self.input_encoding) return self.source | def source_txt(self, REQUEST=None): ''' Getting the source text ''' REQUEST.RESPONSE.setHeader('content-type', 'text/plain; charset=%s' % self.input_encoding) return self.source | 3,645 |
def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and encoding and is8bit(data): data = unicode(data, encoding) return data | 3,646 |
def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | 3,647 |
def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | 3,648 |
def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search): # decode non-ascii string (if possible) if unicode and is8bit(data): data = unicode(data, encoding) return data | def"""Indicates an HTTP protocol error.""" _decode(data,"""Indicates an HTTP protocol error.""" encoding,"""Indicates an HTTP protocol error.""" is8bit=re.compile("[\x80-\xff]").search):"""Indicates an HTTP protocol error.""" #"""Indicates an HTTP protocol error.""" decode"""Indicates an HTTP protocol error.""" non-asc... | 3,649 |
def __repr__(self): return ( "<ProtocolError for %s: %s %s>" % (self.url, self.errcode, self.errmsg) ) | def"""Indicates a broken response package.""" __repr__(self):"""Indicates a broken response package.""" return"""Indicates a broken response package.""" ("""Indicates a broken response package.""" "<ProtocolError"""Indicates a broken response package.""" for"""Indicates a broken response package.""" %s:"""Indicates a b... | 3,650 |
def __repr__(self): return ( "<ProtocolError for %s: %s %s>" % (self.url, self.errcode, self.errmsg) ) | def"""Indicates an XML-RPC fault package.""" __repr__(self):"""Indicates an XML-RPC fault package.""" return"""Indicates an XML-RPC fault package.""" ("""Indicates an XML-RPC fault package.""" "<ProtocolError"""Indicates an XML-RPC fault package.""" for"""Indicates an XML-RPC fault package.""" %s:"""Indicates an XML-RP... | 3,651 |
def __repr__(self): return ( "<Fault %s: %s>" % (self.faultCode, repr(self.faultString)) ) | def__repr__(self):return("<Fault%s:%s>"%(self.faultCode,repr(self.faultString))) | 3,652 |
def __repr__(self): return ( "<Fault %s: %s>" % (self.faultCode, repr(self.faultString)) ) | def __repr__(self): return ( "<Fault %s: %s>" % (self.faultCode, repr(self.faultString)) ) | 3,653 |
def boolean(value, truefalse=(False, True)): # convert any Python value to XML-RPC boolean return truefalse[operator.truth(value)] | def"""Convert any Python value to XML-RPC 'boolean'.""" boolean(value,"""Convert any Python value to XML-RPC 'boolean'.""" truefalse=(False,"""Convert any Python value to XML-RPC 'boolean'.""" True)):"""Convert any Python value to XML-RPC 'boolean'.""" #"""Convert any Python value to XML-RPC 'boolean'.""" convert"""Con... | 3,654 |
def boolean(value, truefalse=(False, True)): # convert any Python value to XML-RPC boolean return truefalse[operator.truth(value)] | def boolean(value, truefalse=(False, True)): # convert any Python value to XML-RPC boolean return truefalse[operator.truth(value)] | 3,655 |
def encode(self, out): out.write("<value><dateTime.iso8601>") out.write(self.value) out.write("</dateTime.iso8601></value>\n") | def encode(self, out): out.write("<value><dateTime.iso8601>") out.write(self.value) out.write("</dateTime.iso8601></value>\n") | 3,656 |
def encode(self, out): import base64, StringIO out.write("<value><base64>\n") base64.encode(StringIO.StringIO(self.data), out) out.write("</base64></value>\n") | defencode(self,out):importbase64,StringIOout.write("<value><base64>\n")base64.encode(StringIO.StringIO(self.data),out)out.write("</base64></value>\n") | 3,657 |
def encode(self, out): import base64, StringIO out.write("<value><base64>\n") base64.encode(StringIO.StringIO(self.data), out) out.write("</base64></value>\n") | def encode(self, out): import base64, StringIO out.write("<value><base64>\n") base64.encode(StringIO.StringIO(self.data), out) out.write("</base64></value>\n") | 3,658 |
def handle_entityref(self, entity): # <string> entity try: self.handle_data(self.entity[entity]) except KeyError: self.handle_data("&%s;" % entity) | def handle_entityref(self, entity): # <string> entity try: self.handle_data(self.entity[entity]) except KeyError: self.handle_data("&%s;" % entity) | 3,659 |
def __init__(self, target): self.handle_xml = target.xml self.unknown_starttag = target.start self.handle_data = target.data self.unknown_endtag = target.end xmllib.XMLParser.__init__(self) | def __init__(self, target): self.handle_xml = target.xml self.unknown_starttag = target.start self.handle_data = target.data self.unknown_endtag = target.end xmllib.XMLParser.__init__(self) | 3,660 |
def __init__(self, target): self.handle_xml = target.xml self.unknown_starttag = target.start self.handle_data = target.data self.unknown_endtag = target.end xmllib.XMLParser.__init__(self) | def __init__(self, target): self.handle_xml = target.xml self.unknown_starttag = target.start self.handle_data = target.data self.unknown_endtag = target.end xmllib.XMLParser.__init__(self) | 3,661 |
def dump_double(self, value): self.write("<value><double>%s</double></value>\n" % value) | def dump_double(self, value): self.write("<value><double>%s</double></value>\n" % value) | 3,662 |
def dump_string(self, value): self.write("<value><string>%s</string></value>\n" % escape(value)) | def dump_string(self, value, escape=escape): self.write("<value><string>%s</string></value>\n" % escape(value)) | 3,663 |
def dump_unicode(self, value): value = value.encode(self.encoding) self.write("<value><string>%s</string></value>\n" % escape(value)) | def dump_unicode(self, value, escape=escape): value = value.encode(self.encoding) self.write("<value><string>%s</string></value>\n" % escape(value)) | 3,664 |
def container(self, value): if value: i = id(value) if self.memo.has_key(i): raise TypeError, "cannot marshal recursive data structures" self.memo[i] = None | def opencontainer(self, value): if value: i = id(value) if self.memo.has_key(i): raise TypeError, "cannot marshal recursive data structures" self.memo[i] = None | 3,665 |
def dump_array(self, value): self.container(value) write = self.write write("<value><array><data>\n") for v in value: self.__dump(v) write("</data></array></value>\n") | def dump_array(self, value): self.opencontainer(value) write = self.write write("<value><array><data>\n") for v in value: self.__dump(v) write("</data></array></value>\n") | 3,666 |
def dump_array(self, value): self.container(value) write = self.write write("<value><array><data>\n") for v in value: self.__dump(v) write("</data></array></value>\n") | def dump_array(self, value): self.container(value) write = self.write write("<value><array><data>\n") for v in value: dump(v) write("</data></array></value>\n") | 3,667 |
def dump_struct(self, value): self.container(value) write = self.write write("<value><struct>\n") for k, v in value.items(): write("<member>\n") if type(k) is not StringType: raise TypeError, "dictionary key must be string" write("<name>%s</name>\n" % escape(k)) self.__dump(v) write("</member>\n") write("</struct></val... | def dump_struct(self, value, escape=escape): self.opencontainer(value) write = self.write write("<value><struct>\n") for k, v in value.items(): write("<member>\n") if type(k) is not StringType: raise TypeError, "dictionary key must be string" write("<name>%s</name>\n" % escape(k)) self.__dump(v) write("</member>\n") wr... | 3,668 |
def dump_struct(self, value): self.container(value) write = self.write write("<value><struct>\n") for k, v in value.items(): write("<member>\n") if type(k) is not StringType: raise TypeError, "dictionary key must be string" write("<name>%s</name>\n" % escape(k)) self.__dump(v) write("</member>\n") write("</struct></val... | def dump_struct(self, value): self.container(value) write = self.write write("<value><struct>\n") for k, v in value.items(): write("<member>\n") if type(k) is not StringType: raise TypeError, "dictionary key must be string" write("<name>%s</name>\n" % escape(k)) dump(v) write("</member>\n") write("</struct></value>\n") | 3,669 |
def dump_instance(self, value): # check for special wrappers if value.__class__ in WRAPPERS: value.encode(self) else: # store instance attributes as a struct (really?) self.dump_struct(value.__dict__) | def dump_instance(self, value): # check for special wrappers if value.__class__ in WRAPPERS: value.encode(self) else: # store instance attributes as a struct (really?) self.dump_struct(value.__dict__) | 3,670 |
def xml(self, encoding, standalone): self._encoding = encoding or "utf-8" # FIXME: assert standalone == 1 ??? | def xml(self, encoding, standalone): self._encoding = encoding # FIXME: assert standalone == 1 ??? | 3,671 |
def start(self, tag, attrs): # prepare to handle this element if tag in ("array", "struct"): self._marks.append(len(self._stack)) self._data = [] self._value = (tag == "value") | def start(self, tag, attrs): # prepare to handle this element if tag == "array" or tag == "struct": self._marks.append(len(self._stack)) self._data = [] self._value = (tag == "value") | 3,672 |
def data(self, text): self._data.append(text) | def data(self, text): self._data.append(text) | 3,673 |
def end(self, tag): # call the appropriate end tag handler try: f = self.dispatch[tag] except KeyError: pass # unknown tag ? else: return f(self) | def end(self, tag): # call the appropriate end tag handler try: f = self.dispatch[tag] except KeyError: pass # unknown tag ? else: return f(self) | 3,674 |
def end_boolean(self, join=string.join): value = join(self._data, "") if value == "0": self.append(False) elif value == "1": self.append(True) else: raise TypeError, "bad boolean value" self._value = 0 | dispatch = {} def end_boolean(self, data): if data == "0": self.append(False) elif value == "1": self.append(True) else: raise TypeError, "bad boolean value" self._value = 0 | 3,675 |
def end_boolean(self, join=string.join): value = join(self._data, "") if value == "0": self.append(False) elif value == "1": self.append(True) else: raise TypeError, "bad boolean value" self._value = 0 | def end_boolean(self, join=string.join): value = join(self._data, "") if value == "0": self.append(False) elif data == "1": self.append(True) else: raise TypeError, "bad boolean value" self._value = 0 | 3,676 |
def end_int(self, join=string.join): self.append(int(join(self._data, ""))) self._value = 0 | def end_int(self, data): self.append(int(data)) self._value = 0 | 3,677 |
def end_double(self, join=string.join): self.append(float(join(self._data, ""))) self._value = 0 | def end_double(self, data): self.append(float(data)) self._value = 0 | 3,678 |
def end_string(self, join=string.join): data = join(self._data, "") if self._encoding: data = _decode(data, self._encoding) self.append(data) self._value = 0 | def end_string(self, data): if self._encoding: data = _decode(data, self._encoding) self.append(data) self._value = 0 | 3,679 |
def end_string(self, join=string.join): data = join(self._data, "") if self._encoding: data = _decode(data, self._encoding) self.append(data) self._value = 0 | def end_string(self, join=string.join): data = join(self._data, "") if self._encoding: data = _decode(data, self._encoding) self.append(_stringify(data)) self._value = 0 | 3,680 |
def end_array(self): mark = self._marks[-1] del self._marks[-1] # map arrays to Python lists self._stack[mark:] = [self._stack[mark:]] self._value = 0 | def end_array(self, data): mark = self._marks[-1] del self._marks[-1] # map arrays to Python lists self._stack[mark:] = [self._stack[mark:]] self._value = 0 | 3,681 |
def end_struct(self): mark = self._marks[-1] del self._marks[-1] # map structs to Python dictionaries dict = {} items = self._stack[mark:] for i in range(0, len(items), 2): dict[items[i]] = items[i+1] self._stack[mark:] = [dict] self._value = 0 | def end_struct(self, data): mark = self._marks[-1] del self._marks[-1] # map structs to Python dictionaries dict = {} items = self._stack[mark:] for i in range(0, len(items), 2): dict[items[i]] = items[i+1] self._stack[mark:] = [dict] self._value = 0 | 3,682 |
def end_struct(self): mark = self._marks[-1] del self._marks[-1] # map structs to Python dictionaries dict = {} items = self._stack[mark:] for i in range(0, len(items), 2): dict[items[i]] = items[i+1] self._stack[mark:] = [dict] self._value = 0 | def end_struct(self): mark = self._marks[-1] del self._marks[-1] # map structs to Python dictionaries dict = {} items = self._stack[mark:] for i in range(0, len(items), 2): dict[_stringify(items[i])] = items[i+1] self._stack[mark:] = [dict] self._value = 0 | 3,683 |
def end_base64(self, join=string.join): value = Binary() value.decode(join(self._data, "")) self.append(value) self._value = 0 | def end_base64(self, data): value = Binary() value.decode(join(self._data, "")) self.append(value) self._value = 0 | 3,684 |
def end_base64(self, join=string.join): value = Binary() value.decode(join(self._data, "")) self.append(value) self._value = 0 | def end_base64(self, join=string.join): value = Binary() value.decode(data) self.append(value) self._value = 0 | 3,685 |
def end_dateTime(self, join=string.join): value = DateTime() value.decode(join(self._data, "")) self.append(value) | def end_dateTime(self, data): value = DateTime() value.decode(join(self._data, "")) self.append(value) | 3,686 |
def end_dateTime(self, join=string.join): value = DateTime() value.decode(join(self._data, "")) self.append(value) | def end_dateTime(self, join=string.join): value = DateTime() value.decode(data) self.append(value) | 3,687 |
def end_value(self): # if we stumble upon an value element with no internal # elements, treat it as a string element if self._value: self.end_string() | def end_value(self, data): # if we stumble upon an value element with no internal # elements, treat it as a string element if self._value: self.end_string() | 3,688 |
def end_value(self): # if we stumble upon an value element with no internal # elements, treat it as a string element if self._value: self.end_string() | def end_value(self): # if we stumble upon an value element with no internal # elements, treat it as a string element if self._value: self.end_string() | 3,689 |
def end_params(self): self._type = "params" | def end_params(self, data): self._type = "params" | 3,690 |
def end_fault(self): self._type = "fault" | def end_fault(self, data): self._type = "fault" | 3,691 |
def end_methodName(self, join=string.join): data = join(self._data, "") if self._encoding: data = _decode(data, self._encoding) self._methodname = data | def end_methodName(self, data): if self._encoding: data = _decode(data, self._encoding) self._methodname = data | 3,692 |
def getparser(): """getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. """ target = Unmarshaller() if FastParser: return FastParser(target), target return SlowParser(target), target | def getparser(): """getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. """ target = Unmarshaller() if FastParser: return FastParser(target), target return SlowParser(target), target | 3,693 |
def getparser(): """getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. """ target = Unmarshaller() if FastParser: return FastParser(target), target return SlowParser(target), target | def getparser(): """getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. """ if FastParser and FastUnmarshaller: target = FastUnmarshaller(True, False, binary, datetime) parser = FastParser(target) else: target = Unmarsh... | 3,694 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | 3,695 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | 3,696 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | 3,697 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | 3,698 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert a tuple or a fault object to an XML-RPC request (or response, if the methodsresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodna... | 3,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.