- Timestamp:
- Jul 6, 2017, 9:00:04 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r13935 r13936 1748 1748 def is_text_request(environ=os.environ): 1749 1749 """ Find out whether we are calling from the CLI or any text based CLI utility """ 1750 try: 1751 return environ['HTTP_USER_AGENT'].split()[0] in ['curl', 'fetch', 'wget'] 1752 except KeyError: 1750 if 'CONTENT_TYPE' in os.environ and os.environ['CONTENT_TYPE'] == 'text/plain': 1753 1751 return True 1752 1753 if 'HTTP_USER_AGENT' in environ: 1754 return any([os.environ['HTTP_USER_AGENT'].lower().startswith(x) for x in ['curl', 'fetch', 'wget']]) 1755 else: 1756 return False 1757 1754 1758 1755 1759 def switchFormat(setting):
Note:
See TracChangeset
for help on using the changeset viewer.