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