Package diffpy :: Package srrietveld :: Module bugreport
[frames] | no frames]

Module bugreport

source code

Routines for submitting bugreport through www.diffpy.org.

Functions
 
getFormData(content, index=0)
Extract action attribute from the first form in HTML document.
source code
 
submitBugReport(formfields)
Fill in and submit bugreport form at FORM_URL.
source code
Variables
  FORM_ENCPW = 'LPR3rU9s'
  FORM_REALM = 'diffpy'
  FORM_URL = 'http://www.diffpy.org/bugreport/srrietveld/'
  FORM_USER = 'diffuser'
  ROOT_URL = 'http://www.diffpy.org/'
  __id__ = '$Id: bugreport.py 6462 2011-04-02 00:41:29Z yshang $'
  __package__ = 'diffpy.srrietveld'

Imports: HTMLParser, SrrIOError, SrrValueError, urlparse


Function Details

getFormData(content, index=0)

source code 

Extract action attribute from the first form in HTML document.

content -- HTML code index -- zero-based index of the form in the HTML document

Return a tuple of (formattr, formdata) dictionaries, where formattr -- has all the attributes of the <form> element formdata -- has all the contain input field names and their values

submitBugReport(formfields)

source code 
Fill in and submit bugreport form at FORM_URL.
The post url is obtained by parsing the first HTML form.

formfields -- dictionary containing the keys.  When optional
              fields are not specified, use defaults as listed:

              "reporter"    optional, ["anonymous"]
              "summary"     required
              "description" required
              "component"   optional, ["srrietveld"]
              "version"     optional, [current version of SrRietveld]
              "traceback"   optional, [""]

              All values get stripped from leading and trailing spaces.
              Any other keys in formfields are ignored.

No return value.
Raise KeyError when formfields does not have required keys.
Raise IOError on failed posting.