Files
google-apis-rs/src/mako/lib/util.mako
Sebastian Thiel d3bb130be0 feat(lib): use serge instead of serialize
However, for some reason, the `Serialize/Deserialize` macros don't work
for me, even though they work just fine in the respective tests of
the serge crate. What am I possibly doing wrong ?
2015-03-20 11:28:09 +01:00

46 lines
1.2 KiB
Mako

<%! import util %>\
## source should be ${self.uri}
## you need to escape the output, using a filter for example
<%def name="gen_info(source)">\
DO NOT EDIT !
This file was generated automatically from '${source}'
DO NOT EDIT !\
</%def>
## This will only work within a substitution, not within python code
<%def name="to_api_version(v)" buffered="True">\
<% assert len(v) >= 2 and v[0] == 'v'%>\
## convert it once to int, just to be sure it is an int
${v[1:]}\
</%def>
<%def name="repository_url()" buffered="True">\
${cargo.repo_base_url}/${OUTPUT_DIR}\
</%def>
<%def name="library_name()" buffered="True">\
${util.library_name(name, version)}\
</%def>
<%def name="crate_name()" buffered="True">\
${util.library_to_crate_name(util.library_name(name, version))}\
</%def>
## All crates and standard `use` declaration, required for all examples
## Must be outside of a test function
<%def name="test_prelude()">\
extern crate hyper;
extern crate "yup-oauth2" as oauth2;
extern crate serde;
extern crate "${self.crate_name()}" as ${self.library_name()};
</%def>
## Define the canonical name, if present, or name otherwise
<%def name="canonical_name()" buffered="True">\
% if canonicalName is UNDEFINED:
${name}\
% else:
${canonicalName}\
% endif
</%def>