          setattr(namespace, self.dest, os.path.abspath(
              os.path.expanduser(values)))
  
  class FullHelpArgumentParser(argparse.ArgumentParser):
      """
      Identical to the built-in argument parser, but on error
      it prints full help message instead of just usage information
      """
      def error(self, message):
          self.print_help(sys.stderr)
          args = {'prog': self.prog, 'message': message}
          self.exit(2, '%(prog)s: error: %(message)s\n' % args)
  
 
</s> remove         args = {'prog': self.prog, 'message': message}
        self.exit(2, '%(prog)s: error: %(message)s\n' % args)

class DirectoryProcessor(object):
    '''
    Abstract class that processes a directory of images
    and writes output to the specified folder
    '''
    arguments = None
    parser = None

    input_dir = None
    output_dir = None

    images_found = 0
    num_faces_detected = 0
    faces_detected = dict()
    verify_output = False
    rotation_angles = None

    def __init__(self, subparser, command, description='default'):
 </s> add         args = {"prog": self.prog, "message": message}
        self.exit(2, "%(prog)s: error: %(message)s\n" % args)

class FaceSwapArgs(object):
    """ Faceswap argument parser functions that are universal
        to all commands. Should be the parent function of all
        subsequent argparsers """
    def __init__(self, subparser, command, description="default", subparsers=None): </s> remove def import_FaceFilter():
    ''' Import the FaceFilter module only when it is required '''
    global FaceFilter
    if FaceFilter is None:
        import lib.FaceFilter
        FaceFilter = lib.FaceFilter.FaceFilter
 </s> add     def execute_script(self, arguments):
        """ Run the script for called command """
        script = self.import_script()
        args = (arguments, ) if self.command != 'gui' else (arguments, self.subparsers)
        process = script(*args)
        process.process() </s> remove     # for now, we limit this class responsability to the read of files. images and faces are processed outside this class
    def process(self):
        # implement your image processing!
        raise NotImplementedError()
 </s> add class ConvertArgs(ExtractConvertArgs):
    """ Class to parse the command line arguments for conversion.
        Inherits base options from ExtractConvertArgs where arguments
        that are used for both extract and convert should be placed """ </s> remove             self.num_faces_detected += 1
            faces_count += 1
 </s> add         Arguments that can be used in both of these processes should be
        placed here, but no further processing should be done. This class
        just captures arguments """ </s> remove     parser.print_help()
 </s> add     """ Print help on bad arguments """
    PARSER.print_help()
    """ Identical to the built-in argument parser, but on error it
        prints full help message instead of just usage information """
          setattr(namespace, self.dest, os.path.abspath(
              os.path.expanduser(values)))
  
  class FullHelpArgumentParser(argparse.ArgumentParser):
    """ Identical to the built-in argument parser, but on error it
        prints full help message instead of just usage information """
    """ Identical to the built-in argument parser, but on error it
        prints full help message instead of just usage information """
    """ Identical to the built-in argument parser, but on error it
        prints full help message instead of just usage information """
    """ Identical to the built-in argument parser, but on error it
        prints full help message instead of just usage information """
      def error(self, message):
          self.print_help(sys.stderr)
          args = {'prog': self.prog, 'message': message}
          self.exit(2, '%(prog)s: error: %(message)s\n' % args)
  
keep keep keep keep replace replace replace replace keep keep keep 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 
lib/cli.py