bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
self.re_typedef = re.compile(r'^\s+typedef\s+.*?;$') | self.re_typedef = re.compile(r'^\s+typedef\s+.*?;$') | 26,800 |
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return | defprocess(self,line):ifself.reading_copyright:ifnotself.re_copyright_end.match(line):self.copyright+=linereturn | 26,801 |
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return | def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return | 26,802 |
def main( all_modes, src_dir, dst_dir ): if len( sys.argv ) < 2: print "\nUsage:\n\t %s <mode> <boost_root> [<source_file>]" % os.path.basename( sys.argv[0] ) print "\nPurpose:\n\t updates preprocessed version(s) of the header(s) in \"%s\" directory" % dst_dir print "\nExample:\n\t the following command will re-generat... | def main( all_modes, src_dir, dst_dir ): if len( sys.argv ) < 2: print "\nUsage:\n\t %s <mode> <boost_root> [<source_file>]" % os.path.basename( sys.argv[0] ) print "\nPurpose:\n\t updates preprocessed version(s) of the header(s) in \"%s\" directory" % dst_dir print "\nExample:\n\t the following command will re-generat... | 26,803 |
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modif... | def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modif... | 26,804 |
def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_... | def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_... | 26,805 |
def message( *args ): """ Write a message to stderr (but only on the master node if we are using pypar) """ global mpi if not mpi or node_id == 0: sys.stderr.write( ' '.join( map( str, args ) ) ) sys.stderr.write( '\n' ) sys.stderr.flush() | def message( *args ): """ Write a message to stderr (but only on the master node if we are using pypar) """ global mpi, node_id if not mpi or node_id == 0: sys.stderr.write( ' '.join( map( str, args ) ) ) sys.stderr.write( '\n' ) sys.stderr.flush() | 26,806 |
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modif... | def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are pypar = __import__( 'pypar' ) nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id... | 26,807 |
def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_... | def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_... | 26,808 |
def update(self): """ """ msg = u'' if "INSTALL-SUBMIT" in self.request: self.install() msg = _(u'Tools successufully installed.') if "UNINSTALL-SUBMIT" in self.request: self.uninstall() msg = _(u'Tools successufully uninstalled.') if "ADD-TOOL-SUBMIT" in self.request: self.action(self.request['type_name'], self.reques... | def update(self): """ """ msg = u'' if "INSTALL-SUBMIT" in self.request: self.install() msg = _(u'Tools successufully installed.') if "UNINSTALL-SUBMIT" in self.request: self.uninstall() msg = _(u'Tools successufully uninstalled.') if "ADD-TOOL-SUBMIT" in self.request: self.action(self.request['type_name'], self.reques... | 26,809 |
... def resolve(self, path): | ... def resolve(self, path): | 26,810 |
... def resolve(self, path): | ... def resolve(self, path): | 26,811 |
def fromUnicode(self, u): name = str(u.strip()) | def fromUnicode(self, u): name = str(u.strip()) | 26,812 |
def fromUnicode(self, u): name = str(u.strip()) | def fromUnicode(self, u): name = str(u.strip()) | 26,813 |
def fromUnicode(self, u): name = str(u.strip()) | def fromUnicode(self, u): name = str(u.strip()) | 26,814 |
def __init__(self, interface, title, description=None, unique=False, folder='tools'): self.interface = interface self.title = title self.description = description self.unique = unique self.folder = folder | def __init__(self, interface, title, description=None, unique=False, folder='tools'): self.interface = interface self.title = title self.description = description self.unique = unique self.folder = folder | 26,815 |
def getToolInstances(self, tool): """Find every registered utility for a given tool configuration.""" regManager = self.context[tool.folder].registrationManager return [ {'name': reg.name, 'url': zapi.absoluteURL(reg.component, self.request), 'rename': tool is self.activeTool and reg.name in self.renameList, 'active': ... | def getToolInstances(self, tool): """Find every registered utility for a given tool configuration.""" regManager = self.getSiteManagementFolder(tool).registrationManager return [ {'name': reg.name, 'url': zapi.absoluteURL(reg.component, self.request), 'rename': tool is self.activeTool and reg.name in self.renameList, '... | 26,816 |
def defaultView(_context, type, name, for_): _context.action( discriminator = ('defaultViewName', for_, type, name), callable = handler, args = (zapi.servicenames.Adapters, 'register', (for_, type), IDefaultViewName, '', name, _context.info) ) _context.action( discriminator = None, callable = provideInterface, args =... | def defaultView(_context, type, name, for_): _context.action( discriminator = ('defaultViewName', for_, type, name), callable = handler, args = (zapi.servicenames.Adapters, 'register', (for_, type), IDefaultViewName, '', name, _context.info) ) _context.action( discriminator = None, callable = provideInterface, args =... | 26,817 |
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager()) | def setSite(site=None): if site is None: services = serviceManager else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager()) | 26,818 |
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager()) | def setSite(site=None): if site is None: siteinfo.services = None else: site = trustedRemoveSecurityProxy(site) services = site.getSiteManager() | 26,819 |
def getSite(): try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__ | def getSite(): return siteinfo.site | 26,820 |
def getSite(): try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__ | defgetSite():try:services=siteinfo.servicesexceptAttributeError:services=siteinfo.services=NoneifservicesisNone:returnNonereturnservices.__parent__ | 26,821 |
def getServices_hook(context=None): if context is None: try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service ma... | def getServices_hook(context=None): if context is None: return siteinfo.services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return servi... | 26,822 |
def getServices_hook(context=None): if context is None: try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service ma... | defgetServices_hook(context=None):ifcontextisNone:try:services=siteinfo.servicesexceptAttributeError:services=siteinfo.services=NoneifservicesisNone:returnserviceManagerreturnservices#Deprecatedsupportforacontextthatisn'tadaptableto#IServiceService.Returnthedefaultservicemanager.try:returntrustedRemoveSecurityProxy(ISe... | 26,823 |
def __get__(self, inst, klass): registration = inst if registration is None: return self | def __get__(self, inst, klass): registration = inst if registration is None: return self | 26,824 |
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | 26,825 |
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | 26,826 |
def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)] | def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (IComponentRegistration.providedBy(reg) and reg.component is self.registerable)] | 26,827 |
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | 26,828 |
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | 26,829 |
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | 26,830 |
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | 26,831 |
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor... | 26,832 |
def searchInterfaceIds(context, search_string=None, base=None): """Interfaces search >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface... | def searchInterfaceIds(context, search_string=None, base=None): """Interfaces search >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface... | 26,833 |
def getNextSiteManager(context): """Get the next site manager.""" sm = queryNextSiteManager(context, _marker) if sm is _marker: raise zope.component.interfaces.ComponentLookupError( "No more site managers have been found.") return sm | def getNextSiteManager(context): """Get the next site manager.""" sm = queryNextSiteManager(context, _marker) if sm is _marker: raise zope.component.interfaces.ComponentLookupError( "No more site managers have been found.") return sm | 26,834 |
def __get__(self, inst, cls=None): if inst is None: return self | def __get__(self, inst, cls=None): if inst is None: return self | 26,835 |
def __get__(self, inst, cls=None): if inst is None: return self | def __get__(self, inst, cls=None): if inst is None: return self | 26,836 |
def __get__(self, inst, cls=None): if inst is None: return self | def __get__(self, inst, cls=None): if inst is None: return self | 26,837 |
... def resolve(self, path): | ... def resolve(self, path): | 26,838 |
... def resolve(self, path): | ... def resolve(self, path): | 26,839 |
def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( """ <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """ ))) | def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( ''' <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> ''' ))) | 26,840 |
def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( """ <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """ ))) | def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( """ <service serviceType="Foo" component="zope.app.component.tests.service.fooService" /> ''' ))) | 26,841 |
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( ''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" co... | 26,842 |
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component="zope.app.component.tests.service.fooService" /> <service serviceType="Foo" co... | 26,843 |
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | 26,844 |
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( ''' <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" c... | 26,845 |
def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,846 |
def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,847 |
def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,848 |
def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,849 |
def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,850 |
def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,851 |
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,852 |
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,853 |
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | 26,854 |
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo") | deftestProtectedServiceConfig(self):self.assertRaises(ComponentLookupError,getService,"Foo") | 26,855 |
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.') | 26,856 |
def __setstate__(self, dict): super(BBBComponentRegistration, self).__setstate__(dict) # For some reason the component path is not set correctly by the # default __setstate__ mechanism. if 'componentPath' in dict: self._component = NULL_COMPONENT self._BBB_componentPath = dict['componentPath'] | def __setstate__(self, dict): super(BBBComponentRegistration, self).__setstate__(dict) # For some reason the component path is not set correctly by the # default __setstate__ mechanism. if 'componentPath' in dict: self._component = NULL_COMPONENT self._BBB_componentPath = dict['componentPath'] | 26,857 |
def _setComponent(self, component): # We always want to set the plain component. Untrusted code will # get back a proxied component anyways. self._component = removeSecurityProxy(component) | def _setComponent(self, component): # We always want to set the plain component. Untrusted code will # get back a proxied component anyways. self._component = removeSecurityProxy(component) | 26,858 |
def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)] | def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)] | 26,859 |
def __createRegistrationManager(self): "Create a registration manager and store it as `registrationManager`" # See interfaces.IRegisterableContainer self.registrationManager = RegistrationManager() self.registrationManager.__parent__ = self self.registrationManager.__name__ = '++registrations++' zope.event.notify( obje... | def __createRegistrationManager(self): "Create a registration manager and store it as `registrationManager`" # See interfaces.IRegisterableContainer self.registrationManager = RegistrationManager() self.registrationManager.__parent__ = self self.registrationManager.__name__ = '++registrations++' zope.event.notify( obje... | 26,860 |
def factory(ob, request): for f in factories[:-1]: ob = f(ob) return factories[-1](ob, request) | def factory(ob, request): for f in factories[:-1]: ob = f(ob) return factories[-1](ob, request) | 26,861 |
def fromUnicode(self, u): name = str(u.strip()) | def fromUnicode(self, u): name = str(u.strip()) | 26,862 |
def fromUnicode(self, u): name = str(u.strip()) | def fromUnicode(self, u): name = str(u.strip()) | 26,863 |
def getServices_hook(context=None): if context is None: return siteinfo.services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return servi... | def getServices_hook(context=None): if context is None: return siteinfo.services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return servi... | 26,864 |
def adapter_hook(interface, object, name='', default=None): try: return siteinfo.adapter_hook(interface, object, name, default) except ComponentLookupError: return default | def adapter_hook(interface, object, name='', default=None): try: return siteinfo.adapter_hook(interface, object, name, default) except ComponentLookupError: return default | 26,865 |
def queryView(object, name, request, default=None, providing=Interface, context=None): views = getService(Presentation, context) view = views.queryView(object, name, request, default=default, providing=providing) if ILocation.providedBy(view): locate(view, object, name) return view | def queryView(object, name, request, default=None, providing=Interface, context=None): views = getService(Presentation, context) view = views.queryView(object, name, request, default=default, providing=providing) if ILocation.providedBy(view): locate(view, object, name) return view | 26,866 |
def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker) | def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker) | 26,867 |
def makeTestObject(self): from zope.app.services.service \ import ServiceManagerContainer return ServiceManagerContainer() | def makeTestObject(self): from zope.app.services.servicecontainer \ import ServiceManagerContainer return ServiceManagerContainer() | 26,868 |
def utility(_context, provides, component=None, factory=None, permission=None, name=''): provides = _context.resolve(provides) if factory: if component: raise TypeError("Can't specify factory and component.") component = _context.resolve(factory)() else: component = _context.resolve(component) if permission is not N... | def utility(_context, provides, component=None, factory=None, permission=None, name=''): provides = _context.resolve(provides) if factory: if component: raise TypeError("Can't specify factory and component.") component = _context.resolve(factory)() else: component = _context.resolve(component) if permission is not N... | 26,869 |
def setHooks(): zope.component.adapter_hook.sethook(adapter_hook) zope.component.getSiteManager.sethook(getSiteManager) # Goes away in 3.3. zope.deprecation.__show__.off() from bbb import hooks zope.component.getServices.sethook(hooks.getServices_hook) zope.deprecation.__show__.on() | def setHooks(): zope.component.adapter_hook.sethook(adapter_hook) zope.component.getSiteManager.sethook(getSiteManager) # Goes away in 3.3. zope.deprecation.__show__.off() from bbb import hooks zope.component.getServices.sethook(hooks.getServices_hook) zope.deprecation.__show__.on() | 26,870 |
def searchInterface(self, search_string=None, base=None): return [t[1] for t in self.items(search_string, base)] | def searchInterface(self, search_string=None, base=None): return [t[1] for t in self.items(search_string, base)] | 26,871 |
def items(self, search_string=None, base=None): if search_string: search_string = search_string.lower() for id, (interface, doc) in self.__data.items(): if search_string: if doc.find(search_string) < 0: continue if base is not None and not interface.extends(base, 0): continue yield id, interface | def items(self, search_string=None, base=None): if search_string: search_string = search_string.lower() for id, (interface, doc) in self.__data.items(): if search_string: if doc.find(search_string) < 0: continue if base is not None and not interface.extends(base, 0): continue yield id, interface | 26,872 |
def reduce_factories(factories, for_): if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) > 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) retur... | def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) factories = factory if len(factories) ==... | 26,873 |
def reduce_factories(factories, for_): if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) > 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) retur... | def reduce_factories(factories, for_): if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) != 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) retu... | 26,874 |
def factory(ob): for f in factories: ob = f(ob) return ob | def factory(ob): for f in factories: ob = f(ob) return ob | 26,875 |
def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) _context.action( discriminator = ('adapte... | def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) _context.action( discriminator = ('adapte... | 26,876 |
def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker) | def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker) | 26,877 |
def require(self, _context, permission=None, attributes=None, interface=None, like_class=None, set_attributes=None, set_schema=None): """Require a the permission to access a specific aspect""" if like_class: self.__mimic(_context, like_class) | def require(self, _context, permission=None, attributes=None, interface=None, like_class=None, set_attributes=None, set_schema=None): """Require a permission to access a specific aspect""" if like_class: self.__mimic(_context, like_class) | 26,878 |
def __init__(self, *args, **kw): warnings.warn( "Use of `ComponentPathWidget` deprecated, since the " "registration code now uses the component directly instead " "of using the component's path.", DeprecationWarning, stacklevel=2, ) super(ComponentPathWidget, self).__init__(*args, **kw) | def __init__(self, *args, **kw): warnings.warn( "Use of `ComponentPathWidget` deprecated, since the " "registration code now uses the component directly instead " "of using the component's path.", DeprecationWarning, stacklevel=2, ) super(ComponentPathWidget, self).__init__(*args, **kw) | 26,879 |
def remove_objects(self, key_list): """Remove the directives from the container.""" container = self.context for name in key_list: del container[name] | def remove_objects(self, key_list): """Unregister and remove the directives from the container.""" container = self.context for name in key_list: del container[name] | 26,880 |
def ignorewarning(message, category, filename, lineno, file=None): pass | def ignorewarning(message, category, filename, lineno, file=None): pass | 26,881 |
def ignorewarning(message, category, filename, lineno, file=None): pass | def ignorewarning(message, category, filename, lineno, file=None): pass | 26,882 |
def subscriber(_context, for_=None, factory=None, handler=None, provides=None, permission=None, trusted=False): if factory is None: if handler is None: raise TypeError("No factory or handler provides") if provides is not None: raise TypeError("Cannot use handler with provides") factory = handler else: if handler is n... | def subscriber(_context, for_=None, factory=None, handler=None, provides=None, permission=None, trusted=False): if factory is None: if handler is None: raise TypeError("No factory or handler provided") if provides is not None: raise TypeError("Cannot use handler with provides") factory = handler else: if handler is n... | 26,883 |
def __repr__(self): return '<UtiltiyTerm %s, instance of %s>' %( self.token, self.value.__class__.__name__) | def __repr__(self): return '<UtilityTerm %s, instance of %s>' %( self.token, self.value.__class__.__name__) | 26,884 |
... def __repr__(self): | ... def __repr__(self): | 26,885 |
... def __repr__(self): | ... def __repr__(self): | 26,886 |
... def __repr__(self): | ... def __repr__(self): | 26,887 |
... def __repr__(self): | ... def __repr__(self): | 26,888 |
def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']]) else: _url = '/' + '/'.join([ request.environ['pylons.routes_dict']['contr... | def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = h.url_for( controller=request.environ['pylons.routes_dict']['controller'], action=None, id=None ) else: _url = '/' + '/'.join([ request.environ['... | 26,889 |
def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']]) else: _url = '/' + '/'.join([ request.environ['pylons.routes_dict']['contr... | def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']]) else: _url = h.url_for( controller=request.environ['pylons.routes_dict']['... | 26,890 |
def get_perl_cgi(params_dict): params_dict = variable_decode(params_dict) cgi = g.perl.eval('$cgi = new CGI;') cgi.charset("UTF-8") for key, val in params_dict.iteritems(): if key in updatable_attributes: if isinstance(val, list): cgi.param(key, join(str(val))) else: cgi.param(key, str(val)) return cgi | def get_perl_cgi(params_dict): params_dict = variable_decode(params_dict) cgi = g.perl.eval('$cgi = new CGI;') cgi.charset("UTF-8") for key, val in params_dict.iteritems(): if key in updatable_attributes: if isinstance(val, list): cgi.param(key, '\n'.join(val)) else: cgi.param(key, str(val)) return cgi | 26,891 |
def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf'] | def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf'] | 26,892 |
def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf'] | def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf'] | 26,893 |
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | 26,894 |
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | 26,895 |
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True | 26,896 |
def run(self): cur_dir = os.getcwd() if not self.run_tests(): print "Perl not compiled with threads support" print "Removing 'MULTI_PERL'" os.unlink(os.path.join(cur_dir, 'MULTI_PERL')) | def run(self): cur_dir = os.getcwd() if not self.run_tests(): print "Perl not compiled with 'usethreads' support." print "Removing 'MULTI_PERL'" os.unlink(os.path.join(cur_dir, 'MULTI_PERL')) | 26,897 |
def checkRecoverUndoInVersion(self): oid = self._storage.new_oid() version = "aVersion" revid_a = self._dostore(oid, data=MinPO(91)) revid_b = self._dostore(oid, revid=revid_a, version=version, data=MinPO(92)) revid_c = self._dostore(oid, revid=revid_b, version=version, data=MinPO(93)) self._undo(self._storage.undoInfo... | def checkRecoverUndoInVersion(self): oid = self._storage.new_oid() version = "aVersion" revid_a = self._dostore(oid, data=MinPO(91)) revid_b = self._dostore(oid, revid=revid_a, version=version, data=MinPO(92)) revid_c = self._dostore(oid, revid=revid_b, version=version, data=MinPO(93)) self._undo(self._storage.undoInfo... | 26,898 |
def commit(self, subtransaction=None): 'Finalize the transaction' | def commit(self, subtransaction=None): 'Finalize the transaction' | 26,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.