;ò “ãBc@sDdkZdkZdkZdkTdklZlZlZdklZdk l Z l Z dk l Z l Z dklZdklZdkZhadfd „ƒYZd „Zd „Zd „Zd „Zd„Zeed„Zd„Zd„Zd„Zd„Zd„Z ea!d„Z"ed„Z#d„Z$d„Z%dS(N(s*(s listitem2strs str2dictlists dictlist2str(sParsePos(sProcesss recipe_error(s filetype_rootsft_known(sexpand(sget_build_recdictsActioncBsVtZdZgggdd„Zded„Zded„Zdd„Zd„ZRS(s§ Class to store the commands and rpstack for an action/filetype. In a derived class get_in_types() and get_out_types() may be implemented differently. sc Csa||_||_||_||_||_||_|iddƒ|_ ||_ ||_ dS(Nsprimaryi( srpstacksselfsrecdicts buildrecdicts attributesscommandssouttypessintypessgetsprimarysdefer_var_namess outfilename( sselfsrpstacksrecdicts attributesscommandssouttypessintypessdefer_var_namess outfilename((s+/mnt/gmirror/ports/devel/aap/work/Action.pys__init__4s       cCsZ|id|ƒ}|ot|dd|ƒSn|o ||ijogSn|iSdS(s~ Return list of supported output filetypes. When "intype" is given, this is the required output type. ssourceisintypeN(sselfsdefer_action_namessourcesanames get_ftypessintypesintypessouttypes(sselfssourcesintypesaname((s+/mnt/gmirror/ports/devel/aap/work/Action.pys get_out_typesBscCsZ|id|ƒ}|ot|dd|ƒSn|o ||ijogSn|iSdS(s~ Return list of supported input filetypes. When "outtype" is given, this is the required output type. ssourceisouttypeN(sselfsdefer_action_namessourcesanames get_ftypessouttypesouttypessintypes(sselfssourcesouttypesaname((s+/mnt/gmirror/ports/devel/aap/work/Action.pys get_in_typesNscCs•xŠ|iD]}t|ƒdjo|ddjo|ddjoti||dd!ƒ}ntdt i d|ƒ}|o|Sq q Wt SdS( s+Return name of action to defer the work to.iis{iÿÿÿÿs}is_noN( sselfsdefer_var_namessnslens RecPythons get_var_attrssourcesanames get_var_valsGlobalsglobalssNone(sselfssourcesnsaname((s+/mnt/gmirror/ports/devel/aap/work/Action.pysdefer_action_nameZs 5 cCs |iSdS(N(sselfscommands(sself((s+/mnt/gmirror/ports/devel/aap/work/Action.pys__str__es( s__name__s __module__s__doc__s__init__sNones get_out_typess get_in_typessdefer_action_names__str__(((s+/mnt/gmirror/ports/devel/aap/work/Action.pysAction.s   c CsOt|ƒdjo'dg}ti|dddƒ}n_t|ƒdjo8ti|dddƒ}ti|dddƒ}nt|tdƒƒx_||D]S}|djo t |ƒ o2t |tdƒ||d i |d ifƒq£q£Wt|||d |||ƒ}x/ti|d ddƒD]}t||ƒq4Wd S( s§ Add "commands" for an action-filetype combination defined by dictlist "arglist". "rpstack" is used for an error message when executing the commdands. isdefaultisnames,is(:action must have two or three argumentss;unknown filetype "%s" in :action command; recipe %s line %diÿÿÿÿiN(slensarglistsouttypessstringssplitsintypess recipe_errorsrpstacks_sisft_knowns msg_warningsrecdictsnamesline_nrsActionscommandssactsactionsaction_add_to_dict( srpstacksrecdictsarglistscommandssouttypessisactionsintypessact((s+/mnt/gmirror/ports/devel/aap/work/Action.pys action_addis   6cCs4ti|ƒ ogt|¹ssdefaults iN(sin_ftypestrylistsdepths new_trylistsents _action_dictskeyssactionsactsprimarys get_in_typess get_out_typessatypes out_ftypesWorksRoutesRecPossactionssGlobalsglobalssmaps outfilenamesappendsNone( sin_ftypes out_ftypestrylistsRoutesatypesactionssdepthsentsactsactionsRecPoss new_trylist((s+/mnt/gmirror/ports/devel/aap/work/Action.pysfind_action_route™s<*  !     N  cCs7t}x&t|D]}|io |}qqW|SdS(s5 Find the prinary action with name "action". N(sNonesacts _action_dictsactionsasprimary(sactionsasact((s+/mnt/gmirror/ports/devel/aap/work/Action.pysfind_primary_actionÈs  cCs•g}ti|ƒowxtt|D]d}|o|id|ƒ}n|i d|ƒ}x,|D]$}||jo|i |ƒq]q]Wq!Wn|SdS(sà Return the list of filetypes supported by actions with name "action". If "intype" given this input type must be supported. If "outtype" given this output type must be supported. souttypesintypeN( sretvals _action_dictshas_keysactionsactsin_typess get_in_typessouttypesls get_out_typessintypesisappend(sactionsin_typessintypesouttypesislsactsretval((s+/mnt/gmirror/ports/devel/aap/work/Action.pys get_ftypesÓs  cCs«h}xštiƒD]Œ}h||tscCsd|iƒjS(Nsdefault(sacts get_in_types(sact((s+/mnt/gmirror/ports/devel/aap/work/Action.pys„ssdefaultsUsing default for %s from %sN(sin_ftypes use_in_ftypes out_ftypes use_out_ftypesfounds find_typesfilters _action_dictsactionsactlistsfind_out_ftypesrecdictsmsgs filetype_roots msg_extras_sNone( srecdictsactionsin_ftypes out_ftypesmsgs use_out_ftypes use_in_ftypesfoundsactlist((s+/mnt/gmirror/ports/devel/aap/work/Action.pys action_findds>           )cCsxÿ|iƒD]ñ}t|ƒdjo|d djp|d djo¶|d}||}|ddjoetd|d|ƒ}|oEt i d|dd|dƒdjo |}qÎ|d|}qÒn|o|i |ƒ|| %ss/Internal error: action_run() didn't find actionskeep_current_scopesrpstacksxscopesscopessourcesfnames targettypesactionsDEFER_ACTION_NAMEisvar_sadd_sremove(sgetworksstrings$Error executing commands for %s %s: N(.sargssactions _action_dictshas_keys_s action_ftypesrecdictsin_ftypesmsg_notesgets out_ftypestsNones str2dictlists UserErrorsesstrs action_finds use_in_ftypes use_out_ftypes msg_extras find_actionsacts msg_errorsget_build_recdicts buildrecdictsrpstacks new_recdicts dictlist2strs listitem2strsdefer_action_nameskeysskslensget_vars_from_attrsWorksgetworksss find_nodesnodes attributessdsParsePosscommandssfpsProcess(srecdictsargssfps use_out_ftypes out_ftypes new_recdictsin_ftypesnodes use_in_ftypesesdskssstsactsactionsgetwork((s+/mnt/gmirror/ports/devel/aap/work/Action.pys action_run­sz  !      K  #c Cs¦ti|dƒdjo|Snh}d} xnnofti|d| ƒ}|djoPnt||dƒ} ti|d| ƒ} tg|| | !ƒ} t | ƒdjoê| dd}t i |ƒoÈ| di dƒo| dd}n7d | ddj ot||| dƒ}nt}| o|ot|||dƒ}n| o d }n|id ƒ}yL|dd|d