Exemple #1
0
    def __createDatabaseScripts(self):
        s = PlatformProperty.FileSep

        objectScripts = [
            'dblinks.sql', 'synonyms.sql', 'sequences.sql', 'types.sql',
            'queues.sql', 'tables.sql', 'triggers.sql', 'views.sql',
            'indexes.sql', 'constraints_ck.sql', 'constraints_pk.sql',
            'constraints_uk.sql', 'constraints_fk.sql'
        ]
        dataScripts = ['seed.sql']

        for obj in objectScripts:
            FileUtils.touchFile(self.ProjectBaseDir + 'app' + s + 'database' +
                                s + 'ddl' + s + 'objects' + s + obj)

        for data in dataScripts:
            FileUtils.touchFile(self.ProjectBaseDir + 'app' + s + 'database' +
                                s + 'data' + s + data)

        FileUtils.copyFile(
            self.TemplateDir + 'config' + s + 'database-userInfo.tpl',
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_info.ini')
        FileUtils.copyFile(
            self.TemplateDir + 'config' + s + 'database-userPrivs.tpl',
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_privs.ini')
        # REPLACE TOKENS IN INFO FILE
        iniFile = open(
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_info.ini', 'r')
        fileContents = iniFile.read()
        iniFile.close()
        fileContents = fileContents.replace('{{APPNAME}}',
                                            self.AppName.upper())
        iniFile = open(
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_info.ini', 'w')
        iniFile.write(fileContents)
        iniFile.close()
        # REPLACE TOKENS IN PRIV FILE
        iniFile = open(
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_privs.ini', 'r')
        fileContents = iniFile.read()
        iniFile.close()
        fileContents = fileContents.replace('{{APPNAME}}',
                                            self.AppName.upper())
        iniFile = open(
            self.ProjectBaseDir + 'app' + s + 'database' + s + 'user' + s +
            'user_privs.ini', 'w')
        iniFile.write(fileContents)
        iniFile.close()
Exemple #2
0
 def __buildTestFiles(self):
     fsep = PlatformProperty.FileSep
     modTestDir = self.ProjectBaseDir+'test'+fsep+'app'+fsep+'modules'+fsep+self.ModuleName+fsep
     FileUtils.createDir(modTestDir)
     FileUtils.touchFile(modTestDir+'test_'+self.ModuleName+'.py')
     FileUtils.touchFile(modTestDir+'test_'+self.ModuleName+'_controllers.py')
     FileUtils.touchFile(modTestDir+'test_'+self.ModuleName+'_services.py')