From ea3dcdd168bebf603c591b286137f28194318287 Mon Sep 17 00:00:00 2001 From: Jorgen Stenarson Date: Thu, 15 Jul 2010 18:23:16 +0200 Subject: [PATCH] Fixes for bugs #357977 and #372568. --- MANIFEST.in | 8 ++++++++ pyreadline/__init__.py | 2 +- pyreadline/release.py | 8 +++++--- pyreadline/unicode_helper.py | 11 +++++++---- setup.py | 13 ++++++++++--- 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 8a8360f..ffa0645 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,9 @@ include pyreadline/configuration/pyreadlineconfig.ini + +graft doc +exclude doc/\#* +exclude doc/man/*.1 + +# docs subdirs we want to skip +prune doc/attic +prune doc/build diff --git a/pyreadline/__init__.py b/pyreadline/__init__.py index b32f480..9e265f0 100644 --- a/pyreadline/__init__.py +++ b/pyreadline/__init__.py @@ -6,7 +6,7 @@ # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #***************************************************************************** -import unicode_helper, logger, clipboard, lineeditor, modes +import unicode_helper, logger, clipboard, lineeditor, modes, console from rlmain import * import rlmain __all__ = [ 'parse_and_bind', diff --git a/pyreadline/release.py b/pyreadline/release.py index b49fbba..e74dae3 100644 --- a/pyreadline/release.py +++ b/pyreadline/release.py @@ -61,11 +61,13 @@ url = u'http://ipython.scipy.org/moin/PyReadline/Intro' -download_url = u'' +download_url = u'https://launchpad.net/pyreadline/+download' -platforms = [u'Windows XP/2000/NT',u'Windows 95/98/ME'] +platforms = [u'Windows XP/2000/NT', + u'Windows 95/98/ME'] -keywords = [u'readline',u'pyreadline'] +keywords = [u'readline', + u'pyreadline'] classifiers = [u'Development Status :: 4 - Beta', u'Environment :: Console', diff --git a/pyreadline/unicode_helper.py b/pyreadline/unicode_helper.py index 9addbdd..bf171ab 100644 --- a/pyreadline/unicode_helper.py +++ b/pyreadline/unicode_helper.py @@ -9,10 +9,13 @@ try: pyreadline_codepage = sys.stdout.encoding -except AttributeError: #This error occurs when pdb imports readline and doctest has replaced - #stdout with stdout collector - pyreadline_codepage = u"ascii" #assume ascii codepage - +except AttributeError: + # This error occurs when pdb imports readline and doctest has replaced + # stdout with stdout collector. We will assume ascii codepage + pyreadline_codepage = u"ascii" + +if pyreadline_codepage is None: + pyreadline_codepage = u"ascii" def ensure_unicode(text): u"""helper to ensure that text passed to WriteConsoleW is unicode""" diff --git a/setup.py b/setup.py index 065e60c..151c3be 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,13 @@ from distutils.core import setup execfile('pyreadline/release.py') +try: + import sphinx + from sphinx.setup_command import BuildDoc + cmd_class ={'build_sphinx': BuildDoc} +except ImportError: + cmd_class = None + packages = ['pyreadline','pyreadline.clipboard','pyreadline.configuration', 'pyreadline.console','pyreadline.keysyms','pyreadline.lineeditor', 'pyreadline.modes','pyreadline.test', @@ -35,13 +42,13 @@ license = license, classifiers = classifiers, url = url, -# download_url = download_url, + download_url = download_url, platforms = platforms, keywords = keywords, py_modules = ['readline'], packages = packages, package_data = {'pyreadline':['configuration/*']}, - data_files = [('share/doc/pyreadline', glob.glob("doc/*")), - ] + data_files = [], + cmdclass = cmd_class, )