def cat_to_opts(cat, pp=None, script=None, priority=None):
 def_cat = config.get_categories('*')
 cat = safe_lower(cat)
 if (cat in ('', 'none', 'default')):
  cat = '*'
 try:
  my_cat = config.get_categories()[cat]
 except KeyError:
  my_cat = def_cat
 if (pp is None):
  pp = my_cat.pp()
  if (pp == ''):
   pp = def_cat.pp()
 if (not script):
  script = my_cat.script()
  if (safe_lower(script) in ('', 'default')):
   script = def_cat.script()
 if ((priority is None) or (priority == DEFAULT_PRIORITY)):
  priority = my_cat.priority()
  if (priority == DEFAULT_PRIORITY):
   priority = def_cat.priority()
 return (cat, pp, script, priority)

def cat_to_opts ( cat , pp = None , script = None , priority = None ) : def_cat = config . get_categories ( '*' ) cat = safe_lower ( cat ) if ( cat in ( '' , 'none' , 'default' ) ) : cat = '*' try : my_cat = config . get_categories ( ) [ cat ] except KeyError : my_cat = def_cat if ( pp is None ) : pp = my_cat . pp ( ) if ( pp == '' ) : pp = def_cat . pp ( ) if ( not script ) : script = my_cat . script ( ) if ( safe_lower ( script ) in ( '' , 'default' ) ) : script = def_cat . script ( ) if ( ( priority is None ) or ( priority == DEFAULT_PRIORITY ) ) : priority = my_cat . priority ( ) if ( priority == DEFAULT_PRIORITY ) : priority = def_cat . priority ( ) return ( cat , pp , script , priority )
derive options from category .