doxyth/gendoc.py
def flow(self, args):
        """
        ### &doc_id gendoc:flow

        This is the main flow function of the class.

        Allows to easily dispatch all the tasks to smaller functions.
        """

        self.available_translations = []
        self.langs = {}

        if args.version:
            try:
                from .version import version as doxythversion
                doxythversion = 'v' + doxythversion
            except (FileNotFoundError, ModuleNotFoundError):
                doxythversion = '<unknown version>.' \
                                '\nThe version file_name is missing, you should reinstall DoxyTH to fix this.'
            print(f"DoxyTH {doxythversion}")
            exit(0)

        if args.listpostprocesses:
            print(f"Available postprocess(es): {', '.join(available_postprocesses)}")
            exit(0)

        self.docs_output_path = args.output if args.output else 'docs'

        if args.verify:
            verify_full_directory(args.translation_dir)
            exit(0)

        else:
            self.delegate_setup_args(args)

            self.analyze_translations_dir(self.translations_dir)

            if not self.available_translations:
                print("No applicable translation detected. Aborting.")
                exit(0)

            # Read all the languages docs
            for lang in self.available_translations:
                if self.verbose:
                    print(f"{lang.upper()}: Reading docs... ", end="")
                self.langs[lang] = self.read_docs(f"{args.translation_dir}/{lang}", args.nofileprefix)

            # write translations into a json file_name so the doxyth executable can fetch translations quickly
            self.write_config()

            # Edit or create doxygen config
            self.setup_doxygen_files(args.translation_dir, args.doxyfile)

            # Create the main directory if not existing
            if not exists(abspath(self.docs_output_path)):
                os.mkdir(self.docs_output_path)

            # Change Doxyfile and run doxygen for it to directly analyse files modified by the script using
            # FILE_PATTERNS
            if args.skipgen:
                print("Skipping Doxygen generation.")
            else:
                for lang in self.available_translations:
                    if self.verbose:
                        print(f"Generating doc for {lang.upper()}... ", end="")
                    self.adapt_configs_to_lang(lang)

                    # Creating the language directory if not existing
                    if not exists(abspath(f'{self.docs_output_path}/{lang}')):
                        os.mkdir(f'{self.docs_output_path}/{lang}')

                    fnull = open(os.devnull, 'w')
                    if self.debug:
                        code = subprocess.call(['doxygen', doxygen_file_name])
                    elif self.doxymute:
                        code = subprocess.call(['doxygen', doxygen_file_name], stderr=fnull, stdout=fnull)
                    else:
                        code = subprocess.call(['doxygen', doxygen_file_name], stderr=stdout, stdout=fnull)
                    fnull.close()

                    if self.verbose:
                        if code:
                            print('ERROR')
                        else:
                            print("OK")

            # now creating the language selection file_name into the output directory
            self.delegate_create_lang_selection_file()

            # CLEANUP
            if not args.nocleanup:
                self.cleanup()
            else:
                print("Skipping cleanup.")

        ### &doc_id gendoc:flow

        This is the main flow function of the class.

        Allows to easily dispatch all the tasks to smaller functions.
        
&doc_id gendoc:flow
This is the main flow function of the class.

