mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-17 17:03:06 +01:00
fix(mako): unify generated constants
like library-name. That way, they are always the same, even if I change my mind. Good coding style is easy, using the current setup.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<%! import util %>\
|
||||
<%namespace name="lib" file="lib/lib.mako"/>\
|
||||
The `${util.library_name(name, version)}` library allows access to all features of *${canonicalName}*.
|
||||
<%namespace name="util" file="lib/util.mako"/>\
|
||||
The `${util.library_name()}` library allows access to all features of *${canonicalName}*.
|
||||
|
||||
<%lib:docs />
|
||||
<%lib:license />
|
||||
@@ -5,7 +5,7 @@
|
||||
# DO NOT EDIT !
|
||||
[package]
|
||||
|
||||
name = "${name}${util.to_api_version(version)}"
|
||||
name = "${mutil.library_name()}"
|
||||
version = "${cargo.build_version}"
|
||||
authors = [${",\n ".join('"%s"' % a for a in cargo.authors)}]
|
||||
description = "A complete library to interact with ${canonicalName} (protocol ${version})"
|
||||
@@ -13,7 +13,7 @@ repository = "${mutil.repository_url()}"
|
||||
homepage = "${documentationLink}"
|
||||
documentation = "${cargo.doc_base_url}"
|
||||
license = "${copyright.license_abbrev}"
|
||||
keywords = ["${name}", ${", ".join('"%s"' % k for k in cargo.keywords)}]
|
||||
keywords = ["${name}", ${", ".join(util.estr(cargo.keywords))}]
|
||||
|
||||
[dependencies]
|
||||
# Just to get hyper to work !
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
<%! import util %>\
|
||||
|
||||
|
||||
## This will only work within a substitution, not within python code
|
||||
@@ -10,4 +10,8 @@ ${v[1:]}\
|
||||
|
||||
<%def name="repository_url()">\
|
||||
${cargo.repo_base_url}/${OUTPUT_DIR}\
|
||||
</%def>
|
||||
|
||||
<%def name="library_name()">\
|
||||
${util.library_name(name, version)}\
|
||||
</%def>
|
||||
@@ -20,6 +20,10 @@ def put_and(l):
|
||||
return l[0]
|
||||
return ', '.join(l[:-1]) + ' and ' + l[-1]
|
||||
|
||||
# escape each string in l with "s" and return the new list
|
||||
def estr(l):
|
||||
return ["%s" % i for i in l]
|
||||
|
||||
# build a full library name (non-canonical)
|
||||
def library_name(name, version):
|
||||
return name + to_api_version(version)
|
||||
|
||||
Reference in New Issue
Block a user