def submit_form(form, extra_values=None, open_http=None):
 values = form.form_values()
 if extra_values:
  if hasattr(extra_values, 'items'):
   extra_values = extra_values.items()
  values.extend(extra_values)
 if (open_http is None):
  open_http = open_http_urllib
 if form.action:
  url = form.action
 else:
  url = form.base_url
 return open_http(form.method, url, values)

def submit_form ( form , extra_values = None , open_http = None ) : values = form . form_values ( ) if extra_values : if hasattr ( extra_values , 'items' ) : extra_values = extra_values . items ( ) values . extend ( extra_values ) if ( open_http is None ) : open_http = open_http_urllib if form . action : url = form . action else : url = form . base_url return open_http ( form . method , url , values )
helper function to submit a form .