def __init__(self):
     self.__command = {}
     self.__applicationCommand = {}
     # Application Command
     self.__applicationCommand['Open'] = self.openFile
     self.__applicationCommand['Close'] = self.closeFile
     self.__applicationCommand['New'] = self.newDoc
     self.__applicationCommand['Documents'] = self.showDocuments
     self.__applicationCommand['CreateStyle'] = self.createStyle
     self.__applicationCommand['SetActive'] = self.setActiveDoc
     self.__applicationCommand['GetActive'] = self.getActiveDoc
     self.__applicationCommand['GetEnts'] = self.getEnts
     self.__applicationCommand['Esc'] = self.endApplication
     self.__applicationCommand['?'] = self.printHelp
     self.__applicationCommand['Test'] = self.featureTest
     self.__applicationCommand['ETest'] = self.easyTest
     # Document Commandf
     self.__pyCadApplication = Application()
     for command in self.__pyCadApplication.getCommandList():
         self.__command[command] = self.performCommand
Example #2
0
 def __init__(self):
     self.__command={}
     self.__applicationCommand={}
     # Application Command
     self.__applicationCommand['Open']=self.openFile
     self.__applicationCommand['Close']=self.closeFile
     self.__applicationCommand['New']=self.newDoc
     self.__applicationCommand['Documents']=self.showDocuments
     self.__applicationCommand['CreateStyle']=self.createStyle
     self.__applicationCommand['SetActive']=self.setActiveDoc
     self.__applicationCommand['GetActive']=self.getActiveDoc
     self.__applicationCommand['GetEnts']=self.getEnts
     self.__applicationCommand['Esc']=self.endApplication
     self.__applicationCommand['?']=self.printHelp
     self.__applicationCommand['Test']=self.featureTest
     self.__applicationCommand['ETest']=self.easyTest
     # Document Commandf
     self.__pyCadApplication=Application()
     for command in self.__pyCadApplication.getCommandList():
         self.__command[command]=self.performCommand
Example #3
0
class textApplication(object):
    def __init__(self):
        self.__command={}
        self.__applicationCommand={}
        # Application Command
        self.__applicationCommand['Open']=self.openFile
        self.__applicationCommand['Close']=self.closeFile
        self.__applicationCommand['New']=self.newDoc
        self.__applicationCommand['Documents']=self.showDocuments
        self.__applicationCommand['CreateStyle']=self.createStyle
        self.__applicationCommand['SetActive']=self.setActiveDoc
        self.__applicationCommand['GetActive']=self.getActiveDoc
        self.__applicationCommand['GetEnts']=self.getEnts
        self.__applicationCommand['Esc']=self.endApplication
        self.__applicationCommand['?']=self.printHelp
        self.__applicationCommand['Test']=self.featureTest
        self.__applicationCommand['ETest']=self.easyTest
        # Document Commandf
        self.__pyCadApplication=Application()
        for command in self.__pyCadApplication.getCommandList():
            self.__command[command]=self.performCommand

    def mainLoop(self):
        """
            mainLoop operation
        """
        while 1:
            imputstr=self.inputMsg("Insert a command (? for Help)")
            try:
                if self.__command.has_key(imputstr):
                    self.__command[imputstr](imputstr)
                elif self.__applicationCommand.has_key(imputstr):
                    self.__applicationCommand[imputstr]()
                else:
                    self.outputMsg("Wrong Command !!")
            except EntityMissing, err:
                self.outputMsg("Application Error %s "%str(err))
class textApplication(object):
    def __init__(self):
        self.__command = {}
        self.__applicationCommand = {}
        # Application Command
        self.__applicationCommand['Open'] = self.openFile
        self.__applicationCommand['Close'] = self.closeFile
        self.__applicationCommand['New'] = self.newDoc
        self.__applicationCommand['Documents'] = self.showDocuments
        self.__applicationCommand['CreateStyle'] = self.createStyle
        self.__applicationCommand['SetActive'] = self.setActiveDoc
        self.__applicationCommand['GetActive'] = self.getActiveDoc
        self.__applicationCommand['GetEnts'] = self.getEnts
        self.__applicationCommand['Esc'] = self.endApplication
        self.__applicationCommand['?'] = self.printHelp
        self.__applicationCommand['Test'] = self.featureTest
        self.__applicationCommand['ETest'] = self.easyTest
        # Document Commandf
        self.__pyCadApplication = Application()
        for command in self.__pyCadApplication.getCommandList():
            self.__command[command] = self.performCommand

    def mainLoop(self):
        """
            mainLoop operation
        """
        while 1:
            imputstr = self.inputMsg("Insert a command (? for Help)")
            try:
                if self.__command.has_key(imputstr):
                    self.__command[imputstr](imputstr)
                elif self.__applicationCommand.has_key(imputstr):
                    self.__applicationCommand[imputstr]()
                else:
                    self.outputMsg("Wrong Command !!")
            except EntityMissing, err:
                self.outputMsg("Application Error %s " % str(err))