diff options
| -rw-r--r-- | apt/package.py | 7 | ||||
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | debian/python-apt.docs | 1 | ||||
| -rwxr-xr-x | debian/rules | 3 | ||||
| -rwxr-xr-x | setup.py | 29 |
5 files changed, 40 insertions, 3 deletions
diff --git a/apt/package.py b/apt/package.py index 94242e35..70ddbb1a 100644 --- a/apt/package.py +++ b/apt/package.py @@ -244,13 +244,15 @@ class Package(object): return self._records.ShortDesc summary = property(summary) - def description(self, format=True): + def description(self, format=True, useDots=False): """ Return the formated long description according to the Debian policy (Chapter 5.6.13). See http://www.debian.org/doc/debian-policy/ch-controlfields.html for more information. """ + if not format: + return self.rawDescription if not self._lookupRecord(): return "" # get the translated description @@ -289,7 +291,8 @@ class Package(object): else: line = raw_line # Use dots for lists - line = re.sub(r"^(\s*)(\*|0|o|-) ", ur"\1\u2022 ", line, 1) + if useDots: + line = re.sub(r"^(\s*)(\*|0|o|-) ", ur"\1\u2022 ", line, 1) # Add current line to the description desc += line return desc diff --git a/debian/changelog b/debian/changelog index 3c3ae251..160fe7c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,9 @@ python-apt (0.7.9) UNRELEASED; urgency=low - updated to use the new widgets * debian/control: - add suggests for python-gtk2 and python-vte + * setup.py: + - build html/ help of the apt and aptsources modules + into /usr/share/doc/python-apt/html -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 24 Nov 2008 14:30:32 +0100 diff --git a/debian/python-apt.docs b/debian/python-apt.docs index 208050c5..f3c87fdc 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -1,3 +1,4 @@ README apt/README.apt data/templates/README.templates +html/ diff --git a/debian/rules b/debian/rules index c8aff2f9..adaad2a8 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,9 @@ build/python-apt-dbg:: python$$i-dbg ./setup.py build; \ done +build/python-apt:: + pydoc -w + install/python-apt-dbg:: for i in $(cdbs_python_build_versions); do \ python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-apt-dbg; \ @@ -4,7 +4,30 @@ from distutils.core import setup, Extension from distutils.sysconfig import parse_makefile from DistUtilsExtra.command import * -import glob, os, string +import glob +import os +import os.path +import pydoc +import shutil +import string +import sys + +def build_docs(dir="html", modules=["apt","aptsources"]): + htmldir = os.path.join(os.getcwd(), dir) + for d in modules: + for (dirpath, dirnames, filenames) in os.walk(d): + pydoc.writedoc(dirpath.replace("/",".")) + for file in filenames: + if not file.endswith(".py"): + continue + if file in ["__init__.py"]: + continue + pydoc.writedoc(dirpath.replace("/",".")+"."+file.split(".py")[0]) + if not os.path.exists(htmldir): + os.mkdir(htmldir) + for f in glob.glob("*.html"): + shutil.move(f, htmldir) + return True # The apt_pkg module files = map(lambda source: "python/"+source, @@ -29,6 +52,10 @@ for template in glob.glob('data/templates/*.info.in'): source.close() build.close() +# build doc +if sys.argv[1] == "build": + build_docs() + setup(name="python-apt", version="0.6.17", description="Python bindings for APT", |
