diff options
author | Derek Harland <derek.harland@finq.co.nz> | 2014-04-16 11:56:32 +1200 |
---|---|---|
committer | Derek Harland <derek.harland@finq.co.nz> | 2014-04-16 11:56:32 +1200 |
commit | ce40b6431110a8ecee5be95eb56df4d622a41943 (patch) | |
tree | 8c678fb0b9e3613537ac9c5235885973904196a9 | |
parent | 71a3ea74ba27e172aa98a0e7ddef35464a143fe4 (diff) | |
download | mako-ce40b6431110a8ecee5be95eb56df4d622a41943.tar.gz |
Convert mako-render into module mako.cmd and add suitable entrypoint to setup
-rwxr-xr-x | mako/cmd.py (renamed from scripts/mako-render) | 12 | ||||
-rw-r--r-- | setup.py | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/scripts/mako-render b/mako/cmd.py index 2b951ab..15c2737 100755 --- a/scripts/mako-render +++ b/mako/cmd.py @@ -1,4 +1,8 @@ -#!/usr/bin/env python +# mako/cmd.py +# Copyright (C) 2006-2014 the Mako authors and contributors <see AUTHORS file> +# +# This module is part of Mako and is released under +# the MIT License: http://www.opensource.org/licenses/mit-license.php def render(data, kw, lookup_dirs): from mako.template import Template @@ -12,7 +16,9 @@ def varsplit(var): return (var, "") return var.split("=", 1) -def main(argv=None): +def cmdline(argv=None): + import pdb; pdb.set_trace() + from os.path import isfile, dirname from sys import stdin @@ -57,4 +63,4 @@ def main(argv=None): sys.exit(1) if __name__ == "__main__": - main() + cmdline() @@ -39,7 +39,6 @@ setup(name='Mako', url='http://www.makotemplates.org/', license='MIT', packages=find_packages('.', exclude=['examples*', 'test*']), - scripts=['scripts/mako-render'], tests_require=['nose >= 0.11'], test_suite="nose.collector", zip_safe=False, @@ -58,5 +57,8 @@ setup(name='Mako', [babel.extractors] mako = mako.ext.babelplugin:extract + + [console_scripts] + mako-render = mako.cmd:cmdline """ ) |