Esempio n. 1
0
    def cmnd(self,
        interactive=False,        # Can also be called non-interactively
        argsList=[],         # or Args-Input
    ):
        cmndOutcome = self.getOpOutcome()
        if interactive:
            if not self.cmndLineValidate(outcome=cmndOutcome):
                return cmndOutcome
            effectiveArgsList = G.icmRunArgsGet().cmndArgs
        else:
            effectiveArgsList = argsList

        callParamsDict = {}
        if not icm.cmndCallParamsValidate(callParamsDict, interactive, outcome=cmndOutcome):
            return cmndOutcome

        cmndArgsSpecDict = self.cmndArgsSpec()
        if not self.cmndArgsValidate(effectiveArgsList, cmndArgsSpecDict, outcome=cmndOutcome):
            return cmndOutcome
####+END:
        
        fileSysPath = effectiveArgsList[0]

        thisFileTree = icm.FILE_TreeObject(fileSysPath=fileSysPath)
    
        if thisFileTree == None:
            return icm.EH_critical_usageError('')

        opResults = thisFileTree.leafCreate()

        return cmndOutcome.set(
            opError=icm.OpError.Success,
            opResults=opResults,
        )
Esempio n. 2
0
def withSlideNumberGetFrameName(
    slideNu,
    dispositionBase=None,
):
####+END: 
    """ Should go in beamerDisposition.py"""
    if not dispositionBase:
        dispositionBase = "./disposition.gened"

    #filesList = os.listdir(dispositionBase)  # This is instead of sorting

    this = format("slide" + str(slideNu))       
    frameFileParam = icm.FILE_Param()
    frameFileParam = frameFileParam.readFrom(storeBase=dispositionBase, parName=this)

    if frameFileParam == None:
        return icm.EH_critical_usageError('frameFileParam')

    thisLabeled = frameFileParam.parValueGet()
    thisLabeledBase = os.path.join(dispositionBase, thisLabeled)

    return thisLabeled