mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-05 19:16:24 +01:00
Basic fixups for python3
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
return 'None'
|
||||
if isinstance(v, bool):
|
||||
v = v and 'true' or 'false'
|
||||
elif isinstance(v, basestring):
|
||||
elif isinstance(v, str):
|
||||
v = 'r##"%s"##' % v
|
||||
elif isinstance(v, list):
|
||||
v = 'vec![%s]' % ','.join('UploadProtocol::%s' % p.capitalize() for p in v)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%
|
||||
import os
|
||||
import urllib2
|
||||
import urllib
|
||||
import json
|
||||
|
||||
apis = {}
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
if os.environ.get('FETCH_APIS') is not None:
|
||||
discovery_url = 'https://www.googleapis.com/discovery/v1/'
|
||||
apis = json.loads(urllib2.urlopen(discovery_url + "apis").read())
|
||||
apis = json.loads(urllib.request.urlopen(discovery_url + "apis").read())
|
||||
|
||||
print('Loaded {} apis from Google'.format(len(apis['items'])))
|
||||
|
||||
@@ -98,8 +98,9 @@
|
||||
api_info.append((api_target, api_clean, api_cargo, api_doc, api_crate_publish_file, gen_root))
|
||||
|
||||
space_join = lambda i: ' '.join(a[i] for a in api_info)
|
||||
except:
|
||||
except Exception as e:
|
||||
print('Could not open JSON file at {}'.format(api_json))
|
||||
print(e)
|
||||
%>\
|
||||
${api_common}: $(RUST_SRC)/${make.id}/cmn.rs $(lastword $(MAKEFILE_LIST)) ${gen_root_stamp}
|
||||
@ echo "// COPY OF '$<'" > $@
|
||||
|
||||
@@ -847,7 +847,7 @@ def library_to_crate_name(name, suffix=''):
|
||||
|
||||
# return version like 0.1.0+2014031421
|
||||
def crate_version(build_version, revision):
|
||||
return '%s+%s' % (build_version, isinstance(revision, basestring) and revision or '00000000')
|
||||
return '%s+%s' % (build_version, isinstance(revision, str) and revision or '00000000')
|
||||
|
||||
# return a crate name for us in extern crate statements
|
||||
def to_extern_crate_name(crate_name):
|
||||
|
||||
Reference in New Issue
Block a user