ctrochalakis / tx-submissions (http://transifex.org/)

fork of transifex

GSoC '08: Introducing a new transifex submission system, an api and a command line client
Clone URL : http://bitbucket.org/ctrochalakis/tx-submissions/ (size: 1.4 MB)
commit 445: 999649d9f7b3
parent 444: dd93961c311b
branch: default
Adding a new function called request_format()
Diego Búrigo Zacarão
4 months ago

Changed (Δ260 bytes):

raw changeset »

transifex/util.py (10 lines added, 0 lines removed)

Up to file-list transifex/util.py:

@@ -449,3 +449,13 @@ def import_to_python(import_str):
449
449
    obj = getattr(__import__(mod_name, {}, {}, ['']), obj_name)
450
450
    return obj
451
451
452
453
def request_format():
454
   """
455
   Return the output format that was requested.
456
   """
457
   format = cherrypy.request.params.get('tg_format', '').lower()
458
   if not format:
459
       format = cherrypy.request.headers.get('Accept', 'default').lower()
460
   return format
461