def examples_bxPipPkgsFull(): ####+END: """ ** Common examples. """ def cpsInit(): return collections.OrderedDict() def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) #bxRootBase = bxpRoot_baseObtain(None) #examples_bxPlatformBaseDirsCommon() icm.cmndExampleMenuChapter('* =Module= Overview (desc, usage, status)') cmndName = "overview_bxpBaseDir" ; cmndArgs = "moduleDescription moduleUsage moduleStatus" ; cps = collections.OrderedDict() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.cmndExampleMenuChapter(' =BxP DirBases= *pbdShow/pbdVerify/pbdUpdate Of Relevant PBDs*') icm.cmndExampleMenuSection(' =BxP DirBases= *pbdShow*') cmndName = "pbdShow" ; cmndArgs = "/ dist" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little', comment="# default pbdName")
def targetParamListCommonExamples( loadTargetArgs="", loadParamsArgs="", ): """ """ icm.cmndExampleMenuChapter( '*Common: TargetList And ParameterList and TICMO (Output) Information*' ) icm.cmndExampleMenuSection( 'targetsAccessListShow -- Based on targetsAccessListGet') thisCmndAction = " -i empna.targetsAccessListShow" icm.cmndExampleMenuItem(format(loadTargetArgs + thisCmndAction), verbosity='none') thisCmndAction = " -i empna.targetsAccessListGet" icm.cmndExampleMenuItem(format(loadTargetArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuSection( 'targetParametersListShow -- Based on targetParametersListGet') thisCmndAction = " -i empna.targetParamsListShow" icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), comment="# Targets List + T_Params List", verbosity='none') thisCmndAction = " -i empna.targetParamsListGet" icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuSection( """TICMO: Target Path Base -- Give A Target's DN, Produce its Path Base""" ) thisCmndAction = " -i empna.targetBaseGet" targetSpecOptions = " --collective int --district libreCenter --targetType bxp --targetId localhost" icm.cmndExampleMenuItem(format(loadTargetArgs + targetSpecOptions + thisCmndAction), verbosity='none')
def cmnd(self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate(callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) ##### IMPORTANT PARAMS SPECIFICATIONS BEGIN svcSpecUrl="http://petstore.swagger.io/v2/swagger.json" svcSpecFile="./swagger.json" perfSap="http://localhost:8080/v2/swagger.json" headersFileName = "./bearerToken.headers" includeOpsListInExamples = True ##### IMPORTANT PARAMS SPECIFICATIONS END logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() icm.cmndExampleMenuChapter('*Config And Prepare The Invoker -- Create Header Files -- Obtain Swagger Spec*') cmndName = "prepInvoker" cmndArgs = ""; cps = cpsInit(); menuItem(verbosity='little') cmndName = "headersCreate" cmndArgs = ""; cps = cpsInit(); menuItem(verbosity='none') execLineEx("""{myName} -i headersCreate > {headersFileName}""".format( myName=G.icmMyName(), headersFileName=headersFileName, )) execLineEx("""wget {svcSpecUrl}""".format( svcSpecUrl=svcSpecUrl, )) # # svcOpsList examples from wsInvokerIcm # wsInvokerIcm.examples_commonInvoker( svcSpecUrl=svcSpecUrl, svcSpecFile=svcSpecFile, perfSap=perfSap, headers=headersFileName, ) icm.cmndExampleMenuChapter('*Operations Invokations*') cmndName = "rinvoke" # #rinvoker.py --svcSpec=http://petstore.swagger.io/v2/swagger.json --perfSap=http://localhost:8080/v2/swagger.json --headers=./bearerToken.headers --resource=user --opName=loginUser -i rinvoke username=usernameVALUE password=passwordVALUE # icm.cmndExampleMenuSection('* -i rinvoke loginUser svcSpecUrl*') cps = cpsInit(); cps['svcSpec'] = svcSpecUrl cps['resource'] = "user" cps['opName'] = "loginUser" cmndArgs = "username=someUser password=somePasswd" menuItem(verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cps = cpsInit(); cps['svcSpec'] = svcSpecUrl cps['headers'] = headersFileName cps['resource'] = "user" cps['opName'] = "loginUser" cmndArgs = "username=someUser password=somePasswd" menuItem(verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuSection('* -i rinvoke Create User svcSpecFile*') bodyStr="{'xml': {'name': 'User'}, 'x-model': 'User', 'type': 'object', 'properties': {'username': {'type': 'string'}, 'firstName': {'type': 'string'}, 'lastName': {'type': 'string'}, 'userStatus': {'type': 'integer', 'description': 'User Status', 'format': 'int32'}, 'id': {'type': 'integer', 'format': 'int64'}, 'phone': {'type': 'string'}, 'password': {'type': 'string'}, 'email': {'type': 'string'}}}" cps = cpsInit(); cps['svcSpec'] = svcSpecUrl cps['resource'] = "user" cps['opName'] = "createUser" cmndArgs = "bodyStr=\"{}\"".format(bodyStr) menuItem(verbosity='none') menuItem(verbosity='little') if includeOpsListInExamples: icm.cmndExampleMenuChapter('*List Of Service Operation Invokations*') if svcSpecFile: if os.path.isfile(svcSpecFile): svcSpec = svcSpecFile else: svcSpec = svcSpecUrl else: svcSpec = svcSpecUrl cmndOutcome = wsInvokerIcm.svcOpsList().cmnd( interactive=False, svcSpec=svcSpec, perfSap=None, headers=None, ) else: icm.cmndExampleMenuChapter('*Enable includeOpsListInExamples For An Example List Of Service Operation Invokations*') return(cmndOutcome) ####+BEGIN: bx:icm:python:cmnd:subSection :title "Remain In Sycn With Template" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Remain In Sycn With Template* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Remain In Sycn With Template*') #templateFile = "/de/bx/nne/dev-py/pypi/pkgs/bisos/examples/dev/bin/icmBegin.py" templateFile = "/de/bx/nne/dev-py/pypi/pkgs/unisos/icmExamples/dev/bin/icmBegin.py" thisFile = __file__ execLineEx("""diff {thisFile} {templateFile}""".format(thisFile=thisFile, templateFile=templateFile)) execLineEx("""cp {thisFile} {templateFile}""".format(thisFile=thisFile, templateFile=templateFile)) execLineEx("""cp {templateFile} {thisFile}""".format(thisFile=thisFile, templateFile=templateFile)) return(cmndOutcome)
def examples_tokenGenerator( userName, role, acGroups, ): ####+END: """.""" def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) icm.cmndExampleMenuChapter( '*= bearerToken CmndsLib: Token Manager -- Output / Input =*') icm.cmndExampleMenuSection('* -i jwtPlain*') cmndName = "jwtPlainOutStr" cps = cpsInit() cps['userName'] = userName cps['role'] = role cps['acGroups'] = acGroups cmndArgs = "" menuItem(verbosity='none') #icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "jwtPlainOutFile" cps = cpsInit() cps['userName'] = userName cps['role'] = role cps['acGroups'] = acGroups cmndArgs = "/tmp/bearerPlain.json" menuItem(verbosity='none') icm.cmndExampleMenuSection('* -i jwtSigned*') cmndName = "jwtSignedOutStr" cps = cpsInit() cps['userName'] = userName cps['role'] = role cps['acGroups'] = acGroups cmndArgs = "" menuItem(verbosity='none') cmndName = "jwtSignedOutFile" cps = cpsInit() cps['userName'] = userName cps['role'] = role cps['acGroups'] = acGroups cmndArgs = "/tmp/bearerSigned.jwt" menuItem(verbosity='none') icm.cmndExampleMenuSection('* -i jwtPlainInput*') cmndName = "jwtPlainInFiles" cps = cpsInit() cmndArgs = "/tmp/bearerPlain.json" menuItem(verbosity='none')
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() ####+BEGIN: bx:icm:python:cmnd:subSection :title "Dev And Testing" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Dev And Testing* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*General Dev and Testing IIFs*') cmndName = "unitTest" cmndArgs = "" cps = cpsInit() # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*BinsPreps*') cmndAction = " -i binsPreps" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') cmndAction = " -i binsPrepsCurInfo" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') icm.cmndExampleMenuSection('*Install ICMs Needed Linux Packages*') cmndAction = " -i canon_linuxPkgInstall" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') icm.cmndExampleMenuSection('*Install ICMs Needed Python Packages*') cmndAction = " -i canon_pythonPkgInstall" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') # # ICMs PKG Information # icmsPkgInfoBaseDir = marmePkgThis.pkgBase_configDir() icmsPkgModuleBaseDir = marmePkgThis.pkgBase_baseDir() icmsPkgLib.examples_pkgInfoParsFull( icmsPkgNameSpecification(), icmsPkgInfoBaseDir=icmsPkgInfoBaseDir, icmsPkgModuleBaseDir=icmsPkgModuleBaseDir, icmsPkgControlBaseDir=icmsPkgControlBaseDirDefault(), icmsPkgRunBaseDir=icmsPkgRunBaseDirDefault(), )
def examples_commonInvoker( svcSpecUrl, svcSpecFile, perfSap, headers, ): ####+END: """.""" def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) def headersParam(cps, headers): if headers: cps['headers'] = headers icm.cmndExampleMenuChapter('*Service Specification Digestion*') cmndName = "svcOpsList" if svcSpecUrl: icm.cmndExampleMenuSection('* -i svcOpsList svcSpecUrl*') cps = cpsInit() cps['svcSpec'] = svcSpecUrl headersParam(cps, headers) cmndArgs = "" menuItem(verbosity='none') #icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cps = cpsInit() cps['svcSpec'] = svcSpecUrl cps['perfSap'] = perfSap headersParam(cps, headers) cmndArgs = "" menuItem(verbosity='none') if svcSpecFile: icm.cmndExampleMenuSection('* -i svcOpsList svcSpecFile*') # cps = cpsInit(); # cps['svcSpec'] = svcSpecFile # headersParam(cps, headers) # cmndArgs = ""; # menuItem(verbosity='none') # #icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cps = cpsInit() cps['svcSpec'] = svcSpecFile cps['perfSap'] = perfSap headersParam(cps, headers) cmndArgs = "" menuItem(verbosity='none')
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) ##### IMPORTANT PARAMS SPECIFICATIONS BEGIN svcSpecUrl = "http://petstore.swagger.io/v2/swagger.json" svcSpecFile = "./swagger.json" perfSap = "http://localhost:8080/v2/swagger.json" headersFileName = "./bearerToken.headers" includeOpsListInExamples = True ##### IMPORTANT PARAMS SPECIFICATIONS END logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() icm.cmndExampleMenuChapter( '*Config And Prepare The Invoker -- Create Header Files -- Obtain Swagger Spec*' ) cmndName = "prepInvoker" cmndArgs = "" cps = cpsInit() menuItem(verbosity='little') execLineEx("""wget {svcSpecUrl}""".format(svcSpecUrl=svcSpecUrl, )) # # svcOpsList examples from wsInvokerIcm # wsInvokerIcm.examples_commonInvoker( svcSpecUrl=svcSpecUrl, svcSpecFile=svcSpecFile, perfSap=perfSap, headers=None, ) icm.cmndExampleMenuChapter('*Operations Invokations*') cmndName = "rinvoke" # #rinvoker.py --svcSpec=http://petstore.swagger.io/v2/swagger.json --perfSap=http://localhost:8080/v2/swagger.json --headers=./bearerToken.headers --resource=user --opName=loginUser -i rinvoke username=usernameVALUE password=passwordVALUE # icm.cmndExampleMenuSection('* -i rinvoke loginUser svcSpecUrl*') cps = cpsInit() cps['svcSpec'] = svcSpecUrl cps['resource'] = "user" cps['opName'] = "loginUser" cmndArgs = "username=someUser password=somePasswd" menuItem(verbosity='none') #icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cps = cpsInit() cps['svcSpec'] = svcSpecFile cps['perfSap'] = perfSap cps['headers'] = headersFileName cps['resource'] = "user" cps['opName'] = "loginUser" cmndArgs = "username=someUser password=somePasswd" menuItem(verbosity='none') #icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuSection('* -i rinvoke getPetById*') cps = cpsInit() #cps['svcSpec'] = svcSpecFile cps['svcSpec'] = svcSpecUrl #cps['perfSap'] = perfSap cps['resource'] = "pet" cps['opName'] = "getPetById" cmndArgs = "petId=1" menuItem(verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cps = cpsInit() #cps['svcSpec'] = svcSpecFile cps['svcSpec'] = svcSpecUrl #cps['perfSap'] = perfSap cps['resource'] = "pet" cps['opName'] = "getPetById" cmndArgs = "petId=2" menuItem(verbosity='none') if includeOpsListInExamples: icm.cmndExampleMenuChapter( '*List Of Service Operation Invokations*') if svcSpecFile: if os.path.isfile(svcSpecFile): svcSpec = svcSpecFile else: svcSpec = svcSpecUrl else: svcSpec = svcSpecUrl cmndOutcome = wsInvokerIcm.svcOpsList().cmnd( interactive=False, svcSpec=svcSpec, perfSap=None, headers=None, ) else: icm.cmndExampleMenuChapter( '*Enable includeOpsListInExamples For An Example List Of Service Operation Invokations*' ) return (cmndOutcome)
def cmnd( self, interactive=False, # Can also be called non-interactively bpoId=None, # or Cmnd-Input sivd=None, # or Cmnd-Input si=None, # or Cmnd-Input ) -> icm.OpOutcome: cmndOutcome = self.getOpOutcome() if not self.obtainDocStr: if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = { 'bpoId': bpoId, 'sivd': sivd, 'si': si, } if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome bpoId = callParamsDict['bpoId'] sivd = callParamsDict['sivd'] si = callParamsDict['si'] ####+END: docStr = """\ ***** [[elisp:(org-cycle)][| *CmndDesc:* | ]] ICM examples, all in one place. """ if self.docStrClassSet(docStr, ): return cmndOutcome def cpsInit(): return collections.OrderedDict() cmndArgs = "" cps = cpsInit() def menuItem(verbosity, **kwArgs): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity, **kwArgs) # def menuItem(verbosity='little', comment=""): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity, comment=comment) # 'little' or 'none' # def extMenuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmName=icmExName, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) oneBpo = "pmi_ByD-100001" oneSiRelPath = "jekyll/main" if bpoId: oneBpo = bpoId if si: oneSiRelPath = si aipxBase = f"/bisos/var/aipx/{G.icmMyName()}/example" # no dateTag aipxRoot = f"/bisos/var/aipx/{G.icmMyName()}" # will be dateTag-ed # csmuApPath = f"/bisos/var/lipcs/{G.icmMyName()}" rosmuApPath = f"/bisos/var/gipcs/{G.icmMyName()}" # logControler = icm.LOG_Control() # logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() cmndName = "jekyllSiteUpdate" cmndArgs = "" icm.cmndExampleMenuChapter('*Direct ICM *') cps = cpsInit() cps['bpoId'] = oneBpo cps['si'] = oneSiRelPath menuItem(verbosity='little', comment="# Under development in parts") icm.cmndExampleMenuChapter('*Local And Remote Invoker*') icm.cmndExampleMenuSection('*Local Invoker*') cps = cpsInit() cps['insAsFPs'] = aipxBase cps['bpoId'] = oneBpo cps['si'] = oneSiRelPath menuItem(verbosity='little', comment="# Under development in parts") execLineEx(f"""\ aipx_icmInv aipx_icmInv --{aipxBase} -- {G.icmMyName()} --bpoId={oneBpo} -i {cmndName} aipx_icmInv --{aipxRoot} -i inv -- {G.icmMyName()} --bpoId={oneBpo} -i {cmndName}\ """) execLineEx(f"""\ lipcs_manage.py lipcs_manage.py --csmuApPath={csmuApPath} -i inv -- {G.icmMyName()} --bpoId={oneBpo} -i {cmndName}\ """) icm.cmndExampleMenuSection('*Git-Shell Remote Invoker*') execLineEx(f"""\ gipcs_manage.py gipcs_manage.py --rosmuApPath={rosmuApPath} -i inv -- --bpoId={oneBpo} -i {cmndName}\ """) icm.cmndExampleMenuChapter('*GitSh RO: Performer*') execLineEx("""\ aipx_icmPerf aipx_icmPerf /bisos/var/gitSh/invoker""") return (cmndOutcome)
def cmnd(self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate(callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() ####+BEGIN: bx:icm:python:cmnd:subSection :title "Write One File Parameter" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Write One File Parameter* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*FILE_TreeObject Manipulation*') icm.cmndExampleMenuSection('*Create A FILE_TreeNode*') cmndName = "nodeCreate" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "leafCreate" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "treeObjectDescribe" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "nodesList" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "leavesList" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "nodesEffectiveList" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') cmndName = "leavesEffectiveList" cmndArgs = "/tmp/t1"; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') ####+BEGIN: bx:icm:python:cmnd:subSection :title "Remain In Sycn With Template" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Remain In Sycn With Template* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Remain In Sycn With Template*') #templateFile = "/de/bx/nne/dev-py/pypi/pkgs/bisos/examples/dev/bin/icmBegin.py" templateFile = "/de/bx/nne/dev-py/pypi/pkgs/unisos/icmExamples/dev/bin/icmBegin.py" thisFile = __file__ execLineEx("""diff {thisFile} {templateFile}""".format(thisFile=thisFile, templateFile=templateFile)) execLineEx("""cp {thisFile} {templateFile}""".format(thisFile=thisFile, templateFile=templateFile)) execLineEx("""cp {templateFile} {thisFile}""".format(thisFile=thisFile, templateFile=templateFile)) return(cmndOutcome)
def cmnd(self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate(callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: icm.ex_gCommon() bleep.examples_icmBasic() """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: General Dev and Testing IIFs [[elisp:(org-cycle)][| ]] """ icm.cmndExampleMenuChapter('*General Dev and Testing IIFs*') cmndName = "unitTest" ; cmndArgs = "" ; cps = collections.OrderedDict() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: Default Mail From Complete File [[elisp:(org-cycle)][| ]] """ #enabledControlProfile = marmeAcctsLib.enabledControlProfileObtain() #enabledMailAcct = marmeAcctsLib.enabledInMailAcctObtain() icm.cmndExampleMenuChapter("""*CmndsRun*""") cmndName = "cmndsRun" icm.cmndExampleMenuSection("""*Full Marame Commands Run*""") cmndArgs = "inMailRetrieve inMailUaUpdate inMailDsnProc" cps = collections.OrderedDict() ; #cps['controlProfile'] = enabledControlProfile ; cps['inMailAcct'] = enabledMailAcct icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='little') icm.cmndExampleMenuSection("""*Test All Marame Commands Run*""") cmndArgs = "inMailRetrieve inMailUaUpdate inMailDsnProcReport" cps = collections.OrderedDict() ; #cps['controlProfile'] = enabledControlProfile ; cps['inMailAcct'] = enabledMailAcct icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='little') cmndArgs = "inMailRetrieve inMailUaUpdate inMailDsnTestProc" cps = collections.OrderedDict() ; #cps['controlProfile'] = enabledControlProfile ; cps['inMailAcct'] = enabledMailAcct icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='little') icm.cmndExampleMenuChapter("""*CmndsRunPeriodically*""") cmndName = "cmndsRunPeriodically" icm.cmndExampleMenuSection("""*Full Marame Commands Run Periodically*""") cmndArgs = "inMailRetrieve inMailUaUpdate inMailDsnProc" cps = collections.OrderedDict() ; cps['periodicity'] = "360" #cps['controlProfile'] = enabledControlProfile ; cps['inMailAcct'] = enabledMailAcct icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='little') cmndArgs = "inMailRetrieve inMailUaUpdate inMailDsnTestProc" cps = collections.OrderedDict() ; cps['periodicity'] = "360" #cps['controlProfile'] = enabledControlProfile ; cps['inMailAcct'] = enabledMailAcct icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper=None, verbosity='little') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: From marmeAcctsLib.py [[elisp:(org-cycle)][| ]] """ marmeAcctsLib.examples_controlProfileManage() marmeAcctsLib. examples_enabledInMailAcctConfig() marmeAcctsLib. examples_enabledOutMailAcctConfig() marmeAcctsLib.examples_select_mailBox() marmeAcctsLib.examples_inMailAcctAccessPars() marmeAcctsLib.examples_outMailAcctAccessPars() return(cmndOutcome)
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() defaultMailDom = marmeAcctsLib.enabledInMailAcctObtain( bxoId=curGet_bxoId(), sr=curGet_sr(), ) ####+BEGIN: bx:icm:python:cmnd:subSection :title "Dev And Testing" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Dev And Testing* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: #icm.cmndExampleMenuChapter('*General Dev and Testing IIFs*') icm.cmndExampleMenuChapter('*Config File Creation Facilities*') icm.cmndExampleMenuSection( '*Automated Config File Creation Facilities*') cmndName = "notmuchConfigUpdate" cmndArgs = "" cps = cpsInit() cmndParsCurBxoSr(cps) menuItem(verbosity='none') menuItem(verbosity='full') cmndName = "notmuchConfigStdout" cmndArgs = "" cps = cpsInit() cmndParsCurBxoSr(cps) menuItem(verbosity='none') menuItem(verbosity='full') configFile = withInMailDomGetNotmuchConfigPath( defaultMailDom, bxoId=curGet_bxoId(), sr=curGet_sr(), ) icm.ANN_write("""ls -l {}""".format(configFile)) icm.ANN_write("""cat {} """.format(configFile)) icm.cmndExampleMenuSection( '*Interactive Config File Creation Facilities*') cmndName = "runNotmuch" cmndArgs = "setup" cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Creates/Edits notmuch-config', icmWrapper=None, icmName=None) icm.cmndExampleMenuSection('*Show/List Config Parameter Settings*') cmndName = "runNotmuch" cmndArgs = "config list" cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Shows Key aspects of notmuch-config', icmWrapper=None, icmName=None) icm.cmndExampleMenuChapter('*Run notmuch -- new, Search*') cmndName = "runNotmuch" cmndArgs = "new" cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Refresh the index', icmWrapper=None, icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search --format=text --output=files "from:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Search Based on from', icmWrapper=None, icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search --format=text --output=files "from:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment='# Search Based on from', icmWrapper='echo', icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search "from:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Search Based on from', icmWrapper=None, icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search "from:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment='# Search Based on from', icmWrapper='echo', icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search --format=text --output=files "from:" | grep Inbox | xargs egrep "^Subject:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='basic', comment='# Search Based on from', icmWrapper=None, icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search --format=text --output=files "from:" | grep Inbox | xargs egrep "^Subject:"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment='# Search Based on from', icmWrapper="echo", icmName=None) cmndName = "runNotmuch" cmndArgs = '''-- search --output=files "to: example.com"''' cps = cpsInit() cmndParsCurBxoSr(cps) icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment='# Search Based on from', icmWrapper="echo", icmName=None) marmeAcctsLib.examples_controlProfileManage() marmeAcctsLib.examples_enabledInMailAcctConfig() marmeAcctsLib.examples_inMailAcctAccessPars()
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: icm.ex_gCommon() bleep.examples_icmBasic() # """ # ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: General Dev and Testing IIFs [[elisp:(org-cycle)][| ]] # """ # icm.cmndExampleMenuChapter('*General Dev and Testing IIFs*') # cmndName = "unitTest" ; cmndArgs = "" ; cps = collections.OrderedDict() # icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: Default Mail From Complete File [[elisp:(org-cycle)][| ]] """ enabledControlProfile = marmeAcctsLib.enabledControlProfileObtain( curGet_bxoId(), curGet_sr()) enabledOutMailAcct = marmeAcctsLib.enabledOutMailAcctObtain( curGet_bxoId(), curGet_sr()) #enabledControlProfile = marmeAcctsLib.enabledControlProfileObtain() #enabledOutMailAcct = marmeAcctsLib.enabledOutMailAcctObtain() icm.cmndExampleMenuChapter( """*Mail From Complete File -- Default ControlProfile={controlProfile} Acct={mailAcct}*""" .format( controlProfile=enabledControlProfile, mailAcct=enabledOutMailAcct, )) cmndName = "sendCompleteMessage" cmndArgs = "" icm.cmndExampleMenuSection( """*Mail File fromValid/toValid -- Default ControlProfile={controlProfile} Acct={mailAcct}*""" .format(controlProfile=enabledControlProfile, mailAcct=enabledOutMailAcct)) inFileExample = '''{fileName}'''.format(fileName=os.path.join( marmeAcctsLib.outMailCommonDirGet( enabledControlProfile, curGet_bxoId(), curGet_sr(), ), "template/plain/fromValid/toValid/default.mail")) cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "runDebug" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "runDebug" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='little') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "dryRun" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.cmndExampleMenuSection( """*Mail File fromValid/toBad -- Default ControlProfile={controlProfile} Acct={mailAcct}*""" .format( controlProfile=enabledControlProfile, mailAcct=enabledOutMailAcct, )) inFileExample = '''{fileName}'''.format(fileName=os.path.join( marmeAcctsLib.outMailCommonDirGet( enabledControlProfile, curGet_bxoId(), curGet_sr(), ), "template/plain/fromValid/toBad/default.mail")) cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "runDebug" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "runDebug" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='little') cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['runMode'] = "dryRun" cps['inFile'] = inFileExample icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: Mail From Partial File -- Qmail Inject [[elisp:(org-cycle)][| ]] """ icm.cmndExampleMenuChapter('*Mail From Partial File -- Qmail Inject*') inFileExample = '''{fileName}'''.format(fileName=os.path.join( marmeAcctsLib.outMailCommonDirGet( enabledControlProfile, curGet_bxoId(), curGet_sr(), ), "template/bynameUtf8.mail")) cmndName = "sendFromPartialFileWithPars" cmndArgs = "" cps = collections.OrderedDict() cps['submissionMethod'] = "inject" cps['inFile'] = inFileExample cps['runMode'] = "dryRun" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: Basic Mail Sending [[elisp:(org-cycle)][| ]] """ icm.cmndExampleMenuChapter('*Basic Mail Sending*') cmndName = "msgSend_basic" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cmndName = "msgSend_basic" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['verbosity'] = "20" cps['runMode'] = "runDebug" cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cmndName = "msgSend_basic" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['verbosity'] = "20" cps['runMode'] = "dryRun" cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cmndName = "msgSend_tracked" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cmndName = "msgSend_tracked" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['verbosity'] = "20" cps['runMode'] = "runDebug" cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') cmndName = "msgSend_tracked" cmndArgs = "" cps = collections.OrderedDict() cmndParsCurBxoSr(cps) cps['verbosity'] = "20" cps['runMode'] = "dryRun" cps['fromLine'] = "*****@*****.**" cps['toLine'] = "*****@*****.**" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') """ ** [[elisp:(org-cycle)][| ]] [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(beginning-of-buffer)][Top]] [[elisp:(delete-other-windows)][(1)]] || Examples :: From marmeAcctsLib.py [[elisp:(org-cycle)][| ]] """ marmeAcctsLib.examples_controlProfileManage() marmeAcctsLib.examples_enabledOutMailAcctConfig() marmeAcctsLib.examples_outMailAcctAccessPars() return (cmndOutcome)