      def check_display(command):
          """ Check whether there is a display to output the GUI. If running on
              Windows then assume not running in headless mode """
          if not os.environ.get('DISPLAY', None) and os.name != 'nt':
              if 'gui' in command:
                  print('Could not detect a display. The GUI has been disabled.')
                  if os.name == 'posix':
                      print('macOS users need to install XQuartz. '
                            'See https://support.apple.com/en-gb/HT201341')
              return False
          return True
  
      @staticmethod
      def check_tkinter_available(command):
 
</s> remove     def check_display(command):
 </s> add     def check_display(): </s> remove         self.parse_arguments(description, subparser, command)
 </s> add  </s> remove     def check_tkinter_available(command):
 </s> add     def check_tkinter_available(): </s> remove             if "gui" in command:
                print(
                    "It looks like TkInter isn't installed for your OS, so "
                    "the GUI has been "
                    "disabled. To enable the GUI please install the TkInter "
                    "application.\n"
                    "You can try:\n"
                    "  Windows/macOS:      Install ActiveTcl Community "
                    "Edition from "
                    "www.activestate.com\n"
                    "  Ubuntu/Mint/Debian: sudo apt install python3-tk\n"
                    "  Arch:               sudo pacman -S tk\n"
                    "  CentOS/Redhat:      sudo yum install tkinter\n"
                    "  Fedora:             sudo dnf install python3-tkinter\n",
                    file=sys.stderr)
 </s> add             print(
                "It looks like TkInter isn't installed for your OS, so "
                "the GUI has been "
                "disabled. To enable the GUI please install the TkInter "
                "application.\n"
                "You can try:\n"
                "  Windows/macOS:      Install ActiveTcl Community "
                "Edition from "
                "www.activestate.com\n"
                "  Ubuntu/Mint/Debian: sudo apt install python3-tk\n"
                "  Arch:               sudo pacman -S tk\n"
                "  CentOS/Redhat:      sudo yum install tkinter\n"
                "  Fedora:             sudo dnf install python3-tkinter\n",
                file=sys.stderr) </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):
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
      def check_display(command):
          """ Check whether there is a display to output the GUI. If running on
              Windows then assume not running in headless mode """
          if not os.environ.get('DISPLAY', None) and os.name != 'nt':
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
              return False
          return True
  
      @staticmethod
      def check_tkinter_available(command):
keep keep keep keep replace 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 
scripts/gui.py