Allows to easily dispatch all the tasks to smaller functions.
&doc_id gendoc : flow This is the main flow function of the class . Allows to easily dispatch all the tasks to smaller functions .
def flow(self, args):
        self.available_translations = []
        self.langs = {}
        if args.version:
            try:
                from .version import version as doxythversion
                doxythversion = 'v' + doxythversion
            except (FileNotFoundError, ModuleNotFoundError):
                doxythversion = '<unknown version>.' \
                                '\nThe version file_name is missing, you should reinstall DoxyTH to fix this.'
            print(f"DoxyTH {doxythversion}")
            exit(0)
        if args.listpostprocesses:
            print(f"Available postprocess(es): {', '.join(available_postprocesses)}")
            exit(0)
        self.docs_output_path = args.output if args.output else 'docs'
        if args.verify:
            verify_full_directory(args.translation_dir)
            exit(0)
        else:
            self.delegate_setup_args(args)
            self.analyze_translations_dir(self.translations_dir)
            if not self.available_translations:
                print("No applicable translation detected. Aborting.")
                exit(0)
            for lang in self.available_translations:
                if self.verbose:
                    print(f"{lang.upper()}: Reading docs... ", end="")
                self.langs[lang] = self.read_docs(f"{args.translation_dir}/{lang}", args.nofileprefix)
            self.write_config()
            self.setup_doxygen_files(args.translation_dir, args.doxyfile)
            if not exists(abspath(self.docs_output_path)):
                os.mkdir(self.docs_output_path)
            if args.skipgen:
                print("Skipping Doxygen generation.")
            else:
                for lang in self.available_translations:
                    if self.verbose:
                        print(f"Generating doc for {lang.upper()}... ", end="")
                    self.adapt_configs_to_lang(lang)
                    if not exists(abspath(f'{self.docs_output_path}/{lang}')):
                        os.mkdir(f'{self.docs_output_path}/{lang}')
                    fnull = open(os.devnull, 'w')
                    if self.debug:
                        code = subprocess.call(['doxygen', doxygen_file_name])
                    elif self.doxymute:
                        code = subprocess.call(['doxygen', doxygen_file_name], stderr=fnull, stdout=fnull)
                    else:
                        code = subprocess.call(['doxygen', doxygen_file_name], stderr=stdout, stdout=fnull)
                    fnull.close()
                    if self.verbose:
                        if code:
                            print('ERROR')
                        else:
                            print("OK")
            self.delegate_create_lang_selection_file()
            if not args.nocleanup:
                self.cleanup()
            else:
                print("Skipping cleanup.")
def flow ( self , args ) : self . available_translations = [ ] self . langs = { } if args . version : try : from . version import version as doxythversion doxythversion = 'v' + doxythversion except ( FileNotFoundError , ModuleNotFoundError ) : doxythversion = '<unknown version>.' '\nThe version file_name is missing, you should reinstall DoxyTH to fix this.' print ( f"DoxyTH {doxythversion}" ) exit ( 0 ) if args . listpostprocesses : print ( f"Available postprocess(es): {', '.join(available_postprocesses)}" ) exit ( 0 ) self . docs_output_path = args . output if args . output else 'docs' if args . verify : verify_full_directory ( args . translation_dir ) exit ( 0 ) else : self . delegate_setup_args ( args ) self . analyze_translations_dir ( self . translations_dir ) if not self . available_translations : print ( "No applicable translation detected. Aborting." ) exit ( 0 ) for lang in self . available_translations : if self . verbose : print ( f"{lang.upper()}: Reading docs... " , end = "" ) self . langs [ lang ] = self . read_docs ( f"{args.translation_dir}/{lang}" , args . nofileprefix ) self . write_config ( ) self . setup_doxygen_files ( args . translation_dir , args . doxyfile ) if not exists ( abspath ( self . docs_output_path ) ) : os . mkdir ( self . docs_output_path ) if args . skipgen : print ( "Skipping Doxygen generation." ) else : for lang in self . available_translations : if self . verbose : print ( f"Generating doc for {lang.upper()}... " , end = "" ) self . adapt_configs_to_lang ( lang ) if not exists ( abspath ( f'{self.docs_output_path}/{lang}' ) ) : os . mkdir ( f'{self.docs_output_path}/{lang}' ) fnull = open ( os . devnull , 'w' ) if self . debug : code = subprocess . call ( [ 'doxygen' , doxygen_file_name ] ) elif self . doxymute : code = subprocess . call ( [ 'doxygen' , doxygen_file_name ] , stderr = fnull , stdout = fnull ) else : code = subprocess . call ( [ 'doxygen' , doxygen_file_name ] , stderr = stdout , stdout = fnull ) fnull . close ( ) if self . verbose : if code : print ( 'ERROR' ) else : print ( "OK" ) self . delegate_create_lang_selection_file ( ) if not args . nocleanup : self . cleanup ( ) else : print ( "Skipping cleanup." )
&doc_id gendoc:flow
This is the main flow function of the class.
&doc_id gendoc : flow This is the main flow function of the class .
"""
        ### &doc_id gendoc:flow

        This is the main flow function of the class.

        Allows to easily dispatch all the tasks to smaller functions.
        """ # Read all the languages docs # write translations into a json file_name so the doxyth executable can fetch translations quickly # Edit or create doxygen config # Create the main directory if not existing # Change Doxyfile and run doxygen for it to directly analyse files modified by the script using # FILE_PATTERNS # Creating the language directory if not existing # now creating the language selection file_name into the output directory # CLEANUP
self
args