Mercurial > genshi > genshi-test
annotate setup.py @ 401:9582328f82e5
Make the `Markup` class available by default in template expressions. Closes #67.
author | cmlenz |
---|---|
date | Thu, 18 Jan 2007 15:41:47 +0000 |
parents | ebc7c1a3bc4d |
children | a0711da164ac |
rev | line source |
---|---|
1 | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | |
3 # | |
66
822089ae65ce
Switch copyright to Edgewall and URLs to markup.edgewall.org.
cmlenz
parents:
27
diff
changeset
|
4 # Copyright (C) 2006 Edgewall Software |
1 | 5 # All rights reserved. |
6 # | |
7 # This software is licensed as described in the file COPYING, which | |
8 # you should have received as part of this distribution. The terms | |
230 | 9 # are also available at http://genshi.edgewall.org/wiki/License. |
1 | 10 # |
11 # This software consists of voluntary contributions made by many | |
12 # individuals. For the exact contribution history, see the revision | |
230 | 13 # history and logs, available at http://genshi.edgewall.org/log/. |
1 | 14 |
382
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
15 from distutils.cmd import Command |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
16 import doctest |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
17 from glob import glob |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
18 import os |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
19 try: |
145
56d534eb53f9
* Fix error in expression evaluation when the expression evaluates to an iterable that does not produce event tuples.
cmlenz
parents:
129
diff
changeset
|
20 from setuptools import setup |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
21 except ImportError: |
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
22 from distutils.core import setup |
1 | 23 |
382
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
24 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
25 class build_doc(Command): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
26 description = 'Builds the documentation' |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
27 user_options = [] |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
28 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
29 def initialize_options(self): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
30 pass |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
31 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
32 def finalize_options(self): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
33 pass |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
34 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
35 def run(self): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
36 from docutils.core import publish_cmdline |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
37 conf = os.path.join('doc', 'docutils.conf') |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
38 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
39 for source in glob('doc/*.txt'): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
40 dest = os.path.splitext(source)[0] + '.html' |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
41 if not os.path.exists(dest) or \ |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
42 os.path.getmtime(dest) < os.path.getmtime(source): |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
43 print 'building documentation file %s' % dest |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
44 publish_cmdline(writer_name='html', |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
45 argv=['--config=%s' % conf, source, dest]) |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
46 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
47 |
394 | 48 class test_doc(Command): |
49 description = 'Tests the code examples in the documentation' | |
50 user_options = [] | |
51 | |
52 def initialize_options(self): | |
53 pass | |
54 | |
55 def finalize_options(self): | |
56 pass | |
57 | |
58 def run(self): | |
59 for filename in glob('doc/*.txt'): | |
60 print 'testing documentation file %s' % filename | |
61 doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS) | |
62 | |
63 | |
1 | 64 setup( |
230 | 65 name = 'Genshi', |
255 | 66 version = '0.4', |
230 | 67 description = 'A toolkit for stream-based generation of output for the web', |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
68 long_description = \ |
230 | 69 """Genshi is a Python library that provides an integrated set of components |
70 for parsing, generating, and processing HTML, XML or other textual content for | |
71 output generation on the web. The major feature is a template language, which | |
72 is heavily inspired by Kid.""", | |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
73 author = 'Edgewall Software', |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
74 author_email = 'info@edgewall.org', |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
75 license = 'BSD', |
230 | 76 url = 'http://genshi.edgewall.org/', |
256 | 77 download_url = 'http://genshi.edgewall.org/wiki/Download', |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
78 zip_safe = True, |
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
79 |
124
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
80 classifiers = [ |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
81 'Development Status :: 4 - Beta', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
82 'Environment :: Web Environment', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
83 'Intended Audience :: Developers', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
84 'License :: OSI Approved :: BSD License', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
85 'Operating System :: OS Independent', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
86 'Programming Language :: Python', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
87 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
88 'Topic :: Software Development :: Libraries :: Python Modules', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
89 'Topic :: Text Processing :: Markup :: HTML', |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
90 'Topic :: Text Processing :: Markup :: XML' |
9a2acebe84f7
Add Trove classifiers and download URL to `setup.py`.
cmlenz
parents:
84
diff
changeset
|
91 ], |
215 | 92 keywords = ['python.templating.engines'], |
336
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
93 packages = ['genshi', 'genshi.template'], |
230 | 94 test_suite = 'genshi.tests.suite', |
84
894576e2b813
Make dependency of the setup script on setuptools optional.
cmlenz
parents:
66
diff
changeset
|
95 |
148
a0a52cf4e4de
Added changelog file, plus some README and setup tweaks.
cmlenz
parents:
145
diff
changeset
|
96 extras_require = {'plugin': ['setuptools>=0.6a2']}, |
4
f8612f05af99
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
97 entry_points = """ |
f8612f05af99
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
98 [python.templating.engines] |
336
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
99 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
100 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] |
5f2c7782cd8a
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
265
diff
changeset
|
101 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] |
4
f8612f05af99
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
1
diff
changeset
|
102 """, |
382
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
103 |
d7da3fba7faf
* Added documentation for the various stream event kinds.
cmlenz
parents:
336
diff
changeset
|
104 cmdclass={'build_doc': build_doc, 'test_doc': test_doc} |
1 | 105 ) |