Merge lp:~gary/lazr.delegates/build-license-changes into lp:~launchpad-pqm/lazr.delegates/devel
- build-license-changes
- Merge into devel
Proposed by
Gary Poster
Status: | Merged |
---|---|
Approved by: | Francis J. Lacoste |
Approved revision: | 4 |
Merged at revision: | not available |
Proposed branch: | lp:~gary/lazr.delegates/build-license-changes |
Merge into: | lp:~launchpad-pqm/lazr.delegates/devel |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~gary/lazr.delegates/build-license-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gary Poster (gary) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Francis J. Lacoste (flacoste) wrote : | # |
On March 24, 2009, Gary Poster wrote:
> Gary Poster has proposed merging
> lp:~gary/lazr.delegates/build-license-changes into lp:lazr.delegates.
>
> Requested reviews:
> LAZR Developers (lazr-developers)
>
> The same changes as for the other lazr packages:
>
> - license specifies v3 of LGPL
>
> - buildout updates
>
status approved
review approve
Nothing to say here.
--
Francis J. Lacoste
<email address hidden>
review:
Approve
- 5. By Gary Poster
-
1.0.1
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2008-12-15 22:21:53 +0000 | |||
3 | +++ .bzrignore 2009-03-24 18:52:52 +0000 | |||
4 | @@ -1,8 +1,11 @@ | |||
5 | 1 | TEST_THIS_REST_BEFORE_REGISTERING.txt | ||
6 | 2 | bin | 1 | bin |
7 | 3 | develop-eggs | 2 | develop-eggs |
9 | 4 | eggs | 3 | .installed.cfg |
10 | 4 | develop-eggs | ||
11 | 5 | parts | 5 | parts |
14 | 6 | src/*.egg-info | 6 | *.egg-info |
15 | 7 | .installed.cfg | 7 | tags |
16 | 8 | TAGS | ||
17 | 9 | build | ||
18 | 10 | *.egg | ||
19 | 8 | dist | 11 | dist |
20 | 9 | 12 | ||
21 | === modified file 'CHANGES.txt' | |||
22 | --- CHANGES.txt 2008-12-15 22:21:53 +0000 | |||
23 | +++ CHANGES.txt 2009-03-24 18:56:04 +0000 | |||
24 | @@ -1,1 +1,16 @@ | |||
25 | 1 | Please see CHANGES.txt in the package. | 1 | Please see CHANGES.txt in the package. |
26 | 2 | |||
27 | 3 | .. | ||
28 | 4 | This file is part of lazr.delegates. | ||
29 | 5 | |||
30 | 6 | lazr.delegates is free software: you can redistribute it and/or modify it | ||
31 | 7 | under the terms of the GNU Lesser General Public License as published by | ||
32 | 8 | the Free Software Foundation, version 3 of the License. | ||
33 | 9 | |||
34 | 10 | lazr.delegates is distributed in the hope that it will be useful, but | ||
35 | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
36 | 12 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
37 | 13 | License for more details. | ||
38 | 14 | |||
39 | 15 | You should have received a copy of the GNU Lesser General Public License | ||
40 | 16 | along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
41 | 2 | 17 | ||
42 | === renamed file 'DEVELOP.txt' => 'HACKING.txt' | |||
43 | --- DEVELOP.txt 2008-12-15 22:21:53 +0000 | |||
44 | +++ HACKING.txt 2009-03-24 19:51:29 +0000 | |||
45 | @@ -1,59 +1,41 @@ | |||
46 | 1 | .. | ||
47 | 2 | This file is part of lazr.delegates. | ||
48 | 3 | |||
49 | 4 | lazr.delegates is free software: you can redistribute it and/or modify it | ||
50 | 5 | under the terms of the GNU Lesser General Public License as published by | ||
51 | 6 | the Free Software Foundation, version 3 of the License. | ||
52 | 7 | |||
53 | 8 | lazr.delegates is distributed in the hope that it will be useful, but | ||
54 | 9 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
55 | 10 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
56 | 11 | License for more details. | ||
57 | 12 | |||
58 | 13 | You should have received a copy of the GNU Lesser General Public License | ||
59 | 14 | along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
60 | 15 | |||
61 | 1 | This project uses zc.buildout for development. | 16 | This project uses zc.buildout for development. |
62 | 2 | 17 | ||
120 | 3 | To develop or run tests, first run ``$DESIRED_PYTHON bootstrap.py`` in this | 18 | ============ |
121 | 4 | directory, where you replace ``$DESIRED_PYTHON`` with the python that should | 19 | Introduction |
122 | 5 | be used to build and run this project. A non-system Python is highly | 20 | ============ |
123 | 6 | recommended, but not required. | 21 | |
124 | 7 | 22 | These are guidelines for hacking on the lazr.delegates project. But first, | |
125 | 8 | Then run ``./bin/buildout``. (NOTE: Ubuntu Intrepid users, see bottom of this | 23 | please see the common hacking guidelines at: |
126 | 9 | document if this generates errors.) | 24 | |
127 | 10 | 25 | http://dev.launchpad.net/Hacking | |
128 | 11 | You can now run tests with ``./bin/test``. Use ``./bin/test --help`` to read | 26 | |
129 | 12 | about the many options. | 27 | |
130 | 13 | 28 | Getting help | |
131 | 14 | To gain access to a Python interpreter with the package and its dependent eggs | 29 | ------------ |
132 | 15 | available, use ``./bin/py``. | 30 | |
133 | 16 | 31 | If you find bugs in this package, you can report them here: | |
134 | 17 | You can generate ctags and idutils files for a variety of editors using | 32 | |
135 | 18 | ``./bin/tags`` (see ``./bin/tags --help``). The advantage of the files | 33 | https://launchpad.net/lazr.delegates |
136 | 19 | generated from this utility is that they include the sourcecode from the eggs | 34 | |
137 | 20 | used in this buildout. | 35 | If you want to discuss this package, join the team and mailing list here: |
138 | 21 | 36 | ||
139 | 22 | To generate distributions, use ``./bin/buildout setup . SETUP_CMD [...]``. | 37 | https://launchpad.net/~lazr-developers |
140 | 23 | That is, you can use ``./bin/buildout setup .`` as if it were | 38 | |
141 | 24 | ``python setup.py``. The intended advantage is easy access to a pristine, | 39 | or send a message to: |
142 | 25 | local version of setuptools. | 40 | |
143 | 26 | 41 | lazr-developers@lists.launchpad.net | |
87 | 27 | Every project using zc.buildout will keep its own collection of eggs by | ||
88 | 28 | default. You may want to cache these eggs, and their downloaded | ||
89 | 29 | distributions, globally. To do so, perform the following instructions. | ||
90 | 30 | |||
91 | 31 | - ``mkdir -p ~/.buildout/eggs`` | ||
92 | 32 | - ``mkdir ~/.buildout/download-cache`` | ||
93 | 33 | - Create ``~/.buildout/default.cfg`` with the following content, replacing | ||
94 | 34 | "$HOME" with the path to your home:: | ||
95 | 35 | |||
96 | 36 | [buildout] | ||
97 | 37 | eggs-directory=$HOME/.buildout/eggs | ||
98 | 38 | download-cache=$HOME/.buildout/download-cache | ||
99 | 39 | |||
100 | 40 | Ubunutu Intrepid Problem | ||
101 | 41 | ======================== | ||
102 | 42 | |||
103 | 43 | Intrepid has a bug working with buildout. You may have to hack to fix it. | ||
104 | 44 | Here's an example of the Python 2.4 version of the hack. | ||
105 | 45 | |||
106 | 46 | $ sudo rm /usr/lib/python2.4/site-packages/GMenuSimpleEditor/*.py | ||
107 | 47 | $ sudo ln | ||
108 | 48 | -s /var/lib/python-support/python2.4/GMenuSimpleEditor/*.py /usr/lib/python2.4/site-packages/GMenuSimpleEditor/ | ||
109 | 49 | |||
110 | 50 | Python 2.5 would need the same kind of fix (replace all three instances of | ||
111 | 51 | "python2.4" with "python2.5" in the above). | ||
112 | 52 | |||
113 | 53 | The author of this document tried an Intrepid upgrade and an aptitude | ||
114 | 54 | reinstall of python-gmenu to no avail before doing the rough-and-tumble change | ||
115 | 55 | described above. | ||
116 | 56 | |||
117 | 57 | See | ||
118 | 58 | https://bugs.edge.launchpad.net/ubuntu/+source/gnome-menus/+bug/301571 and the | ||
119 | 59 | bug linked to it by datakid. | ||
144 | 60 | 42 | ||
145 | === modified file 'MANIFEST.in' | |||
146 | --- MANIFEST.in 2008-12-15 22:21:53 +0000 | |||
147 | +++ MANIFEST.in 2009-03-24 18:52:52 +0000 | |||
148 | @@ -1,2 +1,2 @@ | |||
151 | 1 | include *.txt MANIFEST.in | 1 | exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore |
152 | 2 | recursive-include src *.txt *.py | 2 | prune _bootstrap |
153 | 3 | 3 | ||
154 | === modified file 'README.txt' | |||
155 | --- README.txt 2008-12-15 22:21:53 +0000 | |||
156 | +++ README.txt 2009-03-24 19:51:29 +0000 | |||
157 | @@ -1,1 +1,16 @@ | |||
158 | 1 | Easily write objects that delegate behavior. | 1 | Easily write objects that delegate behavior. |
159 | 2 | |||
160 | 3 | .. | ||
161 | 4 | This file is part of lazr.delegates. | ||
162 | 5 | |||
163 | 6 | lazr.delegates is free software: you can redistribute it and/or modify it | ||
164 | 7 | under the terms of the GNU Lesser General Public License as published by | ||
165 | 8 | the Free Software Foundation, version 3 of the License. | ||
166 | 9 | |||
167 | 10 | lazr.delegates is distributed in the hope that it will be useful, but | ||
168 | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
169 | 12 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
170 | 13 | License for more details. | ||
171 | 14 | |||
172 | 15 | You should have received a copy of the GNU Lesser General Public License | ||
173 | 16 | along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
174 | 2 | 17 | ||
175 | === added directory '_bootstrap' | |||
176 | === added file '_bootstrap/COPYRIGHT.txt' | |||
177 | --- _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000 | |||
178 | +++ _bootstrap/COPYRIGHT.txt 2009-03-24 18:52:52 +0000 | |||
179 | @@ -0,0 +1,9 @@ | |||
180 | 1 | Copyright (c) 2004-2009 Zope Corporation and Contributors. | ||
181 | 2 | All Rights Reserved. | ||
182 | 3 | |||
183 | 4 | This software is subject to the provisions of the Zope Public License, | ||
184 | 5 | Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
185 | 6 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
186 | 7 | WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
187 | 8 | WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
188 | 9 | FOR A PARTICULAR PURPOSE. | ||
189 | 0 | 10 | ||
190 | === added file '_bootstrap/LICENSE.txt' | |||
191 | --- _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000 | |||
192 | +++ _bootstrap/LICENSE.txt 2009-03-24 18:52:52 +0000 | |||
193 | @@ -0,0 +1,54 @@ | |||
194 | 1 | Zope Public License (ZPL) Version 2.1 | ||
195 | 2 | ------------------------------------- | ||
196 | 3 | |||
197 | 4 | A copyright notice accompanies this license document that | ||
198 | 5 | identifies the copyright holders. | ||
199 | 6 | |||
200 | 7 | This license has been certified as open source. It has also | ||
201 | 8 | been designated as GPL compatible by the Free Software | ||
202 | 9 | Foundation (FSF). | ||
203 | 10 | |||
204 | 11 | Redistribution and use in source and binary forms, with or | ||
205 | 12 | without modification, are permitted provided that the | ||
206 | 13 | following conditions are met: | ||
207 | 14 | |||
208 | 15 | 1. Redistributions in source code must retain the | ||
209 | 16 | accompanying copyright notice, this list of conditions, | ||
210 | 17 | and the following disclaimer. | ||
211 | 18 | |||
212 | 19 | 2. Redistributions in binary form must reproduce the accompanying | ||
213 | 20 | copyright notice, this list of conditions, and the | ||
214 | 21 | following disclaimer in the documentation and/or other | ||
215 | 22 | materials provided with the distribution. | ||
216 | 23 | |||
217 | 24 | 3. Names of the copyright holders must not be used to | ||
218 | 25 | endorse or promote products derived from this software | ||
219 | 26 | without prior written permission from the copyright | ||
220 | 27 | holders. | ||
221 | 28 | |||
222 | 29 | 4. The right to distribute this software or to use it for | ||
223 | 30 | any purpose does not give you the right to use | ||
224 | 31 | Servicemarks (sm) or Trademarks (tm) of the copyright | ||
225 | 32 | holders. Use of them is covered by separate agreement | ||
226 | 33 | with the copyright holders. | ||
227 | 34 | |||
228 | 35 | 5. If any files are modified, you must cause the modified | ||
229 | 36 | files to carry prominent notices stating that you changed | ||
230 | 37 | the files and the date of any change. | ||
231 | 38 | |||
232 | 39 | Disclaimer | ||
233 | 40 | |||
234 | 41 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' | ||
235 | 42 | AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
236 | 43 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | ||
237 | 44 | AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
238 | 45 | NO EVENT SHALL THE COPYRIGHT HOLDERS BE | ||
239 | 46 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
240 | 47 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
241 | 48 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
242 | 49 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
243 | 50 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
244 | 51 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
245 | 52 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
246 | 53 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
247 | 54 | DAMAGE. | ||
248 | 0 | \ No newline at end of file | 55 | \ No newline at end of file |
249 | 1 | 56 | ||
250 | === renamed file 'bootstrap.py' => '_bootstrap/bootstrap.py' | |||
251 | === added symlink 'bootstrap.py' | |||
252 | === target is '_bootstrap/bootstrap.py' | |||
253 | === modified file 'buildout.cfg' | |||
254 | --- buildout.cfg 2008-12-15 22:21:53 +0000 | |||
255 | +++ buildout.cfg 2009-03-24 19:51:29 +0000 | |||
256 | @@ -2,6 +2,7 @@ | |||
257 | 2 | parts = | 2 | parts = |
258 | 3 | interpreter | 3 | interpreter |
259 | 4 | test | 4 | test |
260 | 5 | docs | ||
261 | 5 | tags | 6 | tags |
262 | 6 | unzip = true | 7 | unzip = true |
263 | 7 | 8 | ||
264 | @@ -10,7 +11,14 @@ | |||
265 | 10 | [test] | 11 | [test] |
266 | 11 | recipe = zc.recipe.testrunner | 12 | recipe = zc.recipe.testrunner |
267 | 12 | eggs = lazr.delegates | 13 | eggs = lazr.delegates |
269 | 13 | defaults = '--tests-pattern ^tests --exit-with-status'.split() | 14 | defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split() |
270 | 15 | |||
271 | 16 | [docs] | ||
272 | 17 | recipe = z3c.recipe.sphinxdoc | ||
273 | 18 | eggs = lazr.delegates [docs] | ||
274 | 19 | index-doc = README | ||
275 | 20 | default.css = | ||
276 | 21 | layout.html = | ||
277 | 14 | 22 | ||
278 | 15 | [interpreter] | 23 | [interpreter] |
279 | 16 | recipe = zc.recipe.egg | 24 | recipe = zc.recipe.egg |
280 | 17 | 25 | ||
281 | === added file 'ez_setup.py' | |||
282 | --- ez_setup.py 1970-01-01 00:00:00 +0000 | |||
283 | +++ ez_setup.py 2009-03-24 18:52:52 +0000 | |||
284 | @@ -0,0 +1,241 @@ | |||
285 | 1 | #!python | ||
286 | 2 | """Bootstrap setuptools installation | ||
287 | 3 | |||
288 | 4 | If you want to use setuptools in your package's setup.py, just include this | ||
289 | 5 | file in the same directory with it, and add this to the top of your setup.py:: | ||
290 | 6 | |||
291 | 7 | from ez_setup import use_setuptools | ||
292 | 8 | use_setuptools() | ||
293 | 9 | |||
294 | 10 | If you want to require a specific version of setuptools, set a download | ||
295 | 11 | mirror, or use an alternate download directory, you can do so by supplying | ||
296 | 12 | the appropriate options to ``use_setuptools()``. | ||
297 | 13 | |||
298 | 14 | This file can also be run as a script to install or upgrade setuptools. | ||
299 | 15 | """ | ||
300 | 16 | import sys | ||
301 | 17 | DEFAULT_VERSION = "0.6c8" | ||
302 | 18 | DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] | ||
303 | 19 | |||
304 | 20 | md5_data = { | ||
305 | 21 | 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', | ||
306 | 22 | 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', | ||
307 | 23 | 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', | ||
308 | 24 | 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', | ||
309 | 25 | 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', | ||
310 | 26 | 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', | ||
311 | 27 | 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', | ||
312 | 28 | 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', | ||
313 | 29 | 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', | ||
314 | 30 | 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', | ||
315 | 31 | 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', | ||
316 | 32 | 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', | ||
317 | 33 | 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', | ||
318 | 34 | 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', | ||
319 | 35 | 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', | ||
320 | 36 | 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', | ||
321 | 37 | 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', | ||
322 | 38 | 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', | ||
323 | 39 | 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', | ||
324 | 40 | 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', | ||
325 | 41 | 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', | ||
326 | 42 | 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', | ||
327 | 43 | 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', | ||
328 | 44 | 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', | ||
329 | 45 | 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', | ||
330 | 46 | 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', | ||
331 | 47 | 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', | ||
332 | 48 | 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', | ||
333 | 49 | 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', | ||
334 | 50 | 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', | ||
335 | 51 | } | ||
336 | 52 | |||
337 | 53 | import sys, os | ||
338 | 54 | |||
339 | 55 | def _validate_md5(egg_name, data): | ||
340 | 56 | if egg_name in md5_data: | ||
341 | 57 | from md5 import md5 | ||
342 | 58 | digest = md5(data).hexdigest() | ||
343 | 59 | if digest != md5_data[egg_name]: | ||
344 | 60 | print >>sys.stderr, ( | ||
345 | 61 | "md5 validation of %s failed! (Possible download problem?)" | ||
346 | 62 | % egg_name | ||
347 | 63 | ) | ||
348 | 64 | sys.exit(2) | ||
349 | 65 | return data | ||
350 | 66 | |||
351 | 67 | |||
352 | 68 | def use_setuptools( | ||
353 | 69 | version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, | ||
354 | 70 | download_delay=15, min_version=None | ||
355 | 71 | ): | ||
356 | 72 | """Automatically find/download setuptools and make it available on sys.path | ||
357 | 73 | |||
358 | 74 | `version` should be a valid setuptools version number that is available | ||
359 | 75 | as an egg for download under the `download_base` URL (which should end with | ||
360 | 76 | a '/'). `to_dir` is the directory where setuptools will be downloaded, if | ||
361 | 77 | it is not already available. If `download_delay` is specified, it should | ||
362 | 78 | be the number of seconds that will be paused before initiating a download, | ||
363 | 79 | should one be required. If an older version of setuptools is installed, | ||
364 | 80 | this routine will print a message to ``sys.stderr`` and raise SystemExit in | ||
365 | 81 | an attempt to abort the calling script. | ||
366 | 82 | """ | ||
367 | 83 | # Work around a hack in the ez_setup.py file from simplejson==1.7.3. | ||
368 | 84 | if min_version: | ||
369 | 85 | version = min_version | ||
370 | 86 | |||
371 | 87 | was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules | ||
372 | 88 | def do_download(): | ||
373 | 89 | egg = download_setuptools(version, download_base, to_dir, download_delay) | ||
374 | 90 | sys.path.insert(0, egg) | ||
375 | 91 | import setuptools; setuptools.bootstrap_install_from = egg | ||
376 | 92 | try: | ||
377 | 93 | import pkg_resources | ||
378 | 94 | except ImportError: | ||
379 | 95 | return do_download() | ||
380 | 96 | try: | ||
381 | 97 | pkg_resources.require("setuptools>="+version); return | ||
382 | 98 | except pkg_resources.VersionConflict, e: | ||
383 | 99 | if was_imported: | ||
384 | 100 | print >>sys.stderr, ( | ||
385 | 101 | "The required version of setuptools (>=%s) is not available, and\n" | ||
386 | 102 | "can't be installed while this script is running. Please install\n" | ||
387 | 103 | " a more recent version first, using 'easy_install -U setuptools'." | ||
388 | 104 | "\n\n(Currently using %r)" | ||
389 | 105 | ) % (version, e.args[0]) | ||
390 | 106 | sys.exit(2) | ||
391 | 107 | else: | ||
392 | 108 | del pkg_resources, sys.modules['pkg_resources'] # reload ok | ||
393 | 109 | return do_download() | ||
394 | 110 | except pkg_resources.DistributionNotFound: | ||
395 | 111 | return do_download() | ||
396 | 112 | |||
397 | 113 | def download_setuptools( | ||
398 | 114 | version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, | ||
399 | 115 | delay = 15 | ||
400 | 116 | ): | ||
401 | 117 | """Download setuptools from a specified location and return its filename | ||
402 | 118 | |||
403 | 119 | `version` should be a valid setuptools version number that is available | ||
404 | 120 | as an egg for download under the `download_base` URL (which should end | ||
405 | 121 | with a '/'). `to_dir` is the directory where the egg will be downloaded. | ||
406 | 122 | `delay` is the number of seconds to pause before an actual download attempt. | ||
407 | 123 | """ | ||
408 | 124 | import urllib2, shutil | ||
409 | 125 | egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) | ||
410 | 126 | url = download_base + egg_name | ||
411 | 127 | saveto = os.path.join(to_dir, egg_name) | ||
412 | 128 | src = dst = None | ||
413 | 129 | if not os.path.exists(saveto): # Avoid repeated downloads | ||
414 | 130 | try: | ||
415 | 131 | from distutils import log | ||
416 | 132 | if delay: | ||
417 | 133 | log.warn(""" | ||
418 | 134 | --------------------------------------------------------------------------- | ||
419 | 135 | This script requires setuptools version %s to run (even to display | ||
420 | 136 | help). I will attempt to download it for you (from | ||
421 | 137 | %s), but | ||
422 | 138 | you may need to enable firewall access for this script first. | ||
423 | 139 | I will start the download in %d seconds. | ||
424 | 140 | |||
425 | 141 | (Note: if this machine does not have network access, please obtain the file | ||
426 | 142 | |||
427 | 143 | %s | ||
428 | 144 | |||
429 | 145 | and place it in this directory before rerunning this script.) | ||
430 | 146 | ---------------------------------------------------------------------------""", | ||
431 | 147 | version, download_base, delay, url | ||
432 | 148 | ); from time import sleep; sleep(delay) | ||
433 | 149 | log.warn("Downloading %s", url) | ||
434 | 150 | src = urllib2.urlopen(url) | ||
435 | 151 | # Read/write all in one block, so we don't create a corrupt file | ||
436 | 152 | # if the download is interrupted. | ||
437 | 153 | data = _validate_md5(egg_name, src.read()) | ||
438 | 154 | dst = open(saveto,"wb"); dst.write(data) | ||
439 | 155 | finally: | ||
440 | 156 | if src: src.close() | ||
441 | 157 | if dst: dst.close() | ||
442 | 158 | return os.path.realpath(saveto) | ||
443 | 159 | |||
444 | 160 | def main(argv, version=DEFAULT_VERSION): | ||
445 | 161 | """Install or upgrade setuptools and EasyInstall""" | ||
446 | 162 | try: | ||
447 | 163 | import setuptools | ||
448 | 164 | except ImportError: | ||
449 | 165 | egg = None | ||
450 | 166 | try: | ||
451 | 167 | egg = download_setuptools(version, delay=0) | ||
452 | 168 | sys.path.insert(0,egg) | ||
453 | 169 | from setuptools.command.easy_install import main | ||
454 | 170 | return main(list(argv)+[egg]) # we're done here | ||
455 | 171 | finally: | ||
456 | 172 | if egg and os.path.exists(egg): | ||
457 | 173 | os.unlink(egg) | ||
458 | 174 | else: | ||
459 | 175 | if setuptools.__version__ == '0.0.1': | ||
460 | 176 | print >>sys.stderr, ( | ||
461 | 177 | "You have an obsolete version of setuptools installed. Please\n" | ||
462 | 178 | "remove it from your system entirely before rerunning this script." | ||
463 | 179 | ) | ||
464 | 180 | sys.exit(2) | ||
465 | 181 | |||
466 | 182 | req = "setuptools>="+version | ||
467 | 183 | import pkg_resources | ||
468 | 184 | try: | ||
469 | 185 | pkg_resources.require(req) | ||
470 | 186 | except pkg_resources.VersionConflict: | ||
471 | 187 | try: | ||
472 | 188 | from setuptools.command.easy_install import main | ||
473 | 189 | except ImportError: | ||
474 | 190 | from easy_install import main | ||
475 | 191 | main(list(argv)+[download_setuptools(delay=0)]) | ||
476 | 192 | sys.exit(0) # try to force an exit | ||
477 | 193 | else: | ||
478 | 194 | if argv: | ||
479 | 195 | from setuptools.command.easy_install import main | ||
480 | 196 | main(argv) | ||
481 | 197 | else: | ||
482 | 198 | print "Setuptools version",version,"or greater has been installed." | ||
483 | 199 | print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' | ||
484 | 200 | |||
485 | 201 | def update_md5(filenames): | ||
486 | 202 | """Update our built-in md5 registry""" | ||
487 | 203 | |||
488 | 204 | import re | ||
489 | 205 | from md5 import md5 | ||
490 | 206 | |||
491 | 207 | for name in filenames: | ||
492 | 208 | base = os.path.basename(name) | ||
493 | 209 | f = open(name,'rb') | ||
494 | 210 | md5_data[base] = md5(f.read()).hexdigest() | ||
495 | 211 | f.close() | ||
496 | 212 | |||
497 | 213 | data = [" %r: %r,\n" % it for it in md5_data.items()] | ||
498 | 214 | data.sort() | ||
499 | 215 | repl = "".join(data) | ||
500 | 216 | |||
501 | 217 | import inspect | ||
502 | 218 | srcfile = inspect.getsourcefile(sys.modules[__name__]) | ||
503 | 219 | f = open(srcfile, 'rb'); src = f.read(); f.close() | ||
504 | 220 | |||
505 | 221 | match = re.search("\nmd5_data = {\n([^}]+)}", src) | ||
506 | 222 | if not match: | ||
507 | 223 | print >>sys.stderr, "Internal error!" | ||
508 | 224 | sys.exit(2) | ||
509 | 225 | |||
510 | 226 | src = src[:match.start(1)] + repl + src[match.end(1):] | ||
511 | 227 | f = open(srcfile,'w') | ||
512 | 228 | f.write(src) | ||
513 | 229 | f.close() | ||
514 | 230 | |||
515 | 231 | |||
516 | 232 | if __name__=='__main__': | ||
517 | 233 | if len(sys.argv)>2 and sys.argv[1]=='--md5update': | ||
518 | 234 | update_md5(sys.argv[2:]) | ||
519 | 235 | else: | ||
520 | 236 | main(sys.argv[1:]) | ||
521 | 237 | |||
522 | 238 | |||
523 | 239 | |||
524 | 240 | |||
525 | 241 | |||
526 | 0 | 242 | ||
527 | === modified file 'setup.py' (properties changed: -x to +x) | |||
528 | --- setup.py 2008-12-15 22:21:53 +0000 | |||
529 | +++ setup.py 2009-03-24 19:51:29 +0000 | |||
530 | @@ -1,5 +1,25 @@ | |||
533 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | 1 | #!/usr/bin/env python |
534 | 2 | 2 | ||
535 | 3 | # Copyright 2008-2009 Canonical Ltd. All rights reserved. | ||
536 | 4 | # | ||
537 | 5 | # This file is part of lazr.delegates. | ||
538 | 6 | # | ||
539 | 7 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
540 | 8 | # under the terms of the GNU Lesser General Public License as published by | ||
541 | 9 | # the Free Software Foundation, version 3 of the License. | ||
542 | 10 | # | ||
543 | 11 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
544 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
545 | 13 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
546 | 14 | # License for more details. | ||
547 | 15 | # | ||
548 | 16 | # You should have received a copy of the GNU Lesser General Public License | ||
549 | 17 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
550 | 18 | |||
551 | 19 | import ez_setup | ||
552 | 20 | ez_setup.use_setuptools() | ||
553 | 21 | |||
554 | 22 | import sys | ||
555 | 3 | from setuptools import setup, find_packages | 23 | from setuptools import setup, find_packages |
556 | 4 | 24 | ||
557 | 5 | # generic helpers primarily for the long_description | 25 | # generic helpers primarily for the long_description |
558 | @@ -16,9 +36,13 @@ | |||
559 | 16 | return '\n'.join(res) | 36 | return '\n'.join(res) |
560 | 17 | # end generic helpers | 37 | # end generic helpers |
561 | 18 | 38 | ||
562 | 39 | |||
563 | 40 | sys.path.insert(0, 'src') | ||
564 | 41 | from lazr.delegates import __version__ | ||
565 | 42 | |||
566 | 19 | setup( | 43 | setup( |
567 | 20 | name='lazr.delegates', | 44 | name='lazr.delegates', |
569 | 21 | version='1.0b1', | 45 | version=__version__, |
570 | 22 | namespace_packages=['lazr'], | 46 | namespace_packages=['lazr'], |
571 | 23 | packages=find_packages('src'), | 47 | packages=find_packages('src'), |
572 | 24 | package_dir={'':'src'}, | 48 | package_dir={'':'src'}, |
573 | @@ -26,7 +50,7 @@ | |||
574 | 26 | zip_safe=False, | 50 | zip_safe=False, |
575 | 27 | maintainer='LAZR Developers', | 51 | maintainer='LAZR Developers', |
576 | 28 | maintainer_email='lazr-developers@lists.launchpad.net', | 52 | maintainer_email='lazr-developers@lists.launchpad.net', |
578 | 29 | description=open('README.txt').readlines()[0].strip(), | 53 | description=open('README.txt').readline().strip(), |
579 | 30 | long_description=generate( | 54 | long_description=generate( |
580 | 31 | 'src/lazr/delegates/README.txt', | 55 | 'src/lazr/delegates/README.txt', |
581 | 32 | 'src/lazr/delegates/CHANGES.txt'), | 56 | 'src/lazr/delegates/CHANGES.txt'), |
582 | @@ -36,10 +60,17 @@ | |||
583 | 36 | 'zope.interface', | 60 | 'zope.interface', |
584 | 37 | ], | 61 | ], |
585 | 38 | url='https://launchpad.net/lazr.delegates', | 62 | url='https://launchpad.net/lazr.delegates', |
586 | 63 | download_url= 'https://launchpad.net/lazr.delegates/+download', | ||
587 | 39 | classifiers=[ | 64 | classifiers=[ |
588 | 40 | "Development Status :: 5 - Production/Stable", | 65 | "Development Status :: 5 - Production/Stable", |
589 | 41 | "Intended Audience :: Developers", | 66 | "Intended Audience :: Developers", |
590 | 42 | "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", | 67 | "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", |
591 | 43 | "Operating System :: OS Independent", | 68 | "Operating System :: OS Independent", |
592 | 44 | "Programming Language :: Python"], | 69 | "Programming Language :: Python"], |
593 | 70 | extras_require=dict( | ||
594 | 71 | docs=['Sphinx', | ||
595 | 72 | 'z3c.recipe.sphinxdoc'] | ||
596 | 73 | ), | ||
597 | 74 | setup_requires=['eggtestinfo', 'setuptools_bzr'], | ||
598 | 75 | test_suite='lazr.delegates.tests', | ||
599 | 45 | ) | 76 | ) |
600 | 46 | 77 | ||
601 | === modified file 'src/lazr/__init__.py' | |||
602 | --- src/lazr/__init__.py 2008-12-15 22:21:53 +0000 | |||
603 | +++ src/lazr/__init__.py 2009-03-24 19:51:29 +0000 | |||
604 | @@ -1,4 +1,18 @@ | |||
605 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. |
606 | 2 | # | ||
607 | 3 | # This file is part of lazr.delegates. | ||
608 | 4 | # | ||
609 | 5 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
610 | 6 | # under the terms of the GNU Lesser General Public License as published by | ||
611 | 7 | # the Free Software Foundation, version 3 of the License. | ||
612 | 8 | # | ||
613 | 9 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
614 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
615 | 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
616 | 12 | # License for more details. | ||
617 | 13 | # | ||
618 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
619 | 15 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
620 | 2 | 16 | ||
621 | 3 | # this is a namespace package | 17 | # this is a namespace package |
622 | 4 | try: | 18 | try: |
623 | 5 | 19 | ||
624 | === modified file 'src/lazr/delegates/CHANGES.txt' | |||
625 | --- src/lazr/delegates/CHANGES.txt 2008-12-15 22:21:53 +0000 | |||
626 | +++ src/lazr/delegates/CHANGES.txt 2009-03-24 19:51:29 +0000 | |||
627 | @@ -2,7 +2,14 @@ | |||
628 | 2 | Changes | 2 | Changes |
629 | 3 | ======= | 3 | ======= |
630 | 4 | 4 | ||
632 | 5 | 1.0b1 (2008-12-08) | 5 | 1.0.1 (2009-03-24) |
633 | 6 | ================== | 6 | ================== |
634 | 7 | 7 | ||
635 | 8 | - specify only v3 of LGPL | ||
636 | 9 | |||
637 | 10 | - build/developer improvements | ||
638 | 11 | |||
639 | 12 | 1.0 (2008-12-19) | ||
640 | 13 | ================ | ||
641 | 14 | |||
642 | 8 | - Initial release | 15 | - Initial release |
643 | 9 | 16 | ||
644 | === modified file 'src/lazr/delegates/README.txt' | |||
645 | --- src/lazr/delegates/README.txt 2008-12-15 22:21:53 +0000 | |||
646 | +++ src/lazr/delegates/README.txt 2009-03-24 19:51:29 +0000 | |||
647 | @@ -1,3 +1,18 @@ | |||
648 | 1 | .. | ||
649 | 2 | This file is part of lazr.delegates. | ||
650 | 3 | |||
651 | 4 | lazr.delegates is free software: you can redistribute it and/or modify it | ||
652 | 5 | under the terms of the GNU Lesser General Public License as published by | ||
653 | 6 | the Free Software Foundation, version 3 of the License. | ||
654 | 7 | |||
655 | 8 | lazr.delegates is distributed in the hope that it will be useful, but | ||
656 | 9 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
657 | 10 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
658 | 11 | License for more details. | ||
659 | 12 | |||
660 | 13 | You should have received a copy of the GNU Lesser General Public License | ||
661 | 14 | along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
662 | 15 | |||
663 | 1 | The ``lazr.delegates`` Package | 16 | The ``lazr.delegates`` Package |
664 | 2 | ****************************** | 17 | ****************************** |
665 | 3 | 18 | ||
666 | @@ -39,7 +54,7 @@ | |||
667 | 39 | ... baz = 'hi baz!' | 54 | ... baz = 'hi baz!' |
668 | 40 | 55 | ||
669 | 41 | SomeClass can implement IFoo by delegating to an instance of BaseFoo | 56 | SomeClass can implement IFoo by delegating to an instance of BaseFoo |
671 | 42 | stored in the 'context' attribute. Note that ``delagates`` takes the | 57 | stored in the 'context' attribute. Note that ``delegates`` takes the |
672 | 43 | interface as the argument. By default, 'context' is the attribute | 58 | interface as the argument. By default, 'context' is the attribute |
673 | 44 | containing the object to which the interface implementation is | 59 | containing the object to which the interface implementation is |
674 | 45 | delegated. | 60 | delegated. |
675 | @@ -170,3 +185,13 @@ | |||
676 | 170 | Traceback (most recent call last): | 185 | Traceback (most recent call last): |
677 | 171 | ... | 186 | ... |
678 | 172 | NotImplementedError | 187 | NotImplementedError |
679 | 188 | |||
680 | 189 | =============== | ||
681 | 190 | Other Documents | ||
682 | 191 | =============== | ||
683 | 192 | |||
684 | 193 | .. toctree:: | ||
685 | 194 | :glob: | ||
686 | 195 | |||
687 | 196 | * | ||
688 | 197 | docs/* | ||
689 | 173 | 198 | ||
690 | === added file 'src/lazr/delegates/__init__.py' | |||
691 | --- src/lazr/delegates/__init__.py 1970-01-01 00:00:00 +0000 | |||
692 | +++ src/lazr/delegates/__init__.py 2009-03-24 19:51:29 +0000 | |||
693 | @@ -0,0 +1,30 @@ | |||
694 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | ||
695 | 2 | # | ||
696 | 3 | # This file is part of lazr.delegates. | ||
697 | 4 | # | ||
698 | 5 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
699 | 6 | # under the terms of the GNU Lesser General Public License as published by | ||
700 | 7 | # the Free Software Foundation, version 3 of the License. | ||
701 | 8 | # | ||
702 | 9 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
703 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
704 | 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
705 | 12 | # License for more details. | ||
706 | 13 | # | ||
707 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
708 | 15 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
709 | 16 | |||
710 | 17 | """Decorator helpers that simplify class composition.""" | ||
711 | 18 | |||
712 | 19 | __version__ = 1.0 | ||
713 | 20 | |||
714 | 21 | # Re-export in such a way that __version__ can still be imported if | ||
715 | 22 | # dependencies are not yet available. | ||
716 | 23 | try: | ||
717 | 24 | # While we generally frown on "*" imports, this, combined with the fact we | ||
718 | 25 | # only test code from this module, means that we can verify what has been | ||
719 | 26 | # exported. | ||
720 | 27 | from lazr.delegates._delegates import * | ||
721 | 28 | from lazr.delegates._delegates import __all__ | ||
722 | 29 | except ImportError: | ||
723 | 30 | pass | ||
724 | 0 | 31 | ||
725 | === renamed file 'src/lazr/delegates/__init__.py' => 'src/lazr/delegates/_delegates.py' | |||
726 | --- src/lazr/delegates/__init__.py 2008-12-15 22:21:53 +0000 | |||
727 | +++ src/lazr/delegates/_delegates.py 2009-03-24 19:51:29 +0000 | |||
728 | @@ -1,4 +1,18 @@ | |||
729 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. |
730 | 2 | # | ||
731 | 3 | # This file is part of lazr.delegates. | ||
732 | 4 | # | ||
733 | 5 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
734 | 6 | # under the terms of the GNU Lesser General Public License as published by | ||
735 | 7 | # the Free Software Foundation, version 3 of the License. | ||
736 | 8 | # | ||
737 | 9 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
738 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
739 | 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
740 | 12 | # License for more details. | ||
741 | 13 | # | ||
742 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
743 | 15 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
744 | 2 | 16 | ||
745 | 3 | """Decorator helpers that simplify class composition.""" | 17 | """Decorator helpers that simplify class composition.""" |
746 | 4 | 18 | ||
747 | 5 | 19 | ||
748 | === added directory 'src/lazr/delegates/tests' | |||
749 | === added file 'src/lazr/delegates/tests/__init__.py' | |||
750 | --- src/lazr/delegates/tests/__init__.py 1970-01-01 00:00:00 +0000 | |||
751 | +++ src/lazr/delegates/tests/__init__.py 2009-03-24 19:51:29 +0000 | |||
752 | @@ -0,0 +1,16 @@ | |||
753 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | ||
754 | 2 | # | ||
755 | 3 | # This file is part of lazr.delegates. | ||
756 | 4 | # | ||
757 | 5 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
758 | 6 | # under the terms of the GNU Lesser General Public License as published by | ||
759 | 7 | # the Free Software Foundation, version 3 of the License. | ||
760 | 8 | # | ||
761 | 9 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
762 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
763 | 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
764 | 12 | # License for more details. | ||
765 | 13 | # | ||
766 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
767 | 15 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
768 | 16 | """Tests for lazr.delegates""" | ||
769 | 0 | 17 | ||
770 | === renamed file 'src/lazr/delegates/tests.py' => 'src/lazr/delegates/tests/test_docs.py' | |||
771 | --- src/lazr/delegates/tests.py 2008-12-15 22:21:53 +0000 | |||
772 | +++ src/lazr/delegates/tests/test_docs.py 2009-03-24 19:51:29 +0000 | |||
773 | @@ -1,17 +1,51 @@ | |||
775 | 1 | # Copyright 2008 Canonical Ltd. All rights reserved. | 1 | # Copyright 2008-2009 Canonical Ltd. All rights reserved. |
776 | 2 | # | ||
777 | 3 | # This file is part of lazr.delegates | ||
778 | 4 | # | ||
779 | 5 | # lazr.delegates is free software: you can redistribute it and/or modify it | ||
780 | 6 | # under the terms of the GNU Lesser General Public License as published by | ||
781 | 7 | # the Free Software Foundation, version 3 of the License. | ||
782 | 8 | # | ||
783 | 9 | # lazr.delegates is distributed in the hope that it will be useful, but | ||
784 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
785 | 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
786 | 12 | # License for more details. | ||
787 | 13 | # | ||
788 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
789 | 15 | # along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. | ||
790 | 16 | "Test harness for doctests." | ||
791 | 2 | 17 | ||
793 | 3 | """Test harness.""" | 18 | # pylint: disable-msg=E0611,W0142 |
794 | 4 | 19 | ||
795 | 5 | __metaclass__ = type | 20 | __metaclass__ = type |
797 | 6 | __all__ = [] | 21 | __all__ = [ |
798 | 22 | 'additional_tests', | ||
799 | 23 | ] | ||
800 | 7 | 24 | ||
801 | 25 | import atexit | ||
802 | 8 | import doctest | 26 | import doctest |
803 | 27 | import os | ||
804 | 28 | from pkg_resources import ( | ||
805 | 29 | resource_filename, resource_exists, resource_listdir, cleanup_resources) | ||
806 | 9 | import unittest | 30 | import unittest |
807 | 10 | 31 | ||
810 | 11 | 32 | DOCTEST_FLAGS = ( | |
811 | 12 | def test_suite(): | 33 | doctest.ELLIPSIS | |
812 | 34 | doctest.NORMALIZE_WHITESPACE | | ||
813 | 35 | doctest.REPORT_NDIFF) | ||
814 | 36 | |||
815 | 37 | |||
816 | 38 | def additional_tests(): | ||
817 | 39 | "Run the doc tests (README.txt and docs/*, if any exist)" | ||
818 | 40 | doctest_files = [ | ||
819 | 41 | os.path.abspath(resource_filename('lazr.delegates', 'README.txt'))] | ||
820 | 42 | if resource_exists('lazr.delegates', 'docs'): | ||
821 | 43 | for name in resource_listdir('lazr.delegates', 'docs'): | ||
822 | 44 | if name.endswith('.txt'): | ||
823 | 45 | doctest_files.append( | ||
824 | 46 | os.path.abspath( | ||
825 | 47 | resource_filename('lazr.delegates', 'docs/%s' % name))) | ||
826 | 48 | kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS) | ||
827 | 49 | atexit.register(cleanup_resources) | ||
828 | 13 | return unittest.TestSuite(( | 50 | return unittest.TestSuite(( |
833 | 14 | doctest.DocFileSuite( | 51 | doctest.DocFileSuite(*doctest_files, **kwargs))) |
830 | 15 | 'README.txt', | ||
831 | 16 | optionflags=doctest.NORMALIZE_WHITESPACE,), | ||
832 | 17 | )) |
The same changes as for the other lazr packages:
- license specifies v3 of LGPL
- buildout updates
Thanks
Gary