OLD | NEW |
(Empty) | |
| 1 import os |
| 2 import functools |
| 3 |
| 4 live_connection = False |
| 5 mturk_host = 'mechanicalturk.sandbox.amazonaws.com' |
| 6 external_url = 'http://www.example.com/' |
| 7 |
| 8 |
| 9 SetHostMTurkConnection = None |
| 10 |
| 11 def config_environment(): |
| 12 global SetHostMTurkConnection |
| 13 try: |
| 14 local = os.path.join(os.path.dirname(__file__), 'local.py') |
| 15 execfile(local) |
| 16 except: |
| 17 pass |
| 18 |
| 19 if live_connection: |
| 20 #TODO: you must set the auth credentials to something valid |
| 21 from boto.mturk.connection import MTurkConnection |
| 22 else: |
| 23 # Here the credentials must be set, but it doesn't matter what |
| 24 # they're set to. |
| 25 os.environ.setdefault('AWS_ACCESS_KEY_ID', 'foo') |
| 26 os.environ.setdefault('AWS_SECRET_ACCESS_KEY', 'bar') |
| 27 from mocks import MTurkConnection |
| 28 SetHostMTurkConnection = functools.partial(MTurkConnection, host=mturk_host) |
OLD | NEW |