(control)
return config
Parse the config file.

    It's important that a line in the file is written without spaces,
    that means

     - 'foo=bar' is a valid line
     - 'foo = bar' is not a valid one
Parse the config file.
Parse the config file .
def parse_config(control):
    '''Parse the config file.

    It's important that a line in the file is written without spaces,
    that means

     - 'foo=bar' is a valid line
     - 'foo = bar' is not a valid one

    '''
    config = {'del_clip': True,  # standard config
              'clip_delay': 20,
              'lock_db': True,
              'lock_delay': 60,
              'rem_db': True,
              'rem_key': False,
              'skip_menu': False,
              'pin': True}

    if isfile(control.config_home):
        try:
            handler = open(control.config_home, 'r')
        except Exception as err:  # don't know if this is good style
            print(err.__str__())
        else:
            for line in handler:
                key, val = line.split('=')
                if val == 'True\n':
                    val = True
                elif val == 'False\n':
                    val = False
                else:
                    val = int(val)
                if key in config:
                    config[key] = val
            handler.close()
    else:  # write standard config
        write_config(control, config)
    return config
def parse_config ( control ) : config = { 'del_clip' : True , # standard config 'clip_delay' : 20 , 'lock_db' : True , 'lock_delay' : 60 , 'rem_db' : True , 'rem_key' : False , 'skip_menu' : False , 'pin' : True } if isfile ( control . config_home ) : try : handler = open ( control . config_home , 'r' ) except Exception as err : # don't know if this is good style print ( err . __str__ ( ) ) else : for line in handler : key , val = line . split ( '=' ) if val == 'True\n' : val = True elif val == 'False\n' : val = False else : val = int ( val ) if key in config : config [ key ] = val handler . close ( ) else : # write standard config write_config ( control , config ) return config