Example #1
0
 def jurisdictions(self, canned=True):
     """Return a list of valid jurisdictions.
     Can return canned data, or the list of jurisdictions that
     /support/jurisdictions returns."""
     juris = None
     if canned:
         juris = [
                     'us', # United States
                     'es', # Spain
                     'uk', # United Kingdom
                     'scotland', # Duh
                   ]
     else:
         res = app.get('/support/jurisdictions')
         juris_doc = lxml.etree.parse(StringIO(res.body))
         juris = [j for j in juris_doc.xpath('//option/@id')]
     return juris        
Example #2
0
 def jurisdictions(self, canned=True):
     """Return a list of valid jurisdictions.
     Can return canned data, or the list of jurisdictions that
     /support/jurisdictions returns."""
     juris = None
     if canned:
         juris = [
             'us',  # United States
             'es',  # Spain
             'uk',  # United Kingdom
             'scotland',  # Duh
         ]
     else:
         res = app.get('/support/jurisdictions')
         juris_doc = lxml.etree.parse(StringIO(res.body))
         juris = [j for j in juris_doc.xpath('//option/@id')]
     return juris
Example #3
0
 def locales(self, canned=True):
     """Return a list of supported locales.
     Can return canned data, or the list of locales that
     /locales returns."""
     locales = None
     if canned:
         locales = [
                     'en', # English
                     'de', # German
                     # 'he', # Hebrew TODO: fix html rtl formatting
                     'el', # Greek
                   ]
     else:
         res = app.get('/locales')
         locale_doc = lxml.etree.parse(StringIO(res.body))
         locales = [n for n in locale_doc.xpath('//locale/@id')
                                           if n not in ('he',)]
     return locales
Example #4
0
 def locales(self, canned=True):
     """Return a list of supported locales.
     Can return canned data, or the list of locales that
     /locales returns."""
     locales = None
     if canned:
         locales = [
             'en',  # English
             'de',  # German
             # 'he', # Hebrew TODO: fix html rtl formatting
             'el',  # Greek
         ]
     else:
         res = app.get('/locales')
         locale_doc = lxml.etree.parse(StringIO(res.body))
         locales = [
             n for n in locale_doc.xpath('//locale/@id')
             if n not in ('he', )
         ]
     return locales