Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 1 | """Retain apiclient as an alias for googleapiclient.""" |
| 2 | |
Pat Ferate | 846befc | 2015-03-03 18:31:41 -0800 | [diff] [blame] | 3 | from six import iteritems |
| 4 | |
Craig Citro | 0c18afc | 2014-10-15 21:53:05 -0700 | [diff] [blame] | 5 | import googleapiclient |
Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 6 | |
Craig Citro | 0ff797d | 2014-10-15 23:22:51 -0700 | [diff] [blame] | 7 | try: |
| 8 | import oauth2client |
| 9 | except ImportError: |
| 10 | raise RuntimeError( |
| 11 | 'Previous version of google-api-python-client detected; due to a ' |
| 12 | 'packaging issue, we cannot perform an in-place upgrade. To repair, ' |
| 13 | 'remove and reinstall this package, along with oauth2client and ' |
| 14 | 'uritemplate. One can do this with pip via\n' |
| 15 | ' pip install -I google-api-python-client' |
| 16 | ) |
| 17 | |
Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 18 | from googleapiclient import channel |
| 19 | from googleapiclient import discovery |
| 20 | from googleapiclient import errors |
| 21 | from googleapiclient import http |
| 22 | from googleapiclient import mimeparse |
| 23 | from googleapiclient import model |
| 24 | from googleapiclient import sample_tools |
| 25 | from googleapiclient import schema |
Craig Citro | 076b333 | 2014-10-15 12:16:42 -0700 | [diff] [blame] | 26 | |
Craig Citro | 0c18afc | 2014-10-15 21:53:05 -0700 | [diff] [blame] | 27 | __version__ = googleapiclient.__version__ |
Craig Citro | b939a7d | 2014-10-17 20:27:26 -0700 | [diff] [blame] | 28 | |
| 29 | _SUBMODULES = { |
| 30 | 'channel': channel, |
| 31 | 'discovery': discovery, |
| 32 | 'errors': errors, |
| 33 | 'http': http, |
| 34 | 'mimeparse': mimeparse, |
| 35 | 'model': model, |
| 36 | 'sample_tools': sample_tools, |
| 37 | 'schema': schema, |
| 38 | } |
| 39 | |
| 40 | import sys |
Pat Ferate | 846befc | 2015-03-03 18:31:41 -0800 | [diff] [blame] | 41 | for module_name, module in iteritems(_SUBMODULES): |
Craig Citro | b939a7d | 2014-10-17 20:27:26 -0700 | [diff] [blame] | 42 | sys.modules['apiclient.%s' % module_name] = module |