rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
version = "0.4.2", | version = "0.4.3", | def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError, \ "'package' must be a string (dot-separated), list, or tuple" | 4ca603774b1b87d3f3ebdf67c1815dbb1d6fda2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ca603774b1b87d3f3ebdf67c1815dbb1d6fda2b/setup.py |
raise UserError, self.gettext(u'The document name contains illegal characters, choose another one.') | message = (u'The document name contains illegal characters,' u' choose another one.') raise UserError, self.gettext(message) | def upload_file(self, file=None, **kw): if file is None: raise UserError, self.gettext(u'The file must be entered') | a551ce1db48cfea610459f516fbcf700243514eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a551ce1db48cfea610459f516fbcf700243514eb/Folder.py |
raise UserError, self.gettext(u'There is already another resource with this name.') | message = u'There is already another resource with this name.' raise UserError, self.gettext(message) | def upload_file(self, file=None, **kw): if file is None: raise UserError, self.gettext(u'The file must be entered') | a551ce1db48cfea610459f516fbcf700243514eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a551ce1db48cfea610459f516fbcf700243514eb/Folder.py |
class RDFTestCase(TestCase): def test_parsing(self): resource = get_resource('test.rdf') handler = RDF(resource) | def setUp(self): # Load the scheme r = get_resource('es.xsd') doc = XML.Document(r) | cf1f5d16955dc7e1225a6b2957d433a9eeade43c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/cf1f5d16955dc7e1225a6b2957d433a9eeade43c/test_xsd.py | |
XML.registry.set_namespace('http://www.lisa.org/tmx', self.schema) print"==========================================" | subject = u'http://www.example.org/index.html' self.assertEqual(handler.graph, {subject: [(u'title', u'The itools reference manual'), (u'description', u'')]}) | def setUp(self): # Load the scheme r = get_resource('es.xsd') doc = XML.Document(r) | cf1f5d16955dc7e1225a6b2957d433a9eeade43c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/cf1f5d16955dc7e1225a6b2957d433a9eeade43c/test_xsd.py |
def test_simple(self): rr = get_resource('es.xml') doc = XML.Document(rr) | def setUp(self): # Load the scheme r = get_resource('es.xsd') doc = XML.Document(r) | cf1f5d16955dc7e1225a6b2957d433a9eeade43c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/cf1f5d16955dc7e1225a6b2957d433a9eeade43c/test_xsd.py | |
content = 'msgid "Add"\n' \ 'msgstr "Aadir\\n"\n' po = parsers.PO(content) assert po.messages == {('Add',): ([], ['Aadir\n'])} | content = [" " " " " " 'msgid "Add"', 'msgstr "Anadir\\n"'] content = '\n'.join(content) po = parsers.PO content = memory.File(content) p = po.PO(content) assert p.messages[0].msgid == ['Add'] assert p.messages[0].msgstr[0] == 'Anadir\n' | def test_case1(self): """Test for newlines.""" content = 'msgid "Add"\n' \ 'msgstr "Aadir\\n"\n' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
po = parsers.PO(content) assert po.messages == {('Hello world',): ([], ['', 'Hola ', 'mundo'])} | po = parsers.PO content = memory.File(content) p = po.PO(content) assert p.messages[0].msgid == ['Hello world'] assert p.messages[0].msgstr == [u'', u'Hola ', u'mundo'] | def test_case2(self): """Test for multiple lines""" content = 'msgid "Hello world"\n' \ 'msgstr ""\n' \ '"Hola "\n' \ '"mundo"\n' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
po = parsers.PO(content) assert po.messages == {('test',): ([], ['Esto es una "prueba"'])} | p = parsers.PO.PO(memory.File(content)) assert p.messages[0].msgid == ['test'] assert p.messages[0].msgstr == [u'Esto es una "prueba"'] | def test_case3(self): """Test for double quotes.""" content = 'msgid "test"\n' \ 'msgstr "Esto es una \\"prueba\\""\n' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
po = parsers.PO(content) assert po.write() == content | p = parsers.PO.PO(memory.File(content)) assert p.messages[0].msgid == ['Hello'] assert p.messages[0].msgstr == [u'', u'Hola\n'] | def test_output(self): """Test output""" content = '# Comment\n' \ 'msgid "Hello"\n' \ 'msgstr ""\n' \ '"Hola\\n"\n' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
data = '<p>hello world</p>' xhtml = parsers.XHTML(data) messages = xhtml.get_messages() assert messages == [u'hello world'] | data = self.template % '<p>hello litle world</p>' data = memory.File(data) xhtml = parsers.XHTML.Document(data) messages = list(xhtml.get_messages()) assert messages == [u'hello litle world'] | def test_case1(self): """Test element content.""" data = '<p>hello world</p>' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
data = '<img alt="The beach" src="beach.jpg" />' xhtml = parsers.XHTML(data) messages = xhtml.get_messages() | data = self.template % '<img alt="The beach" src="beach.jpg" />' data = memory.File(data) xhtml = parsers.XHTML.Document(data) messages = list(xhtml.get_messages()) | def test_case2(self): """Test simple attribute.""" data = '<img alt="The beach" src="beach.jpg" />' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
data = '<html>\n' \ '<input type="text" name="id" />\n' \ '<input type="submit" value="Change" />\n' \ '</html>' xhtml = parsers.XHTML(data) messages = xhtml.get_messages() | data = self.template % """<input type="text" name="id" /> <input type="submit" value="Change" />""" data = memory.File(data) xhtml = parsers.XHTML.Document(data) messages = list(xhtml.get_messages()) | def test_case3(self): """Test complex attribute.""" data = '<html>\n' \ '<input type="text" name="id" />\n' \ '<input type="submit" value="Change" />\n' \ '</html>' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
html = '<p>hello world</p>' | html = self.template % '<p>hello world</p>' po = 'msgid "hello world"\n' \ 'msgstr "hola mundo"\n' p = parsers.PO.PO(memory.File(po)) html = memory.File(html) xhtml = parsers.XHTML.Document(html) html = xhtml.translate(p) html = memory.File(html) xhtml = parsers.XHTML.Document(html) data = list(xhtml.get_messages()... | def test_case4(self): """Test translation of an element content""" html = '<p>hello world</p>' po = 'msgid "hello world"\n' \ 'msgstr "hola mundo"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
xhtml = parsers.XHTML(html) data = xhtml.translate(po) assert data == '<p>hola mundo</p>' | p = parsers.PO.PO(memory.File(po)) html = memory.File(html) xhtml = parsers.XHTML.Document(html) html = xhtml.translate(p) result = self.template % '<p>hola mundo </p>' assert html == result | def test_case4(self): """Test translation of an element content""" html = '<p>hello world</p>' po = 'msgid "hello world"\n' \ 'msgstr "hola mundo"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
html = '<img alt="The beach" src="beach.jpg" />' | html = '<img alt="The beach" src="beach.jpg"/>' | def test_case5(self): """Test translation of an element content""" html = '<img alt="The beach" src="beach.jpg" />' po = 'msgid "The beach"\n' \ 'msgstr "La playa"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
xhtml = parsers.XHTML(html) data = xhtml.translate(po) assert data == '<img src="beach.jpg" alt="La playa"></img>' | p = parsers.PO.PO(memory.File(po)) html = memory.File(html) xhtml = parsers.XHTML.Document(html) | def test_case5(self): """Test translation of an element content""" html = '<img alt="The beach" src="beach.jpg" />' po = 'msgid "The beach"\n' \ 'msgstr "La playa"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
html = '<html>\n' \ '<input type="text" name="id" />\n' \ '<input type="submit" value="Change" />\n' \ '</html>' | html = self.template % '<input type="text" name="id"/>\n' \ '<input type="submit" value="Change"/>' | def test_case6(self): """Test translation of an element content""" html = '<html>\n' \ '<input type="text" name="id" />\n' \ '<input type="submit" value="Change" />\n' \ '</html>' po = 'msgid "Change"\n' \ 'msgstr "Cambiar"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
xhtml = parsers.XHTML(html) data = xhtml.translate(po) assert data == '<html>\n' \ '<input type="text" name="id"></input>\n' \ '<input type="submit" value="Cambiar"></input>\n' \ '</html>' class HMLTestCase(TestCase): def test_case1(self): """Test element content.""" data = '<p>hello world</p>' html = parsers.HTML(... | p = parsers.PO.PO(memory.File(po)) html = memory.File(html) xhtml = parsers.XHTML.Document(html) html = xhtml.translate(p) result = self.template % '<input type="text" name="id"/>\n' \ '<input type="submit" value="Cambiar/">' assert html == result | def test_case6(self): """Test translation of an element content""" html = '<html>\n' \ '<input type="text" name="id" />\n' \ '<input type="submit" value="Change" />\n' \ '</html>' po = 'msgid "Change"\n' \ 'msgstr "Cambiar"' | a3c81c1d735ba1868ba3eb465b674f362e597962 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c81c1d735ba1868ba3eb465b674f362e597962/test_parsers.py |
'mtime': str(self.resource.get_mtime().strftime('%Y%m%d%H%M%S')), | 'mtime': str(vfs.get_mtime(self.uri).strftime('%Y%m%d%H%M%S')), | def get_catalog_indexes(self): name = self.name abspath = self.get_abspath() get_property = self.get_metadata().get_property title = get_property('dc:title') | 084617dbaa68b25b090bfd84e85945a04fcab37c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/084617dbaa68b25b090bfd84e85945a04fcab37c/catalog.py |
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) ] | schema = self.schema columns = self.columns if schema and columns: datatypes = [ (i, schema[x]) for i, x in enumerate(columns) ] for row in self.state.lines: line = [ '"%s"' % datatype.encode(row[i]).replace('"', '""') for i, datatype in datatypes ] | 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... | 626f975eddd0c0b2fe69070c72791e25362c7b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/626f975eddd0c0b2fe69070c72791e25362c7b6b/itools_csv.py |
line = [ '"%s"' % x.encode(encoding) for x in line ] | line = [ '"%s"' % x.encode(encoding).replace('"', '""') for x in 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... | 626f975eddd0c0b2fe69070c72791e25362c7b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/626f975eddd0c0b2fe69070c72791e25362c7b6b/itools_csv.py |
original = str(path.resolve(filename[1:-4])) | original = path.resolve(filename[1:-4]) | def rollback(database): transaction = get_transaction() for reference in transaction: path = reference.path filename = path[-1].name marker = filename[-3:] original = str(path.resolve(filename[1:-4])) backup = str(path) if marker == 'tmp': remove(backup) elif marker == 'add': FileFS.remove(original) remove(backup) elif... | ba8e1b9de380a9ad2af0e7b916bea57b16e5741c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ba8e1b9de380a9ad2af0e7b916bea57b16e5741c/database.py |
print value | def Bool(value): print value yield str(int(value)), 0 | d3dfd5454bca417bb047ede85667d4c3df618236 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d3dfd5454bca417bb047ede85667d4c3df618236/Analysers.py | |
names = [ x.name for x in handlers if x.is_allowed_to_copy() ] | ac = self.get_access_control() names = [ x.name for x in handlers if ac.is_allowed_to_copy(context.user, x) ] | def copy(self, context): ids = context.get_form_values('ids') # Filter names which the authenticated user is not allowed to copy handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_copy() ] | b369449b186823a1e837c9bb070c6d11eb6f859f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/b369449b186823a1e837c9bb070c6d11eb6f859f/Folder.py |
names = [ x.name for x in handlers if x.is_allowed_to_move() ] | ac = self.get_access_control() names = [ x.name for x in handlers if ac.is_allowed_to_move(context.user, x) ] | def cut(self, context): ids = context.get_form_values('ids') # Filter names which the authenticated user is not allowed to move handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_move() ] | b369449b186823a1e837c9bb070c6d11eb6f859f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/b369449b186823a1e837c9bb070c6d11eb6f859f/Folder.py |
if node.name == 'script': | if node.name == 'script' or node.name == 'style': | def before(node, context): message = context.message if isinstance(node, XML.Raw): message.append(node.data) elif isinstance(node, XML.Element): # Skip <script> (XXX do the same with <style>??) if node.name == 'script': process_message(context) return True # Attributes for attribute in node.attributes: if node.is_trans... | dfd28e99aafd6a61271af18a714ab3667ef210e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/dfd28e99aafd6a61271af18a714ab3667ef210e5/XHTML.py |
if not x.name.startswith('.'): | if isinstance(x, CatalogAware): | def after_set_handler(self, segment, handler, format=None, id=None, move=False, **kw): from root import Root | 624daf30353b1ab8b0053f176c4d2d5f0d578397 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/624daf30353b1ab8b0053f176c4d2d5f0d578397/Folder.py |
mimetype = self.get_mimetype() | metadata = self.get_metadata() if metadata is None: mimetype = self.get_mimetype() else: mimetype = self.get_property('format') | def download(self): context = get_context() request, response = context.request, context.response | 87be32d9c8d5020e7f87a9cf6af238b249b7d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/87be32d9c8d5020e7f87a9cf6af238b249b7d8b9/text.py |
path_to_icon = uri.Path('%s/' % name).resolve(path_to_icon) | path_to_icon = Path('%s/' % name).resolve(path_to_icon) | def browse_namespace(self, icon_size, sortby='title_or_name', sortorder='up', batchstart='0', batchsize='20', query={}, results=None): context = get_context() request = context.request | c6b89346db4edd14edfe6dc10c917a6a9c494cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c6b89346db4edd14edfe6dc10c917a6a9c494cd5/Folder.py |
path = uri.Path(selected_image) | path = Path(selected_image) | def browse_image(self, context): selected_image = context.get_form_value('selected_image') selected_index = None | c6b89346db4edd14edfe6dc10c917a6a9c494cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c6b89346db4edd14edfe6dc10c917a6a9c494cd5/Folder.py |
return uri.get_reference(';rename_form?%s' % ids_list) | return get_reference(';rename_form?%s' % ids_list) | def rename_form(self, context): ids = context.get_form_values('ids') # Filter names which the authenticated user is not allowed to move handlers = [ self.get_handler(x) for x in ids ] ac = self.get_access_control() names = [ x.name for x in handlers if ac.is_allowed_to_move(context.user, x) ] | c6b89346db4edd14edfe6dc10c917a6a9c494cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c6b89346db4edd14edfe6dc10c917a6a9c494cd5/Folder.py |
goto = uri.get_reference(';%s' % self.get_browse_view()) | goto = get_reference(';%s' % self.get_browse_view()) | def rename(self, context): names = context.get_form_value('names') new_names = context.get_form_value('new_names') # Process input data for i, old_name in enumerate(names): xxx, extension, language = FileName.decode(old_name) new_name = FileName.encode((new_names[i], extension, language)) new_name = checkid(new_name) i... | c6b89346db4edd14edfe6dc10c917a6a9c494cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c6b89346db4edd14edfe6dc10c917a6a9c494cd5/Folder.py |
goto = uri.get_reference(goto) | goto = get_reference(goto) | def upload_file(self, context): file = context.get_form_value('file') if file is None: return context.come_back(u'The file must be entered') | c6b89346db4edd14edfe6dc10c917a6a9c494cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c6b89346db4edd14edfe6dc10c917a6a9c494cd5/Folder.py |
data.append('Date: %s' % now.strftime("%a, %d %b %Y %H:%M:%S +0000")) | data.append('Date: %s' % HTTPDate.encode(now)) | def to_str(self): state = self.state | 5b4ee5dd26761c5c0ccf3ec3b5d1bc11ebeaf3ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5b4ee5dd26761c5c0ccf3ec3b5d1bc11ebeaf3ca/response.py |
return self.gettext(message) | return self.gettext(message).encode('utf-8') | def forbidden(self, context): message = (u'Access forbidden, you are not authorized to access' u' this resource.') return self.gettext(message) | abf2bd67971002abeb59dc0d86e1fddbc4109b52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/abf2bd67971002abeb59dc0d86e1fddbc4109b52/root.py |
value = type.decode(value) | try: value = type.decode(value) except ValueError: warnings.warn('Unable to decode "%s"' % name) | def decode(cls, node): schema = cls.schema property = cls() for node in node.get_elements(): name = node.name # Decode the value if name in schema: type, default = schema[name] if issubclass(type, SimpleType): value = unicode(node.children) value = type.decode(value) elif issubclass(type, ComplexType): value = type.dec... | abfc8964a8a773d5b7316789c2ed006596759bb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/abfc8964a8a773d5b7316789c2ed006596759bb5/Schema.py |
languages = [ x.split('.')[-1] for x in self.resource.get_resource_names() | languages = [ x.split('.')[-1] for x in vfs.get_names(self.uri) | def _get_virtual_handler(self, segment): name = segment.name | 061b342d88141e6ce3e016b5de7b3ad2b6e72ee4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/061b342d88141e6ce3e016b5de7b3ad2b6e72ee4/Folder.py |
A budy block format is: | A busy block format is: | def _get_free_slot(self): """ Internal method that returns a free slot. If none exists a new one is allocated. | a8eed2d4a4a765e663892c0caa7f5660443a99b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a8eed2d4a4a765e663892c0caa7f5660443a99b4/IIndex.py |
- free slot (size - 1) | - free slot (size - 2) | def _get_free_slot(self): """ Internal method that returns a free slot. If none exists a new one is allocated. | a8eed2d4a4a765e663892c0caa7f5660443a99b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a8eed2d4a4a765e663892c0caa7f5660443a99b4/IIndex.py |
or path.endswith('/.') \ or path.endswith('/..') | or path.endswith('/.') | def normalize_path(path): """ Normalize the path (we don't use os.path because on Windows it converts forward slashes to back slashes). Examples: a//b/c : a/b/c a/./b/c : a/b/c a/b/c/../d : a/b/d /../a/b/c : /a/b/c """ if not isinstance(path, str) and not isinstance(path, unicode): raise TypeError, 'path must... | 1f9ccb2258bb79d34b35cbd47235b535ca536d3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1f9ccb2258bb79d34b35cbd47235b535ca536d3b/uri.py |
def get_pathto(self, path): """ If 'self' and 'path' are absolute, a relative path 'x' is returned so self.resolve(x) = path. """ if not isinstance(path, Path): path = Path(path) | 1f9ccb2258bb79d34b35cbd47235b535ca536d3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1f9ccb2258bb79d34b35cbd47235b535ca536d3b/uri.py | ||
self.del_handler('d%d' % doc_number) | self.del_handler('d%07d' % doc_number) | def _save(self): # Remove documents for doc_number in self.removed_documents: self.del_handler('d%d' % doc_number) self.removed_documents = [] # Add documents for doc_number, document in self.added_documents.items(): self.set_handler('d%d' % doc_number, document) self.added_documents = {} # Save indexes fields = self.g... | 404ff3d3e92cba5a136d06cad03e121ebbacf340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/404ff3d3e92cba5a136d06cad03e121ebbacf340/Catalog.py |
self.set_handler('d%d' % doc_number, document) | self.set_handler('d%07d' % doc_number, document) | def _save(self): # Remove documents for doc_number in self.removed_documents: self.del_handler('d%d' % doc_number) self.removed_documents = [] # Add documents for doc_number, document in self.added_documents.items(): self.set_handler('d%d' % doc_number, document) self.added_documents = {} # Save indexes fields = self.g... | 404ff3d3e92cba5a136d06cad03e121ebbacf340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/404ff3d3e92cba5a136d06cad03e121ebbacf340/Catalog.py |
document = self.get_handler('d%d' % doc_number) | document = self.get_handler('d%07d' % doc_number) | def unindex_document(self, doc_number): if doc_number in self.added_documents: document = self.added_documents.pop(doc_number) else: document = self.get_handler('d%d' % doc_number) self.removed_documents.append(doc_number) for name in document.resource.get_resource_names(): if name.startswith('i'): field = document.ge... | 404ff3d3e92cba5a136d06cad03e121ebbacf340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/404ff3d3e92cba5a136d06cad03e121ebbacf340/Catalog.py |
doc_handler = self.get_handler('d%d' % doc_number) | doc_handler = self.get_handler('d%07d' % doc_number) | def search(self, query=None, **kw): # Build the query if it is passed through keyword parameters if query is None: for key, value in kw.items(): atom = Query.Simple(key, value) if query is None: query = atom else: query = Query.Complex(query, 'and', atom) # Check wether there is a query at all if query is None: raise V... | 404ff3d3e92cba5a136d06cad03e121ebbacf340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/404ff3d3e92cba5a136d06cad03e121ebbacf340/Catalog.py |
base_path = request.get_header('X-Base-Path') | base_path = uri.Path(request.get_header('X-Base-Path')) | def __init__(self, request): self.request = request self.response = Response() | 3607004ea82fcaac87f765463271f53ae3e3c265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3607004ea82fcaac87f765463271f53ae3e3c265/context.py |
request_uri.path = uri.Path('/%s%s' % (base_path,request_uri.path)) | diff_path = base_path.get_pathto(request_uri.path) request_uri.path = uri.Path('/%s' % diff_path) | def __init__(self, request): self.request = request self.response = Response() | 3607004ea82fcaac87f765463271f53ae3e3c265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3607004ea82fcaac87f765463271f53ae3e3c265/context.py |
data = getattr(document, field_name) if callable(data): data = data() | if callable(field): data = field() else: data = field | def index_document(self, document): # Get the document number doc_number = self.get_new_document_number() # Add the document to 'self.documents' fields = {} # Update the search data structure (term dictionary) for field_name in self.indexed_fields: if hasattr(document, field_name): tree = self.indexed_fields[field_name... | d24cb04f4308ea4a4410e855c488acc7cda9c41e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d24cb04f4308ea4a4410e855c488acc7cda9c41e/Segment.py |
s.append(' %s="%s"' % (qname, str(value))) | datatype = schemas.get_datatype_by_uri(namespace, local_name) value = datatype.encode(value) s.append(' %s="%s"' % (qname, value)) | def process1(node, stack, repeat, encoding='UTF-8'): """ Process stl:if, stl:attributes and stl:content. """ # Remove the element if the given expression evaluates to false if node.has_attribute(stl_uri, 'if'): stl_expression = node.get_attribute(stl_uri, 'if') if not stl_expression.evaluate(stack, repeat): return [] ... | 7a301ea427a8436770212f1a14edf79edac2094e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7a301ea427a8436770212f1a14edf79edac2094e/stl.py |
return chr(byte) | return chr(value) | def encode_byte(value): return chr(byte) | 690ad55d32197ab14b5f590373efeb6c6cfbcf0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/690ad55d32197ab14b5f590373efeb6c6cfbcf0f/IO.py |
def decode_uint32(data): return int(struct.unpack('>I', data)[0]) | 690ad55d32197ab14b5f590373efeb6c6cfbcf0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/690ad55d32197ab14b5f590373efeb6c6cfbcf0f/IO.py | ||
byte = decode_byte(data[i+1]) | byte = decode_byte(data[i]) | def decode_vint(data): byte = decode_byte(data[0]) x = byte & 0x7F i = 1 while byte & 0x80: byte = decode_byte(data[i+1]) x |= (byte & 0x7F) << (i * 7) i = i + 1 # Being a variable length value, it returns a tuple, where the first # item is the decoded value and the second one is the data that remains # to analyze. re... | 690ad55d32197ab14b5f590373efeb6c6cfbcf0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/690ad55d32197ab14b5f590373efeb6c6cfbcf0f/IO.py |
'meta_type:toto', | def external_edit(self, encoding=None, **kw): # XXX This code depends too much on Zope, while the ExternalEditor # client doesn't (using the HTTP+WebDAV protocol). # TODO extend the lock API of resources, and move the code below # playing with the Zope object to itools.resources.zope2. Think of an # implementation for ... | fc2eb15585889c2c9c07b357f01d4627defe1496 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/fc2eb15585889c2c9c07b357f01d4627defe1496/File.py | |
def _index_init(self): """Initialize csv values index list""" if self.state.indexes is None: self.state.indexes = [ None for i in self.columns ] | 931ec4409b0bc30e99367d9f85e44934564d0fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/931ec4409b0bc30e99367d9f85e44934564d0fce/itools_csv.py | ||
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... | 931ec4409b0bc30e99367d9f85e44934564d0fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/931ec4409b0bc30e99367d9f85e44934564d0fce/itools_csv.py | ||
def search(self, query): """Return list of row indexes returned by executing the query or None when one or more query items is None (query item is None when the query item column is not indexed). The query item can be: - the (column_name, value) tuple - the operator: 'or' or 'and' - the list of the previous advanced_s... | 931ec4409b0bc30e99367d9f85e44934564d0fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/931ec4409b0bc30e99367d9f85e44934564d0fce/itools_csv.py | ||
message = (u"You mistyped your actual password, " u"you account is not changed.") raise UserError, self.gettext(message) | return context.come_back(u"You mistyped your actual password, " u"your account is not changed.") | def edit_password(self, context): newpass = context.get_form_value('newpass') newpass2 = context.get_form_value('newpass2') password = context.get_form_value('password') user = context.user | 8a97c951ae9cd8e68bbf9a89cd98bb5e624000c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/8a97c951ae9cd8e68bbf9a89cd98bb5e624000c0/users.py |
for handler in self: if handler.resource.get_mtime() is not None: handler.save() | try: for handler in self: if handler.resource.get_mtime() is not None: handler.save() except: self.rollback() raise self.clear() | def commit(self): # Event: before commit for handler in list(self): if hasattr(handler, 'before_commit'): handler.before_commit() | bc7438f927f8166c7b5b1b7104305931f1f89b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bc7438f927f8166c7b5b1b7104305931f1f89b58/transactions.py |
self.clear() | def commit(self): # Event: before commit for handler in list(self): if hasattr(handler, 'before_commit'): handler.before_commit() | bc7438f927f8166c7b5b1b7104305931f1f89b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bc7438f927f8166c7b5b1b7104305931f1f89b58/transactions.py | |
files.append(join(*path[1:])) | files.append(os.path.join(*path[1:])) | def fixed_import(name, globals={}, locals={}, fromlist=[]): if name.startswith('itools.'): name = name[7:] return pythons_import(name, globals, locals, fromlist) | 327bd749c1de04f1657831ea57044f31e692f658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/327bd749c1de04f1657831ea57044f31e692f658/setup.py |
scripts = [ join(*['scripts', x]) for x in scripts ] | scripts = [ os.path.join(*['scripts', x]) for x in scripts ] | def fixed_import(name, globals={}, locals={}, fromlist=[]): if name.startswith('itools.'): name = name[7:] return pythons_import(name, globals, locals, fromlist) | 327bd749c1de04f1657831ea57044f31e692f658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/327bd749c1de04f1657831ea57044f31e692f658/setup.py |
width = context.get_form_value('width') height = context.get_form_value('height') | width = context.get_form_value('width', 48) height = context.get_form_value('height', 48) | def icon48(self, context): width = context.get_form_value('width') height = context.get_form_value('height') | d162186e5e1c01ab6665403ae5410fe5ca24c468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d162186e5e1c01ab6665403ae5410fe5ca24c468/images.py |
atime = datetime.datetime.now() self.cache[key] = (handler, atime) | if is_virtual is False: atime = datetime.datetime.now() self.cache[key] = (handler, atime) | def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path) | ef0c94cf1e5620cad4abc219aa4dde52828feb22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ef0c94cf1e5620cad4abc219aa4dde52828feb22/Folder.py |
stored.set_changed() | stored.save_state() | def index_document(self, document): # Mark as changed self.set_changed() | d73572b91d8b8e21b1d8c436408438535d967aaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d73572b91d8b8e21b1d8c436408438535d967aaf/Catalog.py |
self.timestamp = datetime.datetime.now() | container.timestamp = datetime.datetime.now() | def set_handler(self, path, handler, **kw): if not isinstance(path, uri.Path): path = uri.Path(path) | e70b81a617a7a389670cca55ea9240933fd7a475 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/e70b81a617a7a389670cca55ea9240933fd7a475/Folder.py |
self.timestamp = datetime.datetime.now() | container.timestamp = datetime.datetime.now() | def del_handler(self, path): if not isinstance(path, uri.Path): path = uri.Path(path) | e70b81a617a7a389670cca55ea9240933fd7a475 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/e70b81a617a7a389670cca55ea9240933fd7a475/Folder.py |
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... | 357fbde1eac85133258a70ab1d73787e0e82b58f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/357fbde1eac85133258a70ab1d73787e0e82b58f/icms.py | ||
server.start() | if options.debug is True: server.start() else: server.start() def stop(parser, options, target): pid = open('%s/pid' % target).read() pid = int(pid) os.kill(pid, signal.SIGTERM) | 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... | 357fbde1eac85133258a70ab1d73787e0e82b58f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/357fbde1eac85133258a70ab1d73787e0e82b58f/icms.py |
'-s', '--source', help='use the SOURCE directory to init the database') parser.add_option( | def pack(parser, options, target): database = get_database(target).database print 'Packing...', database.pack() print 'done.' | 357fbde1eac85133258a70ab1d73787e0e82b58f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/357fbde1eac85133258a70ab1d73787e0e82b58f/icms.py | |
commands = {'init': (init, ['source', 'root', 'port']), 'start': (start, ['port']), | commands = {'init': (init, ['port', 'source', 'root']), 'start': (start, ['debug', 'port']), 'stop': (stop, []), | def pack(parser, options, target): database = get_database(target).database print 'Packing...', database.pack() print 'done.' | 357fbde1eac85133258a70ab1d73787e0e82b58f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/357fbde1eac85133258a70ab1d73787e0e82b58f/icms.py |
if key not in allowed_options and value is not None: parser.error('the command "%s" does not accept the option -%s/--%s' % (command_name, key[0], key)) | if key not in allowed_options: if key == 'debug': if value is True: parser.error(error_message % (command_name, key[0], key)) elif value is not None: parser.error(error_message % (command_name, key[0], key)) | def pack(parser, options, target): database = get_database(target).database print 'Packing...', database.pack() print 'done.' | 357fbde1eac85133258a70ab1d73787e0e82b58f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/357fbde1eac85133258a70ab1d73787e0e82b58f/icms.py |
return XHTML.Element.get_raw_closetag(self) | return XHTML.Element.get_closetag(self) def handle_start_element(self, ns_uri, prefix, name): return Element(prefix, name) | def get_closetag(self): if self.name in empty_elements: return '' return XHTML.Element.get_raw_closetag(self) | 9cff56b6aee255a76986a51f4dc8f356331396dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/9cff56b6aee255a76986a51f4dc8f356331396dd/HTML.py |
return {'type': IO.Unicode} | return {'type': IO.String} | def get_attribute_schema(name): return {'type': IO.Unicode} | 961583a4a07aca5d7d2853b9483022ae0d30f127 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/961583a4a07aca5d7d2853b9483022ae0d30f127/namespaces.py |
if next >= subtotal: | if next >= total: | def __init__(self, objects, sortby=None, sortorder='up', batchstart=0, batchsize=0, getter=None, name='table'): # Get the parameters context = get_context() | 0ba7014bf6c10539676f903b3b06d3215c8a4a9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0ba7014bf6c10539676f903b3b06d3215c8a4a9a/widgets.py |
self.data = data | self.data = StringIO() self.data.write(data) | def __init__(self, data): self.data = data self.ctime = self.mtime = datetime.now() | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
data = self.data | def __setitem__(self, index, value): data = self.data if isinstance(index, slice): # XXX So far 'step' is not supported start, stop = index.start, index.stop else: start, stop = index, index + 1 self.data = data[:start] + value + data[stop:] self.mtime = datetime.now() | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py | |
start, stop = index.start, index.stop else: start, stop = index, index + 1 self.data = data[:start] + value + data[stop:] | index = index.start self.data.seek(index) self.data.write(value) | def __setitem__(self, index, value): data = self.data if isinstance(index, slice): # XXX So far 'step' is not supported start, stop = index.start, index.stop else: start, stop = index, index + 1 self.data = data[:start] + value + data[stop:] self.mtime = datetime.now() | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
self.data = self.data[:start] + value + self.data[stop:] | rest = self[stop:] self.data.seek(start) self.data.truncate() self.data.write(value) self.data.write(rest) | def __setslice__(self, start, stop, value): self.data = self.data[:start] + value + self.data[stop:] self.mtime = datetime.now() | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
self.data += value | self.data.seek(0, 2) self.data.write(value) | def append(self, value): self.data += value | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
return self.data | self.data.seek(0) return self.data.read() | def get_data(self): return self.data | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
self.data = data | self.data.seek(0) self.data.truncate() self.data.write(data) | def set_data(self, data): self.data = data self.mtime = datetime.now() | 1700554ca7ad9ecffa40bf8db5bfed023d99324f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1700554ca7ad9ecffa40bf8db5bfed023d99324f/memory.py |
schema = namespace.get_element_schema() | schema = namespace.get_element_schema(self.name) | def get_start_tag(self): s = '<%s' % self.qname # Output the attributes for namespace_uri, local_name, value in self.get_attributes(): qname = self.get_attribute_qname(namespace_uri, local_name) type = self.get_attribute_type(namespace_uri, local_name) value = type.to_unicode(value) s += ' %s="%s"' % (qname, value) # C... | 413e07e29e5cebe5a2c851644bd04566f6bb877b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/413e07e29e5cebe5a2c851644bd04566f6bb877b/XML.py |
schema = namespace.get_element_schema() | schema = namespace.get_element_schema(self.name) | def get_end_tag(self): namespace = namespaces.get_namespace(self.namespace) schema = namespace.get_element_schema() is_empty = schema.get('is_empty', False) if is_empty: return u'' return u'</%s>' % self.qname | 413e07e29e5cebe5a2c851644bd04566f6bb877b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/413e07e29e5cebe5a2c851644bd04566f6bb877b/XML.py |
return self.data.replace('<', '<') | return self.data.replace('<', '<').replace('&', '&') | def __unicode__(self): return self.data.replace('<', '<') | 026ec5924cf374485142d714a94ac0eb0f652a71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/026ec5924cf374485142d714a94ac0eb0f652a71/XML.py |
* itools.lucene -- An underway implementation of the famous Jakarta's indexing and search tool. | * itools.catalog -- An Index & Search engine. | def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError, \ "'package' must be a string (dot-separated), list, or tuple" | 36909b7f05efaccb2a4a60a8016c03bf4b5db617 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/36909b7f05efaccb2a4a60a8016c03bf4b5db617/setup.py |
version = "0.4.1", | version = "0.4.2", | def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError, \ "'package' must be a string (dot-separated), list, or tuple" | 36909b7f05efaccb2a4a60a8016c03bf4b5db617 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/36909b7f05efaccb2a4a60a8016c03bf4b5db617/setup.py |
def _load_state(self, resource): self.translations = GNUTranslations(resource) | def _load_state_from_file(self, file): self.translations = GNUTranslations(file) | def _load_state(self, resource): self.translations = GNUTranslations(resource) | 228e38325c4150e78acbe596e63b33d15fc78fbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/228e38325c4150e78acbe596e63b33d15fc78fbc/MO.py |
if name.startswith('.'): | if name.startswith('.') or name.endswith('.metadata'): | def before_set_handler(self, segment, handler, format=None, id=None, move=False, **kw): name = segment.name if name.startswith('.'): return | d1f3292d229011206cac33e2c67650a8dbec1e3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d1f3292d229011206cac33e2c67650a8dbec1e3d/Folder.py |
if name.startswith('.'): | if name.startswith('.') or name.endswith('.metadata'): | def after_set_handler(self, segment, handler, format=None, id=None, move=False, **kw): from root import Root | d1f3292d229011206cac33e2c67650a8dbec1e3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d1f3292d229011206cac33e2c67650a8dbec1e3d/Folder.py |
if not self.states.has_key(name): | if name not in self.states: | def set_initstate(self, name): """ Sets the default initial state. """ if not self.states.has_key(name): raise WorkflowError, "invalid initial state: '%s'" % name self.initstate = name | ac68ef9892ee41ac0e52a4ac6e286ac4049f86df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ac68ef9892ee41ac0e52a4ac6e286ac4049f86df/workflow.py |
class State: | class State(object): | def add_trans(self, name, state_from, state_to, **kw): """ Adds a new transition, 'state_from' and 'state_to' are respectively the origin and destination states of the transition. | ac68ef9892ee41ac0e52a4ac6e286ac4049f86df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ac68ef9892ee41ac0e52a4ac6e286ac4049f86df/workflow.py |
class Transition: | class Transition(object): | def __getitem__(self, key): """ Access to the metadata as a mapping. """ return self.metadata.get(key) | ac68ef9892ee41ac0e52a4ac6e286ac4049f86df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ac68ef9892ee41ac0e52a4ac6e286ac4049f86df/workflow.py |
def __init__(self, workflow, initstate=None, *args, **kw): """ Initialize the workflow aware object. initstate is the workflow state that should be taken on initially (if omitted or None, the workflow must provide a default initial state). Extra arguments are passed to the enter-state handler (if any) of the initial s... | def __getitem__(self, key): """ Access to the metadata as a mapping. """ return self.metadata.get(key) | ac68ef9892ee41ac0e52a4ac6e286ac4049f86df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ac68ef9892ee41ac0e52a4ac6e286ac4049f86df/workflow.py | |
return root.unrestrictedTraverse(self._path) | return root.unrestrictedTraverse(self._path).aq_base | def _get_object(self): root = get_context().request.zope_request['PARENTS'][-1] return root.unrestrictedTraverse(self._path) | 2c39eb0e804cbd23c02a34ad40f4e772a5cf6934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/2c39eb0e804cbd23c02a34ad40f4e772a5cf6934/zope2.py |
mtime = object.bobobase_modification_time() mtime = mtime.timeTime() return datetime.fromtimestamp(mtime) | mtime = getattr(object, 'mtime', None) if mtime is None or mtime < self.bobo_time: return self.bobo_time return mtime | def get_mtime(self): object = self._get_object() mtime = object.bobobase_modification_time() mtime = mtime.timeTime() return datetime.fromtimestamp(mtime) | 2c39eb0e804cbd23c02a34ad40f4e772a5cf6934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/2c39eb0e804cbd23c02a34ad40f4e772a5cf6934/zope2.py |
data = str(object.data) | def __setitem__(self, index, value): object = self._get_object() | 2c39eb0e804cbd23c02a34ad40f4e772a5cf6934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/2c39eb0e804cbd23c02a34ad40f4e772a5cf6934/zope2.py | |
if context.uri.path.endswith_slash: | if request.method == 'GET' and context.uri.path.endswith_slash: | def handle_request(self, connection): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] except: self.log_error() request = None request_line = 'XXX' else: # Keep here (though redundant) to be used later i... | 1938a8c6caa942271a7aee68675e2533c80dd83f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1938a8c6caa942271a7aee68675e2533c80dd83f/server.py |
raise ValueError, "resource '%s' not found" % str(path[:i+1]) | raise LookupError, "resource '%s' not found" % str(path[:i+1]) | def get_resource(self, path): """ Returns the required resource, or None if it does not exists. """ # Normalize the path if not isinstance(path, uri.Path): path = uri.Path(path) | 24bd2691e0e255ff37d1127ff35129f620926c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/24bd2691e0e255ff37d1127ff35129f620926c0c/base.py |
server = Server(root, port=options.port, access_log='%s/access_log' % target, | if options.port: port = options.port elif config.has_option('instance', 'port'): port = config.getint('instance', 'port') else: port = None server = Server(root, port=port, access_log='%s/access_log' % target, | def start(parser, options, target): if options.source is not None: parser.error('option --import not allowed in this context') if options.root is not None: parser.error('option --root not allowed in this context') # Load the config config = RawConfigParser() config.add_section('instance') config.read(['%s/config.ini'... | 73a2c71a4a4baa0198e82711cef7b00258726745 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/73a2c71a4a4baa0198e82711cef7b00258726745/icms.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.