Skip to content

Commit

Permalink
fix(lib-name):user lower-case library names,always
Browse files Browse the repository at this point in the history
fixes #14
  • Loading branch information
Byron committed Mar 16, 2015
1 parent 881c9dd commit 814c9c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gen/youtube3/cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DO NOT EDIT !
# This file was generated automatically from 'src/mako/cargo.toml.mako'
# This file was generated automatically from 'src/mako/Cargo.toml.mako'
# DO NOT EDIT !
[package]

Expand Down
6 changes: 4 additions & 2 deletions src/mako/deps.mako
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ help-api:

% for info in apis['items']:
<%
target_dir = directories.api_base + '/' + info['name'] + '/' + info['version']
target = target_dir + '/' + info['name'] + '-api.json'
import util
name = util.normalize_library_name(info['name'])
target_dir = directories.api_base + '/' + name + '/' + info['version']
target = target_dir + '/' + name + '-api.json'
## assure the target never actually exists to force him to wget whenver we ask !
fake_target = target + '-force'
json_api_targets.append(fake_target)
Expand Down
5 changes: 4 additions & 1 deletion src/mako/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ def to_api_version(v):
version = version + '_' + remainder
return version

def normalize_library_name(name):
return name.lower()

# build a full library name (non-canonical)
def library_name(name, version):
version = to_api_version(version)
Expand All @@ -712,7 +715,7 @@ def library_name(name, version):
if name[-1].isdigit():
name += '_'
version = 'v' + version
return name + version
return normalize_library_name(name) + version

# return type name of a resource method builder, from a resource name
def rb_type(r):
Expand Down

0 comments on commit 814c9c9

Please sign in to comment.