Package diffpy :: Package pdfgui :: Module bugreport
[hide private]
[frames] | no frames]

Module bugreport

source code

Routines for submitting bugreport through www.diffpy.org.




Version: 1.0-r3067-20090410

Classes [hide private]
  _HTMLFormActionGetter
Helper HTMLParser for extracting action attriubte from the first form.
Functions [hide private]
 
submitBugReport(formfields)
Fill in and submit bugreport form at FORM_URL.
source code
 
getFormAction(content)
Extract action attribute from the first form in HTML document.
source code
Variables [hide private]
  __id__ = '$Id: bugreport.py 2980 2009-04-02 00:14:33Z juhas $'
  ROOT_URL = 'http://www.diffpy.org/'
  FORM_URL = 'http://www.diffpy.org/bugreport/pdfgui/'
  FORM_REALM = 'diffpy'
  FORM_USER = 'diffuser'
  FORM_ENCPW = 'LPR3rU9s'
Function Details [hide private]

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, ["pdfgui"]
              "version"     optional, [current version of PDFgui]
              "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.

getFormAction(content)

source code 
Extract action attribute from the first form in HTML document.

content -- HTML code

Return string.
Raise ValueError if form action attribute cannot be extracted.