; @Bc@scdklZdkZdklZdklZdklZdk l Z dk l Z dk l Z dklZd klZgZhd hd d <d d<dd<<dhd d<d d<dd<<dhd d<d d<dd<Unhandled mode for method creation: %s:%s -> %s:%s(sfieldsgetNamesnamesNonesmethodsmodesgeneratedAccessorsgeneratedEditAccessorsgeneratedMutatorsGeneratorErrorsklasss__name__s methodNamesfunctions func_codes func_globalss func_defaultss func_closuressetattr( sselfsklasssfieldsmodes methodNamesgeneratedAccessorsnamesgeneratedMutatorsgeneratedEditAccessorsmethod((snamesB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys makeMethod/s$            (s__name__s __module__scomputeMethodNames makeMethod(((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys Generator%s sClassGeneratorcBs>tZdZdZdZdZdZdZRS(NcCsnt|}t|d}t||t}|i i |||jot d|n|i ||dS(NssecuritysThe method '%s' was already protected by a different permission than the one declared on the field. Assuming that the explicit permission declared is the correct one and has preference over the permission declared on the field.(s _getSecuritysklassssecuritys_modessmodespermsgetattrsfieldsNonesnamessgets methodNameswarnsdeclareProtected(sselfsklasssfieldsmodes methodNamespermssecurity((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pysupdateSecurityes  cCstidd|iSdS(Ns([a-z])([A-Z])s \g<1> \g<2>(sressubsklasss__name__(sselfsklass((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys generateNamevscCsy|iido|iid o'td|idd|i|_nt|d od}||_ndS(Nstypesschemas-Class %s has type attribute, should be schemaslevelisSchemacCs|i}t||SdS(s]Return a (wrapped) schema instance for this object instance. N(sselfsschemasImplicitAcquisitionWrapper(sselfsschema((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pysSchemas ( sklasss__dict__shas_keys deprecateds__name__stypesschemashasattrsSchema(sselfsklasssSchema((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys checkSchemays'   cCst|dt pd|iijo|i|_nt|dt pd|iijo|i|_nt|d|i ||_ |i ||i i }|i||dS(Ns meta_types portal_typesarchetype_name(sgetattrsklasssNones__dict__skeyss__name__s meta_types portal_typesselfs generateNamesarchetype_names checkSchemasschemasfieldssgenerateMethods(sselfsklasssfields((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys generateClasss**  cCst}x|D]}d|ij p tdd|ijoqnt|d}xT|iD]I}|i ||||||djo|i ||||dqaqaWqWt |dS(Nsmsm is an implicit modescstypesw( s Generators generatorsfieldssfieldsmodesAssertionErrors generateModesgetattrsklassstypesselfs handle_modesInitializeClass(sselfsklasssfieldss generatorsfieldstypesmode((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pysgenerateMethodss   %cCst|d}t||t}| o|i||}nt || pt||t joG|i |otd||ifn|i||||n|i||||t|d}t|||dS(NsattrshThere is a conflictbetween the Field(%s) and the attemptto generate a method of the same name onclass %s(s_modessmodesattrsgetattrsfieldsNones methodNames generatorscomputeMethodNameshasattrsklasssAT_GENERATE_METHODstypeshas_keysGeneratorErrors__name__s makeMethodsselfsupdateSecurityssetattr(sselfsklasss generatorstypesfieldsmodes methodNamesattr((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys handle_modes' (s__name__s __module__supdateSecuritys generateNames checkSchemas generateClasssgenerateMethodss handle_mode(((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pysClassGeneratords      cBs3dhd|<}||iUe|d|SdS(Ns def add%(name)s(self, id, **kwargs): obj = %(name)s(id) self._setObject(id, obj) obj = self._getOb(id) obj.initializeArchetype(**kwargs) return id snamesadd%s(snamesctorsmodules__dict__sgetattr(snamesmodulesctor((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys generateCtors cBs3dhd|<}||iUe|d|SdS(Ns def manage_add%(name)s(self, id, REQUEST=None): ''' Constructor for %(name)s ''' kwargs = {} if REQUEST is not None: kwargs = REQUEST.form.copy() del kwargs['id'] id = add%(name)s(self, id, **kwargs) obj = self._getOb(id) manage_tabs_message = 'Successfully added %(name)s' if REQUEST is not None: url = obj.absolute_url() REQUEST.RESPONSE.redirect(url + '/manage_edit%(name)sForm?manage_tabs_message=' + manage_tabs_message) return id snames manage_add%s(snameszmi_ctorsmodules__dict__sgetattr(snamesmoduleszmi_ctor((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pysgenerateZMICtors (s __future__s nested_scopessrestypess FunctionTypesfunctionsProducts.Archetypes.utilss capitalizes _getSecuritysProducts.Archetypes.debugswarns deprecateds AcquisitionsImplicitAcquisitionWrappers AccessControlsClassSecurityInfosGlobalssInitializeClasssAT_GENERATE_METHODs_modess ExceptionsGeneratorErrors GeneratorsClassGenerators generateCtorsgenerateZMICtors_cgs generateClasssgenerateMethods(sfunctionsgenerateZMICtors Generators nested_scopess generateClasss deprecatedsClassSecurityInfosImplicitAcquisitionWrappersgenerateMethodss _getSecurityswarnsres generateCtorsClassGeneratorsInitializeClasss_modess capitalizesGeneratorErrors_cgsAT_GENERATE_METHOD((sB/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/ClassGen.pys?s&          r?i