def args_to_dict(args):
 arg_re = re.compile('(\\w+)[:=](.*)$')
 dict = {}
 for arg in args:
  match = arg_re.match(arg)
  if match:
   dict[match.group(1).lower()] = match.group(2)
  else:
   logging.warning(("args_to_dict: argument '%s' doesn't match '%s' pattern. Ignored." % (arg, arg_re.pattern)))
 return dict

def args_to_dict ( args ) : arg_re = re . compile ( '(\\w+)[:=](.*)$' ) dict = { } for arg in args : match = arg_re . match ( arg ) if match : dict [ match . group ( 1 ) . lower ( ) ] = match . group ( 2 ) else : logging . warning ( ( "args_to_dict: argument '%s' doesn't match '%s' pattern. Ignored." % ( arg , arg_re . pattern ) ) ) return dict
convert autoserv extra arguments in the form of key=val or key:val to a dictionary .