          parser.set_defaults(func=self.process)
  
      def process(self, arguments):
          """ Builds the GUI """
          self.arguments = arguments
          self.utils.debugconsole = self.arguments.debug
          self.root.build_gui()
          self.root.gui.mainloop()
 
</s> remove     def parse_arguments(self, description, subparser, command):
        """ Parse the command line arguments for the GUI """
        parser = subparser.add_parser(
            command,
            help="This Launches a GUI for Faceswap.",
            description=description,
            epilog="Questions and feedback: \
                    https://github.com/deepfakes/faceswap-playground")

        parser.add_argument('-d', '--debug',
                            action='store_true',
                            dest='debug',
                            default=False,
                            help='Output to Shell console instead of GUI console')
        parser.set_defaults(func=self.process)

    def process(self, arguments):
 </s> add     def process(self): </s> remove         ''' Put the arguments in a list so that they are accessible from both argparse and gui '''
        # Override this for custom arguments
 </s> add         """ Put the arguments in a list so that they are accessible from both argparse and gui
            This is used for when there are sub-children (e.g. convert and extract)
            Override this for custom arguments """ </s> remove class TKGui(object):
    """ Main GUI Control """

    def __init__(self, subparser, subparsers, command, description='default'):
 </s> add class Gui(object):
    """ The GUI process. """
    def __init__(self, arguments, subparsers): </s> remove     def process_arguments(self, arguments):
        self.arguments = arguments
        print("Model A Directory: {}".format(self.arguments.input_A))
        print("Model B Directory: {}".format(self.arguments.input_B))
        print("Training data directory: {}".format(self.arguments.model_dir))
 </s> add from lib.utils import get_folder, get_image_paths, set_system_verbosity
from plugins.PluginLoader import PluginLoader </s> remove     @staticmethod
    def get_optional_arguments():
        ''' Put the arguments in a list so that they are accessible from both argparse and gui '''
        # Override this for custom arguments
        argument_list = []
        return argument_list

    def parse_arguments(self, description, subparser, command):
        parser = subparser.add_parser(
            command,
            help="This command trains the model for the two faces A and B.",
            description=description,
            epilog="Questions and feedback: \
            https://github.com/deepfakes/faceswap-playground")

        for option in self.argument_list:
            args = option['opts']
            kwargs = {key: option[key] for key in option.keys() if key != 'opts'}
            parser.add_argument(*args, **kwargs)

        parser = self.add_optional_arguments(parser)
        parser.set_defaults(func=self.process_arguments)

    def add_optional_arguments(self, parser):
        for option in self.optional_arguments:
            args = option['opts']
            kwargs = {key: option[key] for key in option.keys() if key != 'opts'}
            parser.add_argument(*args, **kwargs)
        return parser
 </s> add class Train(object):
    """ The training process.  """
    def __init__(self, arguments):
        self.args = arguments
        self.images = self.get_images()
        self.utils.debugconsole = self.args.debug
          parser.set_defaults(func=self.process)
  
      def process(self, arguments):
          """ Builds the GUI """
        self.utils.debugconsole = self.args.debug
        self.utils.debugconsole = self.args.debug
          self.root.build_gui()
          self.root.gui.mainloop()
keep keep keep keep replace replace keep keep
 cli/scripts Refactor (#367)

* Refactor for PEP 8 and split process function

* Remove backwards compatibility for skip frames

* Split optional functions into own class. Make functions more modular

* Conform scripts folder to PEP 8

* train.py - Fix write image bug. Make more modular

* extract.py - Make more modular, Put optional actions into own class

* cli.py - start PEP 8

* cli,py - Pep 8. Refactor and make modular. Bugfixes

* 1st round refactor. Completely untested and probably broken.

* convert.py: Extract alignments from frames if they don't exist

* BugFix: SkipExisting broken since face name refactor

* Extract.py tested

* Minor formatting

* convert.py + train.py amended not tested

* train.py - Semi-fix for hang on reaching target iteration. Now quits on preview mode
Make tensorflow / system warning less verbose

* 2nd pass refactor. Semi tested

bugfixes

* Remove obsolete code. imread/write to Utils

* rename inout.py to fsmedia.py

* Final bugfixes 
scripts/gui.py