          ''' Build the info text section page '''
          statusframe = tk.Frame(frame)
          statusframe.pack(side=tk.BOTTOM, pady=(5,0))
          
          lbl_title = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
          lbl_title.pack(side=tk.TOP)
          self.statustext.set('Idle')
          lbl_status = tk.Label(statusframe, height=1, width=15, textvariable=self.statustext,  wraplength=120, justify=tk.LEFT, anchor=tk.NW, bg="gray90")
          lbl_status.pack(side=tk.BOTTOM, anchor=tk.N)
  
      def execute_script(self, command):
          
          optlist = ['faceswap.py', command]
          for item in self.opts[command]:
              opt_value = str(item.get('value','').get())
              opt = item['opts'][0]
 
</s> remove         statusframe.pack(side=tk.BOTTOM, pady=(5,0))
 </s> add         statusframe.pack(side=tk.TOP, pady=(5,0)) </s> remove         helpframe=tk.Frame(frame)
        helpframe.pack(fill=tk.X, side=tk.TOP, pady=5)
        lbl_title = tk.Label(helpframe, text='Info', width=15, anchor=tk.SW)
        lbl_title.pack(side=tk.TOP)
        self.helptext.set('')
        lbl_help = tk.Label(helpframe, height=20, width=15, textvariable=self.helptext,  wraplength=120, justify=tk.LEFT, anchor=tk.NW, bg="gray90")
        lbl_help.pack(side=tk.BOTTOM, anchor=tk.N)

    def bind_help(self, control, helptext):
        ''' Controls the help text displayed on mouse hover '''
        control.bind('<Enter>', lambda event: self.helptext.set(helptext))
        control.bind('<FocusIn>', lambda event: self.helptext.set(helptext))
        control.bind('<Leave>', lambda event: self.helptext.set(''))
        control.bind('<FocusOut>', lambda event: self.helptext.set(''))

    def add_action_buttons(self, frame, title):
 </s> add         hlpframe=tk.Frame(frame)
        hlpframe.pack(fill=tk.X, side=tk.TOP, pady=5)
        lbltitle = tk.Label(hlpframe, text='Info', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.helptext.set('')
        lblhelp = tk.Label( hlpframe,
                            height=20,
                            width=15,
                            textvariable=self.gui.helptext,
                            wraplength=120, 
                            justify=tk.LEFT, 
                            anchor=tk.NW,
                            bg="gray90")
        lblhelp.pack(side=tk.TOP, anchor=tk.N)

    def add_action_buttons(self, frame): </s> remove         optlist = ['faceswap.py', command]
        for item in self.opts[command]:
            opt_value = str(item.get('value','').get())
            opt = item['opts'][0]
            if opt_value == 'False' or opt_value == '':
                continue
            elif opt_value == 'True':
                optlist.append(opt)
            else:
                optlist.extend((opt, opt_value))
        sys.argv = optlist
        process = Thread(target=self.launch_thread, args=(command,))
        process.start()

    def launch_thread(self, command):
        ''' Launch the script inside a subprocess to keep the GUI active '''
        title = command.capitalize()
        self.statustext.set('Running - {}'.format(title))
        self.parser.set_defaults(func=self.bad_args)
        arguments = self.parser.parse_args()
        arguments.func(arguments)
        self.statustext.set('Idle')
 </s> add         for option in self.gui.opts[self.command]:
            self.build_tabs(option, opt_frame) </s> remove         command = title.lower()
        title = title.capitalize()

        utilframe = tk.Frame(frame)
        utilframe.pack(side=tk.TOP, pady=(5,0))

        btnload = tk.Button(utilframe, image=self.icofile, height=16, width=16, command=lambda: self.load_config(command))
        btnload.pack(padx=2, pady=2, side=tk.LEFT)
        self.bind_help(btnload, 'Load existing {} config'.format(title))

        btnsave = tk.Button(utilframe, image=self.icosave, height=16, width=16, command=lambda: self.save_config(command))
        btnsave.pack(padx=2, pady=2, side=tk.LEFT)
        self.bind_help(btnsave, 'Save {} config'.format(title))

        btnreset = tk.Button(utilframe, image=self.icoreset, height=16, width=16, command=lambda: self.reset_config(command))
        btnreset.pack(padx=2, pady=2, side=tk.RIGHT)
        self.bind_help(btnreset, 'Reset {} config to default'.format(title))

        btnclear = tk.Button(utilframe, image=self.icoclear, height=16, width=16, command=lambda: self.clear_config(command))
        btnclear.pack(padx=2, pady=2, side=tk.RIGHT)
        self.bind_help(btnclear, 'Clear all entries for {} config'.format(title))
 </s> add         utlframe = tk.Frame(frame)
        utlframe.pack(side=tk.TOP, pady=(5,0))

        for utl in ('load', 'save', 'clear', 'reset'):
            img = getattr(self.gui, 'ico' + utl)
            action = getattr(self.gui, utl + '_config')
            btnutl = tk.Button( utlframe,
                                height=16,
                                width=16,
                                image=img,
                                command=lambda cmd=action: cmd(self.command))
            btnutl.pack(padx=2, pady=2, side=tk.LEFT)
            self.gui.bind_help(btnutl, utl.capitalize() + ' ' + self.title + ' config') </s> remove         topframe = tk.Frame(frame)
        topframe.pack(fill=tk.X, side=tk.TOP)
        bottomframe = tk.Frame(frame)
        bottomframe.pack(fill=tk.X, side=tk.BOTTOM)
        self.add_info_section(topframe)
        self.add_action_buttons(topframe, title)
        self.add_util_buttons(bottomframe, title)
        self.add_status_section(bottomframe)
 </s> add         self.add_info_section(frame)
        self.add_action_buttons(frame)
        self.add_util_buttons(frame)
        self.add_status_section(frame)
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
          ''' Build the info text section page '''
          statusframe = tk.Frame(frame)
          statusframe.pack(side=tk.BOTTOM, pady=(5,0))
          
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
        lbltitle = tk.Label(statusframe, text='Status', width=15, anchor=tk.SW)
        lbltitle.pack(side=tk.TOP)
        self.gui.statustext.set('Idle')
        lblstatus = tk.Label(   statusframe,
                                height=1,
                                width=15,
                                textvariable=self.gui.statustext,
                                wraplength=120,
                                justify=tk.LEFT,
                                anchor=tk.NW,
                                bg="gray90")
        lblstatus.pack(side=tk.BOTTOM, anchor=tk.N)

class CommandTab(object):
    ''' Tabs to hold the command options '''
    def __init__(self, gui, notebook, command):
        self.gui = gui
        self.notebook = notebook
        self.page = ttk.Frame(self.notebook)
        self.command = command
        self.title = command.title()

    def build_tab(self):
        ''' Build the tab '''
        actionframe = ActionFrame(self.gui, self.page, self.command)
        actionframe.build_frame()
        self.add_frame_seperator()
        opt_frame = self.add_right_frame()
          
          optlist = ['faceswap.py', command]
          for item in self.opts[command]:
              opt_value = str(item.get('value','').get())
              opt = item['opts'][0]
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 GUI v0.1.0a (#336)

* Code clean up

* Code refactor

* bugfix: Find paths to icons when launched from outside faceswap dir

* Bugfix: Disable GUI if TkInter app not available

* BugFix: Disable GUI if $DISPLAY not detected

* Minor code ammends

* Code Refactor

* DISPLAY check fix 
scripts/gui.py