Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # NOT NEEDED AFTER APP ENGINE VERSION 1.7.7
- import json
- import logging
- from google.appengine.ext.endpoints import api_config
- class PatchedApiConfigGenerator(api_config.ApiConfigGenerator):
- def pretty_print_config_to_json(self, services, hostname=None):
- logging.warn('TODO: remove this monkey patch after GAE version 1.7.7')
- # Sorry, the next line is not PEP8 compatible :(
- json_string = super(PatchedApiConfigGenerator, self).pretty_print_config_to_json(
- services, hostname=hostname)
- to_patch = json.loads(json_string)
- to_patch['auth'] = {'allowCookieAuth': True}
- return json.dumps(to_patch, sort_keys=True, indent=2)
- api_config.ApiConfigGenerator = PatchedApiConfigGenerator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement