summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@slide.com>2009-08-24 16:13:23 -0700
committerR. Tyler Ballance <tyler@slide.com>2009-08-24 16:13:23 -0700
commitc9c2e892447bc37c1fe59e24dc8bb25f48c0187a (patch)
treee80fdc1eac2ecdbdcf50fa0585f14aff56b5eecb
parentda52de58a83fb39eefe245a7509796cb5b9acf37 (diff)
parente658b4ba82c5c07d40d2a5e394f42ecdac82b8fb (diff)
downloadpython-cheetah-c9c2e892447bc37c1fe59e24dc8bb25f48c0187a.tar.gz
Merge commit 'abbeyj/next' into next
-rw-r--r--SetupConfig.py8
-rwxr-xr-xbin/cheetah4
-rw-r--r--bin/cheetah-compile6
-rw-r--r--cheetah/CheetahWrapper.py10
4 files changed, 22 insertions, 6 deletions
diff --git a/SetupConfig.py b/SetupConfig.py
index 781ff0d..bcf5ca3 100644
--- a/SetupConfig.py
+++ b/SetupConfig.py
@@ -63,6 +63,14 @@ if not os.getenv('CHEETAH_INSTALL_WITHOUT_SETUPTOOLS'):
install_requires = [
"Markdown >= 2.0.1",
]
+ # use 'entry_points' instead of 'scripts'
+ del scripts
+ entry_points = {
+ 'console_scripts': [
+ 'cheetah = Cheetah.CheetahWrapper:_cheetah',
+ 'cheetah-compile = Cheetah.CheetahWrapper:_cheetah_compile',
+ ]
+ }
except ImportError:
print 'Not using setuptools, so we cannot install the Markdown dependency'
diff --git a/bin/cheetah b/bin/cheetah
index 26c391a..61b8178 100755
--- a/bin/cheetah
+++ b/bin/cheetah
@@ -1,3 +1,3 @@
#!/usr/bin/env python
-from Cheetah.CheetahWrapper import CheetahWrapper
-CheetahWrapper().main()
+from Cheetah.CheetahWrapper import _cheetah
+_cheetah()
diff --git a/bin/cheetah-compile b/bin/cheetah-compile
index 5d9ab60..f15528e 100644
--- a/bin/cheetah-compile
+++ b/bin/cheetah-compile
@@ -1,5 +1,3 @@
#!/usr/bin/env python
-import sys
-from Cheetah.CheetahWrapper import CheetahWrapper
-sys.argv.insert(1, "compile")
-CheetahWrapper().main()
+from Cheetah.CheetahWrapper import _cheetah_compile
+_cheetah_compile()
diff --git a/cheetah/CheetahWrapper.py b/cheetah/CheetahWrapper.py
index 96f57d5..9af8f1e 100644
--- a/cheetah/CheetahWrapper.py
+++ b/cheetah/CheetahWrapper.py
@@ -614,6 +614,16 @@ be named according to the same rules as Python modules.""" % tup)
f.close()
+# Called when invoked as `cheetah`
+def _cheetah():
+ CheetahWrapper().main()
+
+# Called when invoked as `cheetah-compile`
+def _cheetah_compile():
+ sys.argv.insert(1, "compile")
+ CheetahWrapper().main()
+
+
##################################################
## if run from the command line
if __name__ == '__main__': CheetahWrapper().main()