Ejemplo n.º 1
0
 def __init__(self):
     g = globals.getInstance()
     
     
     self.ext = 'EXT'
     self.file = g.ueditFileName
     
     self.globalEdit = 'GLOBALEDIT'
     
     if (not os.path.isfile(self.file)):
         tmpFile = open(self.file, "w")
         tmpFile.close()
         pass        
     self.config = ConfigParser.ConfigParser()
     self.config.readfp(open(self.file, 'r'))
     
     if not self.config.has_section(self.ext):
         self.config.add_section(self.ext)
         self.config.write(open(self.file, "w"))
     
     pass
Ejemplo n.º 2
0
    def makeInstallTool(self, name, force = False):
        g = globals.getInstance()
        srcPaths = g.cfgData.installSourcePath
        dstPath = 'Tool\\'
        
        dstDir = dstPath + name
        srcDir = None
        for src in (srcPaths):
            src = src + name
            if (os.path.isdir(src)):
                srcDir = src

        if not os.path.isdir(dstPath):
            os.makedirs(dstPath)
  
        if os.path.isdir(dstDir) and force != True:
            return True

        if srcDir == None:
            return False

        if force == False:
            dlg = self.frame.createDialog('Install', 15 + len(name))
            dlg.createStatic('install "' + name + '", OK?')
            dlg.createOkCancel()
            if dlg.show() == True:
                shutil.copytree(srcDir, dstDir)
                dlg.destroy()
                return True
            else:
                dlg.destroy()
                return False
        else:
            shutil.rmtree(dstDir)
            shutil.copytree(srcDir, dstDir)
            return True