m๒ ‘ใธEc@sdZdkZdklZdkZdklZdk l Z e dƒZ dk l Z dklZdklZd klZlZd klZd klZd klZd klZdddd„Zdefd„ƒYZdefd„ƒYZ dd„Z!defd„ƒYZ"dS(sPEdit form directives $Id: metaconfigure.py 71269 2006-11-22 13:37:06Z yuppie $ N(sInitializeClass(s Interface(sMessageFactorytzope(smenuItemDirective(sBaseFormDirective(sIAdding(sEditViewsAddView(s makeClass(s protectClass(sZopeTwoPageTemplateFile(smakeClassForTemplateuc Csีt|tƒd|d|ƒ} || _|| _| | _| | _ | o| djo d} n| | _ t |ƒ| _|djo t}ntiiƒ}|i| ||ft|ƒt| |ƒt| ƒdS(Ntused_fortbasess Full edit(tmakeClassForTemplatettemplatetglobalstschemaRtclass_tlabeltfieldst fieldNamest fulledit_pathtfulledit_labeltNonetZopeTwoPageTemplateFiletdefault_templatetgenerated_formtlayertIDefaultBrowserLayerRt componenttgetGlobalSiteManagertstregisterAdaptertfor_t Interfacetnamet protectClasst permissiontinitializeClass(RRRRRRRRRR R R tmenuRR((t?/data/zmath/zope/lib/python/Products/Five/form/metaconfigure.pytEditViewFactory$s           tFiveFormDirectivecBstZd„ZRS(NcCs@|io2tdtif|iƒ}|i|f|_ndS(NtCustomWidgetsMixin(tselft_widgetst makeClasstExtensionClasstBasetcustomWidgetsObjectR(R"R'((Rt_processWidgetsCs (t__name__t __module__R((((RR AstEditFormDirectivecBs2tZeZdZedƒZd„Zd„ZRS(Nsedit.pttEditc CsW|ioIt|i|i|ip|id|i|id|id|i ƒndS(Ns@@RR( R"RtmenuItemDirectivet_contextRRRttitleRR(R"((Rt _handle_menuOs c CsU|iƒ|iƒ|iid|iƒdtd|iƒdhd|i<ƒdS(Nt discriminatortcallabletargstkwR( R"R(R0R.tactiont_discriminatorRt_argsR(R"((Rt__call__Vs    ( R)R*tEditViewtviewRt_R/R0R8(((RR+Is   cCsาt|tƒd|d|ƒ}||_||_| |_| |_ | |_ | |_| |_||_t|ƒ|_|djo t}ntiiƒ}|i|||ft|ƒt!||ƒt#|ƒdS(NRR($RRRRRRRR R tcontent_factoryt_factoryt argumentst _argumentstkeyword_argumentst_keyword_argumentstset_before_addt_set_before_addt set_after_addt_set_after_addRRRRR RRRRRRRRRRRR(RRRRRRRRRR R<R>R@RBRDRRR((RtAddViewFactoryas"            tAddFormDirectivecBs\tZeZdZeZdZdZ dZ dZ dZ dZ d„Zdd„Zd„ZRS(Nsadd.ptc Cs†|ip |ion|i p |i otdƒ‚nt|i|i|id|i|id|id|i d|i ƒndS(NsBIf either menu or title are specified, they must both be specifieds@@RRt description( R"RR/t ValueErrorR-R.RRRRRH(R"((RR0Žs c Csฺ|i} |i}|i} |i}|i}|i}|djo |}n| oฯg}| D]}||jo ||q_q_~}|ot d|ƒ‚ng}| D]}| |i p ||qซqซ~} | ot d| ƒ‚ng}|D]}|| jo ||q๘q๘~}n|o‚g}|D]}||jo ||q5q5~}|ot d|ƒ‚ng}|D]}||jo ||qq~}n|o‚g}|D]}||jo ||qพqพ~}|ot d|ƒ‚ng}|D]}||jo ||q q ~}n|o‘g}|D]}||jo ||qGqG~}|ot d|ƒ‚ng}|D]}||jo ||q“q“~}|i|7_n ||_dS(Ns+Some arguments are not included in the forms;Some arguments are optional, use keyword_arguments for thems3Some keyword_arguments are not included in the forms0Some set_before_add are not included in the forms/Some set_after_add are not included in the form(R"RR R>R@RBRDtleftoverR t_[1]tntmissingRItrequiredtoptional( R"RJRDRMR RLRKR@RBR>ROR((Rt_handle_argumentsšsL        2 3 62 62 62 2c Cs|iƒ|iƒ|iƒ|iid|iƒdtd|iƒ|i |i |i |i |i fdhd|i<ƒdS(NR1R2R3R4R(R"R(R0RPR.R5R6RFR7R<R>R@RBRDR(R"((RR8ฮs   .(R)R*tAddViewR:RtIAddingRR RHR<R>R@RBRDR0RPR8(((RRG€s 4(#t__doc__R%tGlobalstInitializeClassRtzope.componentRtzope.interfaceRtzope.i18nmessageidtMessageFactoryR;t#zope.app.publisher.browser.menumetaR-t#zope.app.form.browser.metaconfiguretBaseFormDirectivetzope.app.container.interfacesRRtProducts.Five.formR9RQtProducts.Five.metaclassR$tProducts.Five.securityRt&Products.Five.browser.pagetemplatefileRt#Products.Five.browser.metaconfigureRR RR R+RFRG(RR%R RFRRRRGR$R+RR-RRRRQR9RR\R;RY((Rt?s&