def thisBlock(): cmndArgs = "somePasswd" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, 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 logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() icm.cmndExampleMenuChapter('*argsProc*') cmndName = "argsProc" ; cmndArgs = "list argOne twoArg arg3" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') return(cmndOutcome)
def thisBlock(): cps = cpsInit() # setRsrc(cps) cmndArgs = "" cps['accessKey'] = "userName" cps['secretKey'] = "passwd" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none')
def examples_pkgInfoParsFull( icmsPkgName, icmsPkgInfoBaseDir=None, icmsPkgModuleBaseDir=None, icmsPkgControlBaseDir=None, icmsPkgRunBaseDir=None, ): """ ** Auxiliary examples to be commonly used. """ icm.cmndExampleMenuChapter(' =Pkg/Module BaseDirs= *Admin Panel*') print( ("{icmsPkgInfoBaseDir} # pkgInfo/fp/icmsPkgName ## Rest is obsolete". format(icmsPkgInfoBaseDir=icmsPkgInfoBaseDir))) print(("{icmsPkgModuleBaseDir} # admin,inputs".format( icmsPkgModuleBaseDir=icmsPkgModuleBaseDir))) print(("{panel}".format( panel=os.path.join(icmsPkgModuleBaseDir, "admin", "Panel.org")))) icm.cmndExampleMenuChapter(' =FP Values= *pkgInfo Get Parameters*') cmndName = "pkgInfoParsGet" cmndArgs = "" cps = collections.OrderedDict() cps['icmsPkgInfoBaseDir'] = icmsPkgInfoBaseDir icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little')
def thisBlock(): cmndArgs = "" cps = cpsInit() cps['rsrc'] = rsrcPath cps['passwdPolicy'] = 'prompt' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full')
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 moduleOverviewMenuItem(overviewCmndName): icm.cmndExampleMenuChapter( '* =Module= Overview (desc, usage, status)') cmndName = "overview_bxpBaseDir" cmndArgs = "moduleDescription moduleUsage moduleStatus" cps = collections.OrderedDict() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') # 'little' or 'none'
def menuItem(verbosity): icm.ex_gCmndMenuItem( cmndName, cps, cmndArgs, verbosity=verbosity, comment='none', icmWrapper=None, icmName=None) # verbosity: 'little' 'basic' 'none'
def thisBlock(): cps = cpsInit() setRsrc(cps) cmndArgs = "" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment="> current.token")
def thisBlock(): cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' cps['passwdPolicy'] = 'prompt' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full')
def thisBlock(): cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'keyring' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none', comment="# One time initialization") icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full')
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() icm.cmndExampleMenuChapter('*General Dev and Testing CMNDs*') cmndName = "argsAndParamsProc" cmndArgs = "list argOne twoArg arg3" cps = cpsInit() menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Other Than ICM Execution Line Examples*') execLineEx("""ls -l""") # icmMainProxy.mainsInfo() return (cmndOutcome)
def examples_icmBasic(): ####+END: """ ** Auxiliary examples to be commonly used. """ icm.cmndExampleMenuChapter(' =PkgBase= *PkgBase Get Dirs*') cmndName = "pkgBase" ; cmndArgs = "configDir" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgBase" ; cmndArgs = "rootDir" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little')
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() selectedPipPkg = "unisos.marme" icm.cmndExampleMenuChapter('*General Dev and Testing CMNDs*') cmndName = "unitTest" cmndArgs = "" cps = cpsInit() # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Input and Output Examples CMNDs*') cmndName = "outStreamsExamples" cmndArgs = "" cps = collections.OrderedDict() # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Other Than ICM Execution Line Examples*') execLineEx("""ls -l""") 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='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) icmsPkgInfoBaseDir = gossonotPkgThis.pkgBase_baseDir() #print icmsPkgInfoBaseDir 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 CMNDs*') cmndName = "unitTest" cmndArgs = "" cps = collections.OrderedDict() # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') ####+BEGIN: bx:icm:python:cmnd:subSection :title "Simplified Targets Selection" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Simplified Targets Selection* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Simplified Targets Selection*') # execLineEx("""ln -s /de/bx/current/district/librecenter/tiimi/targets/bxp/tList/ts-librecenter-localhostIcm.py liTargets.py""") # execLineEx("""ln -s /de/bx/current/district/librecenter/tiimi/targets/bxp/paramList/bxpUsageParamsIcm.py liParams.py""") execLineEx( """ln -s {pkgBaseDir}/ts-librecenter-localhostIcm.py liTargets.py""" .format(pkgBaseDir=icmsPkgInfoBaseDir)) execLineEx( """ln -s {pkgBaseDir}/bxpUsageParamsIcm.py liParams.py""".format( pkgBaseDir=icmsPkgInfoBaseDir)) execLineEx( """stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 10s --verbose""" ) loadTargetArgs = """ --load ./liTargets.py""" loadParamsArgs = """ --load ./liParams.py """ #ticmoFullInfo=format(commonArgs + loadTargetArgs) toIcm.targetParamSelectCommonExamples() toIcm.targetParamListCommonExamples(loadTargetArgs=loadTargetArgs, loadParamsArgs=loadParamsArgs) #fileParamPath1 = "/de/bx/coll/libreCenter/platforms/bue/0015/params/access/cur/" #fileParamPath2 = "/de/bx/coll/libreCenter/platforms/bue/0015/params/access/cur/" ####+BEGIN: bx:icm:python:cmnd:subSection :title "Run With Targets" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Run With Targets* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter( '/TOICM: Monitor/ *targetsParamsToIcmMonitor*') thisCmndAction = " -i linuxUsageKpisRetrieve" # accessParams = " --targetFqdn " + thisTargetFqdn + " --userName " + thisUser + " --password " + thisPassword # icm.cmndExampleMenuItem(format(toIcmMonitorArgs + accessParams + thisCmndAction), # verbosity='none') icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='full')
def menuItem(verbosity, **kwargs): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity, **kwargs)
def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or '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 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: 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_pkgInfoParsFull(configBaseDir, ): ####+END: """ ** Auxiliary examples to be commonly used. """ def cpsInit(): return collections.OrderedDict() def menuItem(verbosity): icm.ex_gCmndMenuItem( cmndName, cps, cmndArgs, verbosity=verbosity, comment='none', icmWrapper=None, icmName=None) # verbosity: 'little' 'basic' 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) icm.cmndExampleMenuChapter(' =FP Values= *pkgInfo Get Parameters*') cmndName = "pkgInfoParsGet" cmndArgs = "" cps = collections.OrderedDict() cps['configBaseDir'] = configBaseDir icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsGet" cmndArgs = "" cps = cpsInit() menuItem(verbosity='none') icm.cmndExampleMenuChapter(' =FP Values= *PkgInfo Defaults ParsSet --*') cmndName = "pkgInfoParsDefaultsSet" cmndArgs = "bxoPolicy /" cpsInit() menuItem('none') cmndName = "pkgInfoParsDefaultsSet" cmndArgs = "bxoPolicy /tmp" cpsInit() menuItem('none') icm.cmndExampleMenuChapter( ' =FP Values= *PkgInfo ParsSet -- Set Parameters Explicitly*') cmndName = "pkgInfoParsSet" cmndArgs = "" cps = collections.OrderedDict() cps['bxoId'] = "mcm" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsSet" cmndArgs = "" cps = collections.OrderedDict() cps['bxoId'] = "ea-59043" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsSet" cmndArgs = "" cps = collections.OrderedDict() cps['sr'] = "marme/dsnProc" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsSet" cmndArgs = "" cps = collections.OrderedDict() cps['sr'] = "apache2/plone3" icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') # cmndName = "pkgInfoParsSet" ; cmndArgs = "" ; # cps = collections.OrderedDict() ; cps['configBaseDir'] = configBaseDir ; cps['platformControlBaseDir'] = "${HOME}/bisosControl" # icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsSet" cmndArgs = "anyName=anyValue" cps = collections.OrderedDict() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') cmndName = "pkgInfoParsSet" cmndArgs = "anyName=anyValue" cps = collections.OrderedDict() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmWrapper="echo", verbosity='little')
def extMenuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, icmName=icmExName, verbosity=verbosity) # 'little' or '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 ): 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') ####+BEGIN: bx:icm:python:cmnd:subSection :title "marmeAcctsLib Examples" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *withVenv Run PIP Commands* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: marmeAcctsLib.examples_bxoSrPkgInfoParsGet() marmeAcctsLib.examples_controlProfileManage() #marmeAcctsLib.examples_marmeAcctsLibControls() marmeAcctsLib.examples_enabledInMailAcctConfig() marmeAcctsLib.examples_enabledOutMailAcctConfig() marmeAcctsLib.examples_select_mailBox() marmeAcctsLib.examples_inMailAcctAccessParsFull() marmeAcctsLib.examples_outMailAcctAccessParsFull() return
def examples_libModuleCmnds(): ####+END: """ ** Auxiliary examples to be commonly used.x2 """ def cpsInit(): return collections.OrderedDict() def menuItemVerbose(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def menuItemTerse(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) ####+BEGIN: bx:icm:python:cmnd:subSection :context "func-1" :title "Prepare Crypto Keyring" """ ** [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] [[elisp:(show-children 10)][|V]] [[elisp:(bx:orgm:indirectBufOther)][|>]] [[elisp:(bx:orgm:indirectBufMain)][|I]] [[elisp:(blee:ppmm:org-mode-toggle)][|N]] [[elisp:(org-top-overview)][|O]] [[elisp:(progn (org-shifttab) (org-content))][|C]] [[elisp:(delete-other-windows)][|1]] *Prepare Crypto Keyring* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Prepare Crypto Keyring*') cmndName = "prepare" def thisBlock(): cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') thisBlock() ####+BEGIN: bx:icm:python:cmnd:subSection :context "func-1" :title "Set Password In Crypto Keyring" """ ** [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] [[elisp:(show-children 10)][|V]] [[elisp:(bx:orgm:indirectBufOther)][|>]] [[elisp:(bx:orgm:indirectBufMain)][|I]] [[elisp:(blee:ppmm:org-mode-toggle)][|N]] [[elisp:(org-top-overview)][|O]] [[elisp:(progn (org-shifttab) (org-content))][|C]] [[elisp:(delete-other-windows)][|1]] *Set Password In Crypto Keyring* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Set Password In Crypto Keyring*') cmndName = "passwdSet" def thisBlock(): cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' cps['passwdPolicy'] = 'prompt' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') thisBlock() def thisBlock(): cmndArgs = "somePasswd" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none') thisBlock() ####+BEGIN: bx:icm:python:cmnd:subSection :context "func-1" :context "func-1" :title "Get Password From Crypto Keyring" """ ** [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] [[elisp:(show-children 10)][|V]] [[elisp:(bx:orgm:indirectBufOther)][|>]] [[elisp:(bx:orgm:indirectBufMain)][|I]] [[elisp:(blee:ppmm:org-mode-toggle)][|N]] [[elisp:(org-top-overview)][|O]] [[elisp:(progn (org-shifttab) (org-content))][|C]] [[elisp:(delete-other-windows)][|1]] *Get Password From Crypto Keyring* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Get Password From Crypto Keyring*') cmndName = "passwdGet" cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' menuItem(verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') ####+BEGIN: bx:icm:python:cmnd:subSection :context "func-1" :context "func-1" :title "Delete Password From Crypto Keyring" """ ** [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] [[elisp:(show-children 10)][|V]] [[elisp:(bx:orgm:indirectBufOther)][|>]] [[elisp:(bx:orgm:indirectBufMain)][|I]] [[elisp:(blee:ppmm:org-mode-toggle)][|N]] [[elisp:(org-top-overview)][|O]] [[elisp:(progn (org-shifttab) (org-content))][|C]] [[elisp:(delete-other-windows)][|1]] *Delete Password From Crypto Keyring* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Delete Password From Crypto Keyring*') cmndName = "passwdDelete" cmndArgs = "" cps = cpsInit() cps['rsrc'] = 'system/sysEx1/userEx1' cps['system'] = 'sysEx1' cps['user'] = '******' menuItem(verbosity='none') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') ####+BEGIN: bx:icm:python:cmnd:subSection :context "func-1" :title "Remain In Sycn With Template" """ ** [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] [[elisp:(show-children 10)][|V]] [[elisp:(bx:orgm:indirectBufOther)][|>]] [[elisp:(bx:orgm:indirectBufMain)][|I]] [[elisp:(blee:ppmm:org-mode-toggle)][|N]] [[elisp:(org-top-overview)][|O]] [[elisp:(progn (org-shifttab) (org-content))][|C]] [[elisp:(delete-other-windows)][|1]] *Remain In Sycn With Template* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: def thisBlock(): icm.cmndExampleMenuChapter('*Remain In Sycn With Template*') templateFile = "/bisos/git/bxRepos/bisos-pip/examples/dev/bisos/examples/icmLibPkgBegin.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)) #thisBlock() return
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 menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr)
def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr)
def menuItemTerse(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='none')
def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little')
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() icm.cmndExampleMenuChapter('*General Dev and Testing CMNDs*') cmndName = "unitTest" cmndArgs = ""; cps = cpsInit(); # cps['icmsPkgName'] = icmsPkgName menuItem() icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*argsProc*') cmndName = "argsProc" ; cmndArgs = "list argOne twoArg arg3" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.cmndExampleMenuChapter('*bashSubProcWithArgs*') cmndName = "bashSubProcWithArgs" ; cmndArgs = "argOne twoArg arg3" ; cps = collections.OrderedDict() ; icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Input and Output Examples CMNDs*') cmndName = "outStreamsExamples" ; cmndArgs = "" ; cps = collections.OrderedDict() ; # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Platform Configuration Paraemters -- Control Bases*') cmndName = "platformConfigsUse" ; cmndArgs = "" ; cps = collections.OrderedDict() ; # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*Other Than ICM Execution Line Examples*') execLineEx("""ls -l""") return(cmndOutcome)