bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __del__(self): if self._ref != None and icalcomponent_get_parent(self._ref) != 'NULL':
def __del__(self): if self._ref != None and icalcomponent_get_parent(self._ref) != 'NULL':
38,100
def _prop_from_ref(self,p):
def _prop_from_ref(self,p):
38,101
def property(self, type):
def property(self, type):
38,102
def properties(self,type='ANY'): """ Return a list of Property instances, each representing a property of the type 'type.' """
def properties(self,type='ANY'): """ Return a list of Property instances, each representing a property of the type 'type.' """
38,103
def add_property(self, prop): "Adds the property object to the component." if not isinstance(prop,Property): raise TypeError
def add_property(self, prop): "Adds the property object to the component." if not isinstance(prop,Property): raise TypeError
38,104
def add_property(self, prop): "Adds the property object to the component." if not isinstance(prop,Property): raise TypeError
def add_property(self, prop): "Adds the property object to the component." if not isinstance(prop,Property): raise TypeError
38,105
def components(self,type='ANY'): comps = []
def components(self,type='ANY'): comps = []
38,106
def inner_component(self): inner = icalcomponent_get_inner(self._ref)
def inner_component(self): inner = icalcomponent_get_inner(self._ref)
38,107
def add_component(self, comp): "Adds a child component."
def add_component(self, comp): "Adds a child component."
38,108
def NewComponent(c): "Converts a string or C icalcomponent into the right component object." wasStr=0 # Were we passed a string or an icalcomponent? if isinstance (c, StringType) and string.find(c,"icalcomponent") == -1: comp = icalparser_parse_string(c) else: comp = c if comp == None or comp == 'NULL': raise Value...
def NewComponent(c): "Converts a string or C icalcomponent into the right component object." wasStr=0 # Were we passed a string or an icalcomponent? if isinstance (c, StringType) and string.find(c,"icalcomponent") == -1: comp = icalparser_parse_string(c) else: comp = c if comp == None or comp == WrapperNULL: raise ...
38,109
def last_modified(self, v=None): """Sets or returns the value of the LAST-MODIFIED property.
def last_modified(self, v=None): """Sets or returns the value of the LAST-MODIFIED property.
38,110
def test_governor_system_stop(self): options = DummyOptions() config = DummyPConfig('notthere', '/notthere', logfile='/tmp/foo') instance = self._makeOne(options, config) options.backofflimit = 1 options.forever = False instance.backoff = 1 # gt backofflimit instance.laststart = time.time() instance.governor() self.ass...
def test_governor_system_stop(self): options = DummyOptions() config = DummyPConfig('notthere', '/notthere', logfile='/tmp/foo') instance = self._makeOne(options, config) options.backofflimit = 1 options.forever = False instance.backoff = 1 # gt backofflimit instance.laststart = time.time() instance.governor() self.ass...
38,111
def sigchild(self, sig, frame): # do nothing here, we reap our children synchronously self.options.logger.info('received %s' % signame(sig))
def sigchild(self, sig, frame): # do nothing here, we reap our children synchronously self.options.logger.info('received %s' % signame(sig))
38,112
def make_connection(self, host): serverurl = self.serverurl if not serverurl.startswith('http'): if serverurl.startswith('unix://'): serverurl = serverurl[7:] http = UnixStreamHTTP(serverurl) return http else: return xmlrpclib.Transport.make_connection(self, serverurl)
def make_connection(self, host): serverurl = self.serverurl if not serverurl.startswith('http'): if serverurl.startswith('unix://'): serverurl = serverurl[7:] http = UnixStreamHTTP(serverurl) return http else: type, uri = urllib.splittype(serverurl) host, path = urllib.splithost(uri) hostpath = host+path return xmlrpcl...
38,113
def restartprocess(): if callback() is NOT_DONE_YET: return NOT_DONE_YET return 'Process %s restarted' % processname
def restartprocess(): result = callback() if result is NOT_DONE_YET: return NOT_DONE_YET return 'Process %s restarted' % processname
38,114
def cgi_environment(self): env = {}
def cgi_environment(self): env = {}
38,115
def found_terminator (self): """ We only override this to use 'deferring_http_request' class instead of the normal http_request class; it sucks to need to override this """ if self.current_request: self.current_request.found_terminator() else: header = self.in_buffer self.in_buffer = '' lines = string.split (header, '...
deffound_terminator(self):"""Weonlyoverridethistouse'deferring_http_request'classinsteadofthenormalhttp_requestclass;itsuckstoneedtooverridethis"""ifself.current_request:self.current_request.found_terminator()else:header=self.in_bufferself.in_buffer=''lines=string.split(header,'\r\n')
38,116
def writable(self, t=time.time): now = t() if self.delay: # we called a deferred producer on this channel (see refill_buffer) elapsed = now - self.last_writable_check if elapsed < self.delay: return False self.last_writable_check = now
def writable(self, t=time.time): now = t() if self.delay: # we called a deferred producer on this channel (see refill_buffer) elapsed = now - self.last_writable_check if elapsed > self.delay: return True self.last_writable_check = now
38,117
def writable(self, t=time.time): now = t() if self.delay: # we called a deferred producer on this channel (see refill_buffer) elapsed = now - self.last_writable_check if elapsed < self.delay: return False self.last_writable_check = now
def writable(self, t=time.time): now = t() if self.delay: # we called a deferred producer on this channel (see refill_buffer) elapsed = now - self.last_writable_check if elapsed < self.delay: return False self.last_writable_check = now
38,118
def log(self, msg): if msg.endswith('\n'): msg = msg[:-1] options.logger.debug(msg)
def log(self, msg): if msg.endswith('\n'): msg = msg[:-1] options.logger.debug(msg)
38,119
def test_ctor(self): options = DummyOptions() config = DummyPConfig('cat', 'bin/cat', logfile='/tmp/temp123.log') instance = self._makeOne(options, config) self.assertEqual(instance.options, options) self.assertEqual(instance.config, config) self.assertEqual(instance.laststart, 0) self.assertEqual(instance.childlog.arg...
def test_ctor(self): options = DummyOptions() config = DummyPConfig('cat', 'bin/cat', logfile='/tmp/temp123.log') instance = self._makeOne(options, config) self.assertEqual(instance.options, options) self.assertEqual(instance.config, config) self.assertEqual(instance.laststart, 0) self.assertEqual(instance.childlog.arg...
38,120
def getLogger(self, *args): logger = DummyLogger() logger.handlers = [DummyLogger()] logger.args = args return logger
def getLogger(self, *args, **kw): logger = DummyLogger() logger.handlers = [DummyLogger()] logger.args = args return logger
38,121
def getLogger(self, *args): logger = DummyLogger() logger.handlers = [DummyLogger()] logger.args = args return logger
def getLogger(self, *args): logger = DummyLogger() logger.handlers = [DummyLogger()] logger.args = args, kw return logger
38,122
def continue_request (self, data, request): logger = self.supervisord.options.logger try:
def continue_request (self, data, request): logger = self.supervisord.options.logger try:
38,123
def continue_request (self, data, request): logger = self.supervisord.options.logger try:
def continue_request (self, data, request): logger = self.supervisord.options.logger try:
38,124
def getServerProxy(self): # mostly put here for unit testing return xmlrpclib.ServerProxy( self.serverurl, transport = BasicAuthTransport(self.username, self.password) )
def getServerProxy(self): # mostly put here for unit testing return xmlrpclib.ServerProxy( 'http://127.0.0.1', transport = BasicAuthTransport(self.username, self.password) )
38,125
def getServerProxy(self): # mostly put here for unit testing return xmlrpclib.ServerProxy( self.serverurl, transport = BasicAuthTransport(self.username, self.password) )
def getServerProxy(self): # mostly put here for unit testing return xmlrpclib.ServerProxy( self.serverurl, transport = BasicAuthTransport(self.username, self.password, self.serverurl) )
38,126
def __cmp__(self, other): return cmp(self.priority, other.priority)
def __cmp__(self, other): return cmp(self.priority, other.priority)
38,127
def request(self, host, handler, request_body, verbose=False): # issue XML-RPC request
def request(self, host, handler, request_body, verbose=False): # issue XML-RPC request
38,128
def request(self, host, handler, request_body, verbose=False): # issue XML-RPC request
defdef make_connection(self, host): serverurl = self.serverurl if not serverurl.startswith('http'): if serverurl.startswith('unix://'): serverurl = serverurl[7:] http = UnixStreamHTTP(serverurl) return http else: return xmlrpclib.Transport.make_connection(self, serverurl) class UnixStreamHTTPConnection(httplib.HTTPCon...
38,129
def _load(self, resource): Folder._load(self, resource) # XXX This may be removed.. self.added_documents = {} self.removed_documents = []
def document_numbers = [ int(x[1:]) for x in self.resource.get_resource_names() if x.startswith('d') ] if document_numbers: self.document_number = max(document_numbers) + 1 else: self.document_number = 0 _load(self, document_numbers = [ int(x[1:]) for x in self.resource.get_resource_names() if x.startswith('d') ] if d...
38,130
def get_new_document_number(self): documents = [ int(x[1:]) for x in self.resource.get_resource_names() if x.startswith('d') ] documents += self.added_documents.keys() if documents: documents.sort() return documents[-1] + 1 return 0
def get_new_document_number(self): documents = [ int(x[1:]) for x in self.resource.get_resource_names() if x.startswith('d') ] documents += self.added_documents.keys() if documents: documents.sort() return documents[-1] + 1 return 0
38,131
def handle_request(connection, server): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] else: # Keep here (though redundant) to be used later in the access log request_line = request.state.request_line ...
def handle_request(connection, server): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] else: # Keep here (though redundant) to be used later in the access log request_line = request.state.request_line ...
38,132
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, Path): path = Path(path)
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, Path): path = Path(path)
38,133
def parser3(self): token, lexeme = self.get_token() if token == TCLOSE: token, lexeme = self.get_token() if token == TEOF: return
def parser3(self): token, lexeme = self.get_token() if token == TCLOSE: token, lexeme = self.get_token() if token == TEOF: return
38,134
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,135
def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package)
def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package)
38,136
def is_outdated(self): mtime = self.resource.get_mtime() return mtime is None or mtime > self.timestamp
def is_outdated(self): mtime = self.resource.get_mtime() return mtime is None or mtime > self.timestamp
38,137
def commit_transaction(cls): transaction = cls.get_transaction() while transaction: handler = transaction.pop() # XXX Maybe we should check the timestamp to know wether the # handler has really changed handler.save()
def commit_transaction(cls): transaction = cls.get_transaction() while transaction: handler = transaction.pop() # XXX Maybe we should check the timestamp to know wether the # handler has really changed handler.save()
38,138
def commit_transaction(self, context): # Get the transaction transaction = get_transaction() # Nothing to commit if not transaction: return
def commit_transaction(self, context): # Get the transaction transaction = get_transaction() # Nothing to commit if not transaction: return
38,139
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
38,140
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
38,141
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
38,142
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path)
38,143
def GET(self, context): request, response = context.request, context.response # This is a safe method context.commit = False # Our canonical URLs never end with an slash if context.uri.path.endswith_slash: goto = copy(context.uri) goto.path.endswith_slash = False return 302, goto # Traverse status, method = self.traver...
def GET(self, context): request, response = context.request, context.response # This is a safe method context.commit = False # Our canonical URLs never end with an slash if context.uri.path.endswith_slash: goto = copy(context.uri) goto.path.endswith_slash = False return 302, goto # Traverse status, method = self.traver...
38,144
def start(self): if self.pid_file is not None: pid = os.getpid() open(self.pid_file, 'w').write(str(pid))
def start(self): if self.pid_file is not None: pid = os.getpid() open(self.pid_file, 'w').write(str(pid))
38,145
def get_catalog_indexes(self): from access import RoleAware
def get_catalog_indexes(self): from access import RoleAware
38,146
def to_str(self, encoding='UTF-8'): lines = [] # When schema or columns (or both) are None there is plain # string to string conversion if self.schema and self.columns: for line in self.state.lines: line = [ '"%s"' % self.schema[self.columns[i]].encode(value) for i, value in enumerate(line) ] lines.append(','.join(line...
def to_str(self, encoding='UTF-8'): lines = [] # When schema or columns (or both) are None there is plain # string to string conversion if self.schema and self.columns: for line in self.state.lines: line = [ '"%s"' % self.schema[self.columns[i]].encode(value) for i, value in enumerate(line) ] lines.append(','.join(line...
38,147
def _index_term(self, term, documents): """ Indexes the given term. The parameter 'documents' is a mapping from document number to list of positions:
def _index_term(self, term, documents): """ Indexes the given term. The parameter 'documents' is a mapping from document number to list of positions:
38,148
def _unindex_term(self, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ if word: if self.children is None: self.load_children()
def _unindex_term(self, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ if word: if self.children is None: self.load_children()
38,149
def start(self): if self.pid_file is not None: pid = os.getpid() open(self.pid_file, 'w').write(str(pid))
def start(self): if self.pid_file is not None: pid = os.getpid() open(self.pid_file, 'w').write(str(pid))
38,150
def start_transaction(self): get_transaction().begin()
def start_transaction(self): get_transaction().begin()
38,151
def abort_transaction(self): get_transaction().abort()
def abort_transaction(self): get_transaction().abort()
38,152
def commit_transaction(self): get_transaction().commit()
def commit_transaction(self): get_transaction().commit()
38,153
def __init__(self, title, description, state='open'): self.title = title self.description = description self.state = state
def __init__(self, title, description, state='open'): self.title = title self.description = description self.state = state
38,154
def view(self): # Load the STL template handler = get_handler('TaskTracker_view.xml')
def view(self): # Load the STL template handler = get_handler('TaskTracker_view.xml')
38,155
def get_mimetype(self): return self.resource.get_mimetype()
def get_mimetype(self): return self.resource.get_mimetype()
38,156
def get_user_menu(self): """Return a dict {user_icon, user, joinisopen}.""" context = get_context() user = context.user here = context.handler root = context.root
def get_user_menu(self): """Return a dict {user_icon, user, joinisopen}.""" context = get_context() user = context.user here = context.handler root = context.root
38,157
def commit_revision(self): context = get_context() user = context.user
def commit_revision(self): context = get_context() user = context.user
38,158
def commit_revision(self): context = get_context() user = context.user
def commit_revision(self): context = get_context() user = context.user
38,159
def start(parser, options, target): # Load the config config = get_config(target) # Import the root class if is not the default if config.has_option('instance', 'root'): exec('import %s' % config.get('instance', 'root')) # Load the root handler database = get_database(target) root = get_root(database) root.name = roo...
def start(parser, options, target): # Load the config config = get_config(target) # Import the root class if is not the default if config.has_option('instance', 'root'): exec('import %s' % config.get('instance', 'root')) # Load the root handler database = get_database(target) root = get_root(database) root.name = roo...
38,160
def start(parser, options, target): # Load the config config = get_config(target) # Import the root class if is not the default if config.has_option('instance', 'root'): exec('import %s' % config.get('instance', 'root')) # Load the root handler database = get_database(target) root = get_root(database) root.name = roo...
def start(parser, options, target): # Load the config config = get_config(target) # Import the root class if is not the default if config.has_option('instance', 'root'): exec('import %s' % config.get('instance', 'root')) # Load the root handler database = get_database(target) root = get_root(database) root.name = roo...
38,161
def unindex_document(self, doc_n): if doc_n in self.added_documents: self.added_documents.remove(doc_n) else: self.removed_documents.append(doc_n)
def unindex_document(self, doc_n): if doc_n in self.added_documents: self.added_documents.remove(doc_n) else: self.removed_documents.append(doc_n)
38,162
def __init__(self, handler, depth=None, count=None): from Folder import Folder as DatabaseFolder
def __init__(self, handler, depth=None, count=None): from Folder import Folder as DatabaseFolder
38,163
def to_str(self): state = self.state
def to_str(self): state = self.state
38,164
def to_str(self): state = self.state
def to_str(self): state = self.state
38,165
def del_resource(self, path): return self.resource.del_resource(path)
def del_resource(self, path): return self.resource.del_resource(path)
38,166
def _get_handler(self, segment, resource): # Build and return the handler return Handler.build_handler(resource)
def _get_handler(self, segment, resource): # Build and return the handler return Handler.build_handler(resource)
38,167
def _set_handler(self, segment, handler): self.resource.set_resource(segment.name, handler.resource)
def _set_handler(self, segment, handler): self.resource.set_resource(segment.name, handler.resource)
38,168
def del_handler(self, path): if not isinstance(path, uri.Path): path = uri.Path(path)
def del_handler(self, path): if not isinstance(path, uri.Path): path = uri.Path(path)
38,169
def __call__(self, namespace={}): # XXX Rewrite with walk.
def __call__(self, namespace={}): # XXX Rewrite with walk.
38,170
def __call__(self, namespace={}): # XXX Rewrite with walk.
def __call__(self, namespace={}): # XXX Rewrite with walk.
38,171
def __call__(self, namespace={}): # XXX Rewrite with walk.
def __call__(self, namespace={}): # XXX Rewrite with walk.
38,172
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
38,173
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
38,174
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
38,175
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
def process(self, node, stack, repeat_stack): # Raw nodes if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node)
38,176
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,177
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,178
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,179
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,180
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,181
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,182
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,183
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,184
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,185
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,186
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {})
38,187
def _get_resource(self, name): reference = self.uri.resolve(name) return get_resource(reference)
def _get_resource(self, name): reference = self.uri.path.resolve2(name) return get_resource(reference)
38,188
def _set_file_resource(self, name, resource): object = self._get_object() object._setOb(name, ZopeFile(name, '', resource.get_data()))
def _set_file_resource(self, name, resource): object = self._get_object() object._setOb(name, ZopeFile(name, '', resource.get_data()))
38,189
def _set_folder_resource(self, name, resource): object = self._get_object() object._setOb(name, ZopeFolder(name))
def _set_folder_resource(self, name, resource): object = self._get_object() object._setOb(name, ZopeFolder(name))
38,190
def _del_file_resource(self, name): object = self._get_object() object._delOb(name)
def _del_file_resource(self, name): object = self._get_object() object._delOb(name)
38,191
def _del_folder_resource(self, name): object = self._get_object() object._delOb(name)
def _del_folder_resource(self, name): object = self._get_object() object._delOb(name)
38,192
def index_document(self, document): # Mark as changed self.set_changed()
def index_document(self, document): # Mark as changed self.set_changed()
38,193
def remove(self, context): ids = context.get_form_values('ids') if not ids: return context.come_back(u'No objects selected.')
def remove(self, context): ids = context.get_form_values('ids') if not ids: return context.come_back(u'No objects selected.')
38,194
def test_add_file(self): root = self.database.get_resource('/') resource = memory.File('hello') root.set_resource('test.txt', resource)
def test_add_file(self): root = self.database.get_resource('/') resource = memory.File('hello') root.set_resource('test.txt', resource)
38,195
def get_form_value(self, name, default=None): value = self.request.get_parameter(name) if isinstance(value, list): return value[0] return value
def get_form_value(self, name, default=None): value = self.request.get_parameter(name, default) if isinstance(value, list): return value[0] return value
38,196
def non_blocking_load(self, file): """ Loads the request state from in non-blocking mode. Aimed at sockets, it works for files too. """ # Read the request line line = file.readline() while line is None: yield None line = file.readline() # Parse the request line self.request_line = line method, request_uri, http_version...
def non_blocking_load(self, file): """ Loads the request state from in non-blocking mode. Aimed at sockets, it works for files too. """ # Read the request line line = file.readline() while line is None: yield None line = file.readline() # Parse the request line self.request_line = line method, request_uri, http_version...
38,197
def copy_handler(self): resource = memory.Folder() for name in self.resource.get_resource_names(): resource.set_resource(name, self.resource.get_resource(name)) self.save(resource) return self.__class__(resource)
def copy_handler(self): resource = memory.Folder() for handler in self.traverse(): if handler is not self: path = self.get_pathto(handler) resource.set_resource(path, handler.resource) self.save(resource) return self.__class__(resource)
38,198
def _get_handler(self, segment, uri): name = segment.name # Metadata if name.endswith('.metadata'): return Metadata(uri) # Locks if name.endswith('.lock'): return Lock(uri)
def _get_handler(self, segment, uri): name = segment.name # Metadata if name.endswith('.metadata'): return Metadata(uri) # Locks if name.endswith('.lock'): return Lock(uri)
38,199