parameters: (name, column=0, required=True, default=None, type=None, spaces=False, aslist=False)
return_statement: return ret
docstring: get a value from config dictionary
docstring_summary: get a value from config dictionary
docstring_tokens: get a value from config dictionary
function: def get_config(name, column=0, required=True, default=None, type=None, spaces=False, aslist=False):
      '''get a value from config dictionary'''
      if name not in config:
          if required and default is None:
              error("missing required value %s in hwdef.dat" % name)
          return default
      if aslist:
          return config[name]
      if len(config[name]) < column + 1:
          if not required:
              return None
          error("missing required value %s in hwdef.dat (column %u)" % (name,
                                                                        column))
      if spaces:
          ret = ' '.join(config[name][column:])
      else:
          ret = config[name][column]
  
      if type is not None:
          if type == int and ret.startswith('0x'):
              try:
                  ret = int(ret, 16)
              except Exception:
                  error("Badly formed config value %s (got %s)" % (name, ret))
          else:
              try:
                  ret = type(ret)
              except Exception:
                  error("Badly formed config value %s (got %s)" % (name, ret))
      return ret
function_tokens: def get_config ( name , column = 0 , required = True , default = None , type = None , spaces = False , aslist = False ) : if name not in config : if required and default is None : error ( "missing required value %s in hwdef.dat" % name ) return default if aslist : return config [ name ] if len ( config [ name ] ) < column + 1 : if not required : return None error ( "missing required value %s in hwdef.dat (column %u)" % ( name , column ) ) if spaces : ret = ' ' . join ( config [ name ] [ column : ] ) else : ret = config [ name ] [ column ] if type is not None : if type == int and ret . startswith ( '0x' ) : try : ret = int ( ret , 16 ) except Exception : error ( "Badly formed config value %s (got %s)" % ( name , ret ) ) else : try : ret = type ( ret ) except Exception : error ( "Badly formed config value %s (got %s)" % ( name , ret ) ) return ret