diff options
author | Waylan Limberg <waylan@gmail.com> | 2009-05-05 23:29:26 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2009-05-05 23:29:26 -0400 |
commit | 3595679ef7e474e07734d573205e75d04034eb88 (patch) | |
tree | d9dd3d40dd5dce1686114f16aaac7139a2978887 | |
parent | 6d972b91d30d6e314fee111354b98ed4130eebe6 (diff) | |
download | markdown-3595679ef7e474e07734d573205e75d04034eb88.tar.gz markdown-3595679ef7e474e07734d573205e75d04034eb88.tar.bz2 markdown-3595679ef7e474e07734d573205e75d04034eb88.zip |
Fixed commandline issues and upped version to 2.0.1-beta. Renamed markdown.py to markdown and added a markdown.bat wrapper for win32. Also had to put markdown script in a bin dir so it doesn't clash with the markdown lib dir because win32 doesn't allow a dir and file of the same name in same parent dir.
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rwxr-xr-x | bin/markdown (renamed from markdown.py) | 11 | ||||
-rw-r--r-- | markdown/__init__.py | 4 | ||||
-rwxr-xr-x | setup.py | 30 |
4 files changed, 32 insertions, 15 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index b784dd4..4558938 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include markdown.py +recursive-include bin * recursive-include markdown *.py recursive-include docs * prune markdown/extensions/legacy.py diff --git a/markdown.py b/bin/markdown index d7bff46..aae3e76 100755 --- a/markdown.py +++ b/bin/markdown @@ -29,17 +29,6 @@ Copyright 2004 Manfred Stienstra (the original version) License: BSD (see docs/LICENSE for details). """ -import sys, os -if sys.platform == 'win32': - # We have to remove the Scripts dir from path on windows. - # If we don't, it will try to import itself rather than markdown lib. - # This appears to *not* be a problem on *nix systems, only Windows. - try: - sys.path.remove(os.path.dirname(__file__)) - except (ValueError, NameError): - pass - -# Now we can import the markdown lib. import logging from markdown import COMMAND_LINE_LOGGING_LEVEL from markdown import commandline diff --git a/markdown/__init__.py b/markdown/__init__.py index 0d1c504..e0b356d 100644 --- a/markdown/__init__.py +++ b/markdown/__init__.py @@ -39,8 +39,8 @@ Copyright 2004 Manfred Stienstra (the original version) License: BSD (see docs/LICENSE for details). """ -version = "2.0" -version_info = (2,0,0, "Final") +version = "2.0.1-beta" +version_info = (2,0,1, "beta") import re import codecs @@ -1,8 +1,28 @@ #!/usr/bin/env python +import sys, os from distutils.core import setup +from distutils.command.install_scripts import install_scripts from markdown import version +class md_install_scripts(install_scripts): + """ Customized install_scripts. Create markdown.bat for win32. """ + def run(self): + install_scripts.run(self) + + if sys.platform == 'win32': + try: + script_dir = os.path.join(sys.prefix, 'Scripts') + script_path = os.path.join(script_dir, 'markdown') + bat_str = '@"%s" "%s" %%*' % (sys.executable, script_path) + bat_path = os.path.join(self.install_dir, 'markdown.bat') + f = file(bat_path, 'w') + f.write(bat_str) + f.close() + print 'Created:', bat_path + except Exception, e: + print 'ERROR: Unable to create %s: %s' % (bat_path, e) + setup( name = 'Markdown', version = version, @@ -15,11 +35,19 @@ setup( maintainer_email = "waylan [at] gmail.com", license = "BSD License", packages = ['markdown', 'markdown.extensions'], - scripts = ['markdown.py'], + scripts = ['bin/markdown'], + cmdclass = {'install_scripts': md_install_scripts}, classifiers = ['Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.3', + 'Programming Language :: Python :: 2.4', + 'Programming Language :: Python :: 2.5', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.0', 'Topic :: Communications :: Email :: Filters', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries', 'Topic :: Internet :: WWW/HTTP :: Site Management', |