File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- <%! import util % > \
21<%namespace name =" lib" file =" lib/lib.mako" /> \
3- The `$ {util.library_name(name, version)}` library allows access to all features of * $ {canonicalName}* .
2+ <%namespace name =" util" file =" lib/util.mako" /> \
3+ The `${ util.library_name()} ` library allows access to all features of *${ canonicalName} *.
44
55<%lib:docs />
66<%lib:license />
Original file line number Diff line number Diff line change 55# DO NOT EDIT !
66[package]
77
8- name = " ${name} ${util.to_api_version(version )}"
8+ name = " ${mutil.library_name( )}"
99version = " ${cargo.build_version} "
1010authors = [$ {" ,\n " .join(' "%s "' % a for a in cargo.authors)}]
1111description = " A complete library to interact with ${canonicalName} (protocol ${version} )"
1212repository = " ${mutil.repository_url()}"
1313homepage = " ${documentationLink} "
1414documentation = " ${cargo.doc_base_url} "
1515license = " ${copyright.license_abbrev} "
16- keywords = [" ${name} " , $ {" , " .join(' " %s " ' % k for k in cargo.keywords)}]
16+ keywords = [" ${name} " , $ {" , " .join(util.estr( cargo.keywords) )}]
1717
1818[dependencies]
1919# Just to get hyper to work !
Original file line number Diff line number Diff line change 1-
1+ <%! import util % > \
22
33
44# # This will only work within a substitution, not within python code
@@ -10,4 +10,8 @@ ${v[1:]}\
1010
1111<%def name = "repository_url() "> \
1212${ cargo.repo_base_url} /${ OUTPUT_DIR } \
13+ </%def >
14+
15+ <%def name = "library_name() "> \
16+ ${ util.library_name(name, version)} \
1317</%def >
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ def put_and(l):
2020 return l [0 ]
2121 return ', ' .join (l [:- 1 ]) + ' and ' + l [- 1 ]
2222
23+ # escape each string in l with "s" and return the new list
24+ def estr (l ):
25+ return ["%s" % i for i in l ]
26+
2327# build a full library name (non-canonical)
2428def library_name (name , version ):
2529 return name + to_api_version (version )
You can’t perform that action at this time.
0 commit comments