Changeset 7709

Show
Ignore:
Timestamp:
05/31/08 19:22:37 (5 years ago)
Author:
stedwar2
Message:

Redesigned the wavedev.cfg parsing code to be in a separate
module and to allow overrides from Eclipse. Removed extraneous
dependencies on wavedev.cfg parsing.

Location:
ossiedev/branches/jsnyder/ComponentProject
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/jsnyder/ComponentProject/PythonSrc/MainFrameGlue.py

    r7705 r7709  
    3838import string 
    3939import ComponentClass as CC 
    40  
     40import cfg 
    4141 
    4242class MainFrameTreeNode: 
     
    6767        self.stdIdlPath = "/usr/local/include/standardinterfaces/" 
    6868        self.customIdlPath = "/usr/local/include/custominterfaces/" 
     69        self.Available_Ints = [] 
    6970 
    7071 
     
    161162 
    162163 
    163     def setOssieInstallPath(self, path): 
    164         self.installPath = self.pathWithSlash(path) 
     164    def pathWithoutSlash(self, path): 
     165        length = len(path) 
     166        if length > 0 and path[length - 1] == '/': 
     167            path = path[0:length - 1] 
     168        return path 
    165169 
    166170 
     
    181185    def setOssieInstallPath(self, path): 
    182186        self.installPath = self.pathWithSlash(path) 
     187        cfg.overrideCfgValue('installpath', self.pathWithoutSlash(path)) 
    183188 
    184189 
     
    187192 
    188193 
    189     def setIncludePath(self, newOssieIncludePath): 
    190         self.ossieIncludePath = newOssieIncludePath 
    191  
    192  
    193     def setStandardIdlPath(self, newStdIdlPath): 
    194         self.stdIdlPath = newStdIdlPath 
    195  
    196  
    197     def setCstmIdlPath(self, newCustomIdlPath): 
    198         self.customIdlPath = newCustomIdlPath 
     194    def setIncludePath(self, path): 
     195        self.ossieIncludePath = path 
     196        cfg.setCfgValueIfNecessary('ossieincludepath', 
     197                                   self.pathWithoutSlash(path)) 
     198 
     199 
     200    def setStandardIdlPath(self, path): 
     201        self.stdIdlPath = path 
     202        cfg.setCfgValueIfNecessary('stdidlpath', self.pathWithoutSlash(path)) 
     203 
     204 
     205    def setCstmIdlPath(self, path): 
     206        self.customIdlPath = path 
    199207 
    200208 
     
    326334 
    327335    def importStandardIDL(self): 
    328         print "0" 
    329336        '''Imports IDL from cf, standardinterfaces, and custominterfaces''' 
     337 
     338        # If we've computed this value before, just reuse it 
     339        if len(self.Available_Ints) > 0: 
     340            return MainFrameTreeNode('Interfaces', self.Available_Ints) 
     341 
    330342        #temporarily change self.parent to self so this works 
    331343        #normally this function looks at the MainFrame - but not in standalone 
    332         print "1" 
    333         self.Available_Ints = [] 
    334344        self.parent = self 
    335345        changedParent = True 
     
    343353            tmpstr += self.ossieIncludePath 
    344354            errorMsg(self,tmpstr) 
    345         print 2 
     355 
    346356        # for each file in the standardinterfaces directory, import all available 
    347357        # interfaces (skip standardIdl files) 
     
    354364                        # as a result of customInterfaces not being found 
    355365            custom_idl_list = [] 
    356         print 3 
     366 
    357367        if len(standard_idl_list) <= 0: 
    358368            tmpstr = "Can't find any files in: " + self.stdIdlPath 
     
    378388                if t not in self.Available_Ints: 
    379389                    self.Available_Ints.append(t) 
    380         print 4 
     390 
    381391        # import custom interfaces 
    382392        for custom_idl_file in custom_idl_list: 
     
    398408                        self.timing_port = CC.Port('send_timing_report', self.timing_interface, "Uses", "data") 
    399409#                    print "CF.py: " + t.name + "  " + str(len(t.operations)) 
    400         print 5 
    401410        if changedParent == True: 
    402411            self.parent = None 
    403412        print self.Available_Ints 
    404         return MainFrameTreeNode("Interfaces", self.Available_Ints) 
     413        return MainFrameTreeNode('Interfaces', self.Available_Ints) 
    405414 
    406415 
  • ossiedev/branches/jsnyder/ComponentProject/WaveDev/wavedev/XML_gen/application_gen.py

    r7681 r7709  
    3030 
    3131 
    32 try: 
    33     doc_cfg = xml.dom.minidom.parse('../wavedev.cfg') 
    34 except:   #if  not being called from wavedev, try looking for the file 
    35     doc_cfg = xml.dom.minidom.parse('/sdr/tools/WaveDev/wavedev.cfg') 
    36  
    37  
    38 version = str(doc_cfg.getElementsByTagName("version")[0].firstChild.data) 
    39  
    40 #vtext = open('../version.txt') 
    41 #version = unicode(vtext.readline()) 
    42 #version = version.strip('\n') 
    43 commentLine = u'<!--Created with OSSIE WaveDev ' + version \ 
    44     + u'-->\n<!--Powered by Python-->\n' 
    45  
    46  
    4732xmlpath = u'/xml/' 
    4833####################################################################### 
     
    198183            devFlag = False 
    199184 
    200             print "Processing connection : " 
    201             print "  component name  : " + cname 
    202             print "  local comp type : " + n.type 
    203             print "  local port type : " + i.localPort.type 
    204             print "  local port name : " + unicode(i.localPort.name) 
    205             print "  remote comp type: " + i.remoteComp.type 
    206             print "  remote port type: " + i.remotePort.type 
    207             print "  remote port name: " + unicode(i.remotePort.name) 
     185#            print "Processing connection : " 
     186#            print "  component name  : " + cname 
     187#            print "  local comp type : " + n.type 
     188#            print "  local port type : " + i.localPort.type 
     189#            print "  local port name : " + unicode(i.localPort.name) 
     190#            print "  remote comp type: " + i.remoteComp.type 
     191#            print "  remote port type: " + i.remotePort.type 
     192#            print "  remote port name: " + unicode(i.remotePort.name) 
    208193 
    209194            if i.localPort.type == 'Uses': 
  • ossiedev/branches/jsnyder/ComponentProject/WaveDev/wavedev/XML_gen/component_gen.py

    r7681 r7709  
    2626from WaveDev.wavedev.uuidgen import uuidgen 
    2727 
    28 #import xmlBeautify 
    29  
    30  
    31 try: 
    32    doc_cfg = xml.dom.minidom.parse('../wavedev.cfg') 
    33 except:  #if not being called from wavedev, try looking for wavedev 
    34    doc_cfg = xml.dom.minidom.parse('/sdr/tools/WaveDev/wavedev.cfg') 
    35  
    36 version = str(doc_cfg.getElementsByTagName("version")[0].firstChild.data) 
    37  
    38 #vtext = open('../version.txt') 
    39 #version = unicode(vtext.readline()) 
    40 #version = version.strip('\n') 
    41 commentLine = u'<!--Created with OSSIE WaveDev ' + version \ 
    42     + u'-->\n<!--Powered by Python-->\n' 
    4328 
    4429xmlpath = u'xml/'