~ubuntu-branches/ubuntu/utopic/pdfposter/utopic

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Elena Grandi, Jakub Wilk, Elena Grandi
  • Date: 2013-05-22 10:03:38 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130522100338-26uo6rmqsurfcfzv
Tags: 0.6.0-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Elena Grandi ]
* New upstream release
* Regenerate PDF files from python sources
* Include html documentation
* Updated homepage and author contacts
* debian/control: bump Standards-Version to 3.9.3 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from PDF. :-) Indeed ``pdfposter`` was inspired by ``poster``.
12
12
 
13
13
For more information please refere to the manpage or visit
14
 
the `project homepage <http://pdfposter.origo.ethz.ch/>`_.
 
14
the `project homepage <http://pythonhosted.org/pdftools.pdfposter/>`_.
15
15
"""
16
16
 
17
17
import ez_setup
25
25
except ImportError:
26
26
    py2exe = None
27
27
 
 
28
from distutils.core import Command
 
29
from distutils import log
 
30
import os
 
31
 
 
32
class build_docs(Command):
 
33
    description = "build documentation from rst-files"
 
34
    user_options=[]
 
35
 
 
36
    def initialize_options (self): pass
 
37
    def finalize_options (self):
 
38
        self.docpages = DOCPAGES
 
39
        
 
40
    def run(self):
 
41
        substitutions = ('.. |VERSION| replace:: '
 
42
                         + self.distribution.get_version())
 
43
        for writer, rstfilename, outfilename in self.docpages:
 
44
            distutils.dir_util.mkpath(os.path.dirname(outfilename))
 
45
            log.info("creating %s page %s", writer, outfilename)
 
46
            if not self.dry_run:
 
47
                try:
 
48
                    rsttext = open(rstfilename).read()
 
49
                except IOError, e:
 
50
                    sys.exit(e)
 
51
                rsttext = '\n'.join((substitutions, rsttext))
 
52
                # docutils.core does not offer easy reading from a
 
53
                # string into a file, so we need to do it ourself :-(
 
54
                doc = docutils.core.publish_string(source=rsttext,
 
55
                                                   source_path=rstfilename,
 
56
                                                   writer_name=writer)
 
57
                try:
 
58
                    rsttext = open(outfilename, 'w').write(doc)
 
59
                except IOError, e:
 
60
                    sys.exit(e)
 
61
 
 
62
cmdclass = {}
 
63
 
 
64
try:
 
65
    import docutils.core
 
66
    import docutils.io
 
67
    import docutils.writers.manpage
 
68
    import distutils.command.build
 
69
    distutils.command.build.build.sub_commands.append(('build_docs', None))
 
70
    cmdclass['build_docs'] = build_docs
 
71
except ImportError:
 
72
    log.warn("docutils not installed, can not build man pages. "
 
73
             "Using pre-build ones.")
 
74
 
 
75
DOCPAGES = (
 
76
    ('manpage', 'pdfposter.rst', 'docs/pdfposter.1'),
 
77
    ('html', 'pdfposter.rst', 'docs/pdfposter.html'),
 
78
    )
 
79
 
28
80
if py2exe:
29
81
    resources = {
30
82
        #'other_resources': [(u"VERSIONTAG",1,myrevisionstring)],
37
89
        })
38
90
 
39
91
setup(
 
92
    cmdclass=cmdclass,
40
93
    name = "pdftools.pdfposter",
41
 
    version = "0.5.0",
 
94
    version = "0.6.0",
42
95
    #scripts = ['pdfposter'],
43
96
    install_requires = ['pyPdf>1.10'],
44
97
 
53
106
 
54
107
    # metadata for upload to PyPI
55
108
    author = "Hartmut Goebel",
56
 
    author_email = "h.goebel@goebel-consult.de",
 
109
    author_email = "h.goebel@crazy-compilers.com",
57
110
    description = "Scale and tile PDF images/pages to print on multiple pages.",
58
111
    long_description = __doc__,
59
112
    license = "GPL 3.0",
60
113
    keywords = "pdf poster",
61
 
    url          = "http://pdfposter.origo.ethz.ch/",
62
 
    download_url = "http://pdfposter.origo.ethz.ch/download",
 
114
    url          = "http://pythonhosted.org/pdftools.pdfposter/",
 
115
    download_url = "http://pypi.python.org/pypi/pdftools.pdfposter/",
63
116
    classifiers = [
64
117
    'Development Status :: 5 - Production/Stable',
65
118
    'Environment :: Console',
93
146
        },
94
147
    **additional_keywords
95
148
)
96
 
 
97
 
import glob, os
98
 
for fn in glob.glob('*.egg-link'): os.remove(fn)