From d833be68cb7279241996e0f3e9ae3d1162308145 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 1 Jul 2010 13:30:16 -0400 Subject: Fixed Ticket 63. Changed name of commandline script (again) to 'markdown_py' because 'markdown' conflicts with the perl implementation. 'markdown_py' will at least still work with tab completion when the user types 'markdown'. --- bin/markdown | 42 ------------------------------------------ bin/markdown_py | 42 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 14 ++++++++++---- 3 files changed, 52 insertions(+), 46 deletions(-) delete mode 100755 bin/markdown create mode 100755 bin/markdown_py diff --git a/bin/markdown b/bin/markdown deleted file mode 100755 index 8d04cc9..0000000 --- a/bin/markdown +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -""" -Python Markdown, the Command Line Script -======================================== - -This is the command line script for Python Markdown. - -Basic use from the command line: - - markdown source.txt > destination.html - -Run "markdown --help" to see more options. - -See markdown/__init__.py for information on using Python Markdown as a module. - -## Authors and License - -Started by [Manfred Stienstra](http://www.dwerg.net/). Continued and -maintained by [Yuri Takhteyev](http://www.freewisdom.org), [Waylan -Limberg](http://achinghead.com/) and [Artem Yunusov](http://blog.splyer.com). - -Contact: markdown@freewisdom.org - -Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) -Copyright 200? Django Software Foundation (OrderedDict implementation) -Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) -Copyright 2004 Manfred Stienstra (the original version) - -License: BSD (see docs/LICENSE for details). -""" - -import logging -from markdown import COMMAND_LINE_LOGGING_LEVEL -from markdown import commandline - -# Setup a logger manually for compatibility with Python 2.3 -logger = logging.getLogger('MARKDOWN') -logger.setLevel(COMMAND_LINE_LOGGING_LEVEL) -logger.addHandler(logging.StreamHandler()) - -if __name__ == '__main__': - commandline.run() diff --git a/bin/markdown_py b/bin/markdown_py new file mode 100755 index 0000000..8d04cc9 --- /dev/null +++ b/bin/markdown_py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +""" +Python Markdown, the Command Line Script +======================================== + +This is the command line script for Python Markdown. + +Basic use from the command line: + + markdown source.txt > destination.html + +Run "markdown --help" to see more options. + +See markdown/__init__.py for information on using Python Markdown as a module. + +## Authors and License + +Started by [Manfred Stienstra](http://www.dwerg.net/). Continued and +maintained by [Yuri Takhteyev](http://www.freewisdom.org), [Waylan +Limberg](http://achinghead.com/) and [Artem Yunusov](http://blog.splyer.com). + +Contact: markdown@freewisdom.org + +Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) +Copyright 200? Django Software Foundation (OrderedDict implementation) +Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) +Copyright 2004 Manfred Stienstra (the original version) + +License: BSD (see docs/LICENSE for details). +""" + +import logging +from markdown import COMMAND_LINE_LOGGING_LEVEL +from markdown import commandline + +# Setup a logger manually for compatibility with Python 2.3 +logger = logging.getLogger('MARKDOWN') +logger.setLevel(COMMAND_LINE_LOGGING_LEVEL) +logger.addHandler(logging.StreamHandler()) + +if __name__ == '__main__': + commandline.run() diff --git a/setup.py b/setup.py index 42939d3..6c5ed29 100755 --- a/setup.py +++ b/setup.py @@ -6,17 +6,23 @@ from distutils.command.install_scripts import install_scripts version = '2.0.3' +# The command line script name. Currently set to "markdown_py" so as not to +# conflict with the perl implimentation (which uses "markdown"). We can't use +# "markdown.py" as the default config on some systems will cause the script to +# try to import itself rather than the library which raised an error. +SCRIPT_NAME = 'markdown_py' + class md_install_scripts(install_scripts): - """ Customized install_scripts. Create markdown.bat for win32. """ + """ Customized install_scripts. Create markdown_py.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') + script_path = os.path.join(script_dir, SCRIPT_NAME) bat_str = '@"%s" "%s" %%*' % (sys.executable, script_path) - bat_path = os.path.join(self.install_dir, 'markdown.bat') + bat_path = os.path.join(self.install_dir, '%s.bat' %SCRIPT_NAME) f = file(bat_path, 'w') f.write(bat_str) f.close() @@ -36,7 +42,7 @@ data = dict( maintainer_email = 'waylan [at] gmail.com', license = 'BSD License', packages = ['markdown', 'markdown.extensions'], - scripts = ['bin/markdown'], + scripts = ['bin/%s' % SCRIPT_NAME], cmdclass = {'install_scripts': md_install_scripts}, classifiers = ['Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: BSD License', -- cgit v1.2.3