示例#1
0
def builder_inited_handler(app):
    if not app.tags.has('sphinx-problems-rerun'):
        file = missxrefs_file(app)
        dir = os.path.dirname(file)
        filehelpers.ensureDirectory(dir)
        with open(file,'w') as f:
            f.write(NO_REFERENCE_PROBLEM)
示例#2
0
    def build(self):
        ensureDirectory(self.buildDirectory)
        if self.hasSchema:
            # FIXME: called twice, why?
            self.schema.build(self.buildDirectory)
            if self.hasStates:
                for state in self.stateMap.values():
                    state.build(self.buildDirectory)

        # create the schema documentation in case.schema.rst
        if self.schema is not None:
            # FIXME: called twice, why?
            self.schema.build(self.buildDirectory)

        self._buildQuerySets()
示例#3
0
    def build(self):

        # clean the directory if required
        if self.clean:
            filehelpers.ensureEmptyDir(self.targetDir)
        filehelpers.ensureDirectory(self.targetDir)
        # raw_input('cont')

        #------ execute phase #1
        exit_code = self._phase1ExecuteSphinxForNormalDocProduction()
        if debug:
            print('sphinxproblems: Phase #1 terminated with exit code %s' %
                  exit_code)
        if exit_code != 0:
            print('**** ERROR ****: sphinx exit with code %s in phase #1' %
                  exit_code)
            print(' ' * 8 +
                  'errors can be found in "%s"' % self.sphinxErrorsPhase1)
            # raw_input('cont')
            return exit_code
        if not os.path.isfile(self.rawProblemFile):
            if debug:
                print('sphinxproblems: no problems found. no file %s ' %
                      self.rawProblemFile)
            # raw_input('cont')
            return 0
        else:

            #----- execute phase 2
            self._phase2ExtractAndGenerateProblemsDoc()
            # raw_input('cont')

            #----- execute phase 3
            exit_code = self._phase3ExecuteSphinxForProblemDocProduction()
            if exit_code != 0:
                print('**** ERROR ****: sphinx exit with code %s in phase #3' %
                      exit_code)
                print(' ' * 8 +
                      'errors can be found in "%s"' % self.sphinxErrorsPhase3)
                # raw_input('cont')
                return exit_code
            # raw_input('cont')
            #----- execute phase 4
            self._phase4PatchHTMLFiles()
            print(self.shortStatus)
            # raw_input('cont')
            return 0
示例#4
0
 def build(self,
           outputDirectory='schemaspy',
           options='-hq -noads -nologo',
           schemaSpyOutput='/dev/null'):
     filehelpers.ensureDirectory(outputDirectory)
     self.lastCommandOutputFile = os.path.join(outputDirectory,
                                               'schemaspy.out.txt')
     command = '%s -t %s -db %s -sso -o %s %s >>%s' % (
         self.schemaSpyCommand, SCHEMASPY_SQLITE_PROPERTY,
         self.dataBaseFile, outputDirectory, options,
         self.lastCommandOutputFile)
     filehelpers.saveContent(self.lastCommandOutputFile, command + '\n\n')
     self.lastExitCode = os.system(command)
     if self.lastExitCode != 0:
         raise ValueError(
             'SchemaSpy Error: exit code=%s. See %s for details' %
             (self.lastExitCode, self.lastCommandOutputFile))
示例#5
0
    def build(self):
        """
        Build derived artefacts for this case in the build directory.
        :return: None
        """
        ensureDirectory(self.buildDirectory)
        if self.hasSchema:
            # FIXME: called twice, why?
            self.schema.build(self.buildDirectory)
            if self.hasStates:
                for state in self.stateMap.values():
                    state.build(self.buildDirectory)

        # create the schema documentation in case.schema.rst
        if self.schema is not None:
            # FIXME: called twice, why?
            self.schema.build(self.buildDirectory)

        self._buildQuerySets()
示例#6
0
 def build(self,
           outputDirectory='schemaspy',
           options='-hq -noads -nologo',
           schemaSpyOutput='/dev/null'
     ):
     filehelpers.ensureDirectory(outputDirectory)
     self.lastCommandOutputFile = os.path.join(outputDirectory, 'schemaspy.out.txt')
     command = '%s -t %s -db %s -sso -o %s %s >>%s' % (
         self.schemaSpyCommand,
         SCHEMASPY_SQLITE_PROPERTY,
         self.dataBaseFile,
         outputDirectory,
         options,
         self.lastCommandOutputFile
         )
     filehelpers.saveContent(self.lastCommandOutputFile, command+'\n\n')
     self.lastExitCode = os.system(command)
     if self.lastExitCode != 0:
         raise ValueError(
                 'SchemaSpy Error: exit code=%s. See %s for details'
                 % (self.lastExitCode, self.lastCommandOutputFile))
示例#7
0
 def __createStateBuildDirectory():
     states_directory = os.path.join(buildDirectory, 'states')
     ensureDirectory(states_directory)
     self.stateBuildDirectory = os.path.join(states_directory,
                                             self.name)
     ensureDirectory(self.stateBuildDirectory)
示例#8
0
 def __createStateBuildDirectory():
     states_directory = os.path.join(buildDirectory, 'states')
     ensureDirectory(states_directory)
     self.stateBuildDirectory = os.path.join(states_directory, self.name)
     ensureDirectory(self.stateBuildDirectory)