ó ä@Qc@sBddlZdefd„ƒYZddd„ƒYZeƒZdS(iÿÿÿÿNt DefineModulecBsheZd dddd„Zd„Zed„ƒZdddggd d„Zddd„Zd„Z RS( tcCsX||_||_||_||_g|_|p6g|_tjtjdƒ|_ dS(szDefine a GRT module. Must be called before any function declaration as wbmodule = DefineModule('modname') s app.PluginN( tnametauthortversiont descriptiont functionst implementstgrttListtOBJECTt _pluginList(tselfRRRRR((s..\wb.pyt__init__ s     cCs t||ƒS(N(tgetattr(R R((s..\wb.pyt __getitem__scCstjjjjdS(Ns /modules/data(RtroottwbtregistrytappDataDirectory(R ((s..\wb.pytmoduleDataDirectory st standalonec s(‡‡‡‡‡‡‡‡fd†}|S(s™Decorator to declare a Plugin, used in addition to @wbexport Usage: @wbmodule.plugin("db.utils.mangleNames", caption="Mangle Names", description="Mangles all object names in current catalog beyond recognition.", input= [wbinputs.currentCatalog()], groups=["Menu/Catalog"]) @wbmodule.export(grt.INT, grt.classes.db_Catalog) def mangleNames(catalog): return 1 csadgˆjD]}|d^q kr…ˆjjdtjtjdffgf‡fd†fƒdˆjkr…ˆjjdƒq…ntjjƒ}ˆ|_ˆ|_ ˆ|_ ˆ|_ ˆj|_ |j j|_x'ˆD]}||_|jj|ƒqÚWxˆD]}|jj|ƒqWˆr;|jjdˆƒnd|_d|_ˆjj|ƒ|S(Nt getPluginInfois app.PlugincsˆjS(N(R ((R (s..\wb.pyt7stPluginInterfacesMenu/id(RtappendRtLISTR Rtclassest app_PluginRtcaptionRt pluginTypet moduleNamet func_codetco_nametmoduleFunctionNametownert inputValuestgroupstratingt showProgressR (tfntxtplugtitg(RR RR%tinputt pluginMenuttypeR(s..\wb.pyt setup_plugin1s2&           (( R RRRR/R-R%R.R0((RR RR%R.R-R/Rs..\wb.pytplugin(s $t selectedTextcs‡‡‡‡fd†}|S(NcskdgˆjD]}|d^q kr…ˆjjdtjtjdffgf‡fd†fƒdˆjkr…ˆjjdƒq…ntjjƒ}ˆ|_ˆ|_ d|_ ˆj|_ |j j |_ˆrûtjjƒ}ˆ|_|jj|ƒn|jjdƒd|_d|_ˆjj|ƒtjd tjfgf}ˆjj|j j ||fƒ|S( NRis app.PlugincsˆjS(N(R ((R (s..\wb.pyRXsRRtFilteridttext(RRRRR RRRRRRRR R!R"tapp_PluginInputDefinitionR$R%R&R'R tSTRING(R(R)R*targt signature(RR RR-(s..\wb.pyR0Rs0&        ((R RRR-R0((RR RR-s..\wb.pyt exportFilterQscsFtjtjtjtjtjtjg‰‡‡‡‡fd†}|S(s]Decorator to declare an exported Module function. Usage: @wbmodule.export(grt.INT, grt.classes.db_Table, (grt.LIST, grt.STRING)) def dostuff(arg1, arg2): return 1 Declares the function dostuff as returning an integer and having the 1st arg a db.Table and the 2nd a list of strings. csÃtˆƒ|jjkrFtd|jj|jjtˆƒfƒ‚ng}x=ttˆƒdƒD]%}|dkr~ˆ}nˆ|d}|tjkr§tj}n|tj krÂtj }nt |ƒt kr´|\}}|tjtj gkrtd||fƒ‚n|t tjƒksGt|ddƒt tjƒkr€tjt |ƒtkre|n|jjddƒf}n%|ˆkr¥td||fƒ‚n||f}n—|tjtjtjtjtj tjfkrçndt |ƒtkr-|ˆkr-|tjkr-td t|ƒƒ‚ntj|jjddƒf}|dkrg|j|ƒqc|j|jj|d|fƒqcW|d|df}ˆjj|jj||fƒ|S( Ns>module function '%s' has %i arguments, but @export declares %iiiscargument %i has invalid specification (type %s is not a container type and takes no extra argument)t__name__t_t.sOargument %i has invalid specification (%s it not a valid content type or class)s%%s not a valid GRT type specification(tlenR t co_argcountt TypeErrorR!trangeRR RtDicttDICTR/ttupletdirRRtNoneR tstrR:treplacetINTtDOUBLER6Rt co_varnamesR(R(targlistR+R7t containertypet contenttypeR8(t typenamestargtypest returntypeR (s..\wb.pyt set_types€s>.     69 0- %(RRHRIR6RRBR (R RPRORQ((R RNRPROs..\wb.pytexportus *)N( R:t __module__RER RtpropertyRR1R9RR(((s..\wb.pyRs  )$t _wbinputscBs°eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z e Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„ZRS(cCs4t|ƒtkst‚tjjƒ}||_|S(N(R/RFtAssertionErrorRRtapp_PluginObjectInputtobjectStructName(R t classNameR7((s..\wb.pyt objectOfClass½s cCs%tjjƒ}d|_d|_|S(NtselectedConnectionsdb.mgmt.Connection(RRRWRRX(R R7((s..\wb.pyR[Äs  cCs%tjjƒ}d|_d|_|S(NtselectedInstancesdb.mgmt.ServerInstance(RRRWRRX(R R7((s..\wb.pyR\Ês  cCs%tjjƒ}d|_d|_|S(Nt activeModelsworkbench.physical.Model(RRRWRRX(R R7((s..\wb.pyt currentModelÓs  cCs%tjjƒ}d|_d|_|S(Nt activeCatalogs db.Catalog(RRRWRRX(R R7((s..\wb.pytcurrentCatalogÙs  cCs%tjjƒ}d|_d|_|S(Nt activeDiagramsworkbench.physical.Diagram(RRRWRRX(R R7((s..\wb.pytcurrentDiagramßs  cCs%tjjƒ}d|_d|_|S(NtactiveSQLEditorsdb.query.Editor(RRRWRRX(R R7((s..\wb.pytcurrentSQLEditorçs  cCs%tjjƒ}d|_d|_|S(NtactiveQueryEditorsdb.query.QueryEditor(RRRWRRX(R R7((s..\wb.pytcurrentQueryEditorîs  cCs%tjjƒ}d|_d|_|S(NtactiveResultsetsdb.query.Resultset(RRRWRRX(R R7((s..\wb.pytcurrentResultsetõs  cCs%tjjƒ}d|_d|_|S(NRgsdb.query.EditableResultset(RRRWRRX(R R7((s..\wb.pytcurrentEditableResultsetûs  cCs%tjjƒ}d|_d|_|S(NRsdb.query.LiveDBObject(RRRWRRX(R R7((s..\wb.pytselectedLiveObjects  cCs%tjjƒ}d|_d|_|S(Ntschemasdb.query.LiveDBObject(RRRWRRX(R R7((s..\wb.pytselectedLiveSchemas  cCs%tjjƒ}d|_d|_|S(Nttablesdb.query.LiveDBObject(RRRWRRX(R R7((s..\wb.pytselectedLiveTable s  cCs%tjjƒ}d|_d|_|S(Ntviewsdb.query.LiveDBObject(RRRWRRX(R R7((s..\wb.pytselectedLiveViews  cCs%tjjƒ}d|_d|_|S(Ntroutinesdb.query.LiveDBObject(RRRWRRX(R R7((s..\wb.pytselectedLiveRoutines  cCstjjƒ}d|_|S(NtselectedRowList(RRR5R(R R7((s..\wb.pyRss cCstjjƒ}d|_|S(Nt clickedRow(RRR5R(R R7((s..\wb.pyRt$s cCstjjƒ}d|_|S(Nt clickedColumn(RRR5R(R R7((s..\wb.pyRu)s (R:RSRZR[R\R^R`RbRdRftcurrentQueryBufferRhRiRjRlRnRpRrRsRtRu(((s..\wb.pyRU¼s&                ((RtdictRRUtwbinputs(((s..\wb.pyts ´s