Merge lp:~logan/ubuntu/quantal/zconfig/new-upstream into lp:ubuntu/quantal/zconfig
- Quantal (12.10)
- new-upstream
- Merge into quantal
Proposed by
Logan Rosen
Status: | Merged |
---|---|
Merged at revision: | 9 |
Proposed branch: | lp:~logan/ubuntu/quantal/zconfig/new-upstream |
Merge into: | lp:ubuntu/quantal/zconfig |
Diff against target: |
1219 lines (+557/-189) 24 files modified
NEWS.txt (+26/-0) PKG-INFO (+28/-2) ZConfig.egg-info/PKG-INFO (+28/-2) ZConfig/cfgparser.py (+2/-1) ZConfig/components/basic/tests/test_mapping.py (+4/-3) ZConfig/components/logger/loghandler.py (+6/-2) ZConfig/components/logger/tests/test_logger.py (+112/-93) ZConfig/datatypes.py (+37/-6) ZConfig/tests/support.py (+4/-2) ZConfig/tests/test_cfgimports.py (+2/-1) ZConfig/tests/test_cmdline.py (+4/-4) ZConfig/tests/test_config.py (+3/-1) ZConfig/tests/test_cookbook.py (+2/-3) ZConfig/tests/test_datatypes.py (+12/-1) ZConfig/tests/test_loader.py (+2/-2) ZConfig/tests/test_readme.py (+12/-10) ZConfig/tests/test_schema.py (+2/-2) ZConfig/tests/test_schemaless.py (+1/-4) bootstrap.py (+237/-29) buildout.cfg (+8/-3) debian/changelog (+7/-0) debian/control (+1/-1) doc/zconfig.tex (+7/-5) setup.py (+10/-12) |
To merge this branch: | bzr merge lp:~logan/ubuntu/quantal/zconfig/new-upstream |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Barry Warsaw (community) | Approve | ||
Ubuntu branches | Pending | ||
Review via email: mp+115046@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'NEWS.txt' | |||
2 | --- NEWS.txt 2011-03-24 18:29:45 +0000 | |||
3 | +++ NEWS.txt 2012-07-15 23:54:18 +0000 | |||
4 | @@ -3,6 +3,32 @@ | |||
5 | 3 | ========================== | 3 | ========================== |
6 | 4 | 4 | ||
7 | 5 | 5 | ||
8 | 6 | ZConfig 2.9.3 (2012-06-25) | ||
9 | 7 | -------------------------- | ||
10 | 8 | |||
11 | 9 | - Fixed: port values of 0 weren't allowed. Port 0 is used to request | ||
12 | 10 | an ephemeral port. | ||
13 | 11 | |||
14 | 12 | ZConfig 2.9.2 (2012-02-11) | ||
15 | 13 | -------------------------- | ||
16 | 14 | |||
17 | 15 | - Adjust test classes to avoid base classes being considered separate | ||
18 | 16 | test cases by (at least) the "nose" test runner. | ||
19 | 17 | |||
20 | 18 | |||
21 | 19 | ZConfig 2.9.1 (2012-02-11) | ||
22 | 20 | -------------------------- | ||
23 | 21 | |||
24 | 22 | - Make FileHandler.reopen thread safe. | ||
25 | 23 | |||
26 | 24 | |||
27 | 25 | ZConfig 2.9.0 (2011-03-22) | ||
28 | 26 | -------------------------- | ||
29 | 27 | |||
30 | 28 | - Allow identical redefinition of ``%define`` names. | ||
31 | 29 | - Added support for IPv6 addresses. | ||
32 | 30 | |||
33 | 31 | |||
34 | 6 | ZConfig 2.8.0 (2010-04-13) | 32 | ZConfig 2.8.0 (2010-04-13) |
35 | 7 | -------------------------- | 33 | -------------------------- |
36 | 8 | 34 | ||
37 | 9 | 35 | ||
38 | === modified file 'PKG-INFO' | |||
39 | --- PKG-INFO 2011-03-24 18:29:45 +0000 | |||
40 | +++ PKG-INFO 2012-07-15 23:54:18 +0000 | |||
41 | @@ -1,6 +1,6 @@ | |||
42 | 1 | Metadata-Version: 1.0 | 1 | Metadata-Version: 1.0 |
43 | 2 | Name: ZConfig | 2 | Name: ZConfig |
45 | 3 | Version: 2.8.0 | 3 | Version: 2.9.3 |
46 | 4 | Summary: Structured Configuration Library | 4 | Summary: Structured Configuration Library |
47 | 5 | Home-page: http://www.zope.org/Members/fdrake/zconfig/ | 5 | Home-page: http://www.zope.org/Members/fdrake/zconfig/ |
48 | 6 | Author: Zope Foundation and Contributors | 6 | Author: Zope Foundation and Contributors |
49 | @@ -107,6 +107,32 @@ | |||
50 | 107 | ========================== | 107 | ========================== |
51 | 108 | 108 | ||
52 | 109 | 109 | ||
53 | 110 | ZConfig 2.9.3 (2012-06-25) | ||
54 | 111 | -------------------------- | ||
55 | 112 | |||
56 | 113 | - Fixed: port values of 0 weren't allowed. Port 0 is used to request | ||
57 | 114 | an ephemeral port. | ||
58 | 115 | |||
59 | 116 | ZConfig 2.9.2 (2012-02-11) | ||
60 | 117 | -------------------------- | ||
61 | 118 | |||
62 | 119 | - Adjust test classes to avoid base classes being considered separate | ||
63 | 120 | test cases by (at least) the "nose" test runner. | ||
64 | 121 | |||
65 | 122 | |||
66 | 123 | ZConfig 2.9.1 (2012-02-11) | ||
67 | 124 | -------------------------- | ||
68 | 125 | |||
69 | 126 | - Make FileHandler.reopen thread safe. | ||
70 | 127 | |||
71 | 128 | |||
72 | 129 | ZConfig 2.9.0 (2011-03-22) | ||
73 | 130 | -------------------------- | ||
74 | 131 | |||
75 | 132 | - Allow identical redefinition of ``%define`` names. | ||
76 | 133 | - Added support for IPv6 addresses. | ||
77 | 134 | |||
78 | 135 | |||
79 | 110 | ZConfig 2.8.0 (2010-04-13) | 136 | ZConfig 2.8.0 (2010-04-13) |
80 | 111 | -------------------------- | 137 | -------------------------- |
81 | 112 | 138 | ||
82 | @@ -320,4 +346,4 @@ | |||
83 | 320 | Classifier: Programming Language :: Python :: 2.4 | 346 | Classifier: Programming Language :: Python :: 2.4 |
84 | 321 | Classifier: Programming Language :: Python :: 2.5 | 347 | Classifier: Programming Language :: Python :: 2.5 |
85 | 322 | Classifier: Programming Language :: Python :: 2.6 | 348 | Classifier: Programming Language :: Python :: 2.6 |
87 | 323 | Classifier: Topic :: Software Development :: Libraries :: Python Modules | 349 | Classifier: Programming Language :: Python :: 2.7 |
88 | 324 | 350 | ||
89 | === modified file 'ZConfig.egg-info/PKG-INFO' | |||
90 | --- ZConfig.egg-info/PKG-INFO 2011-03-24 18:29:45 +0000 | |||
91 | +++ ZConfig.egg-info/PKG-INFO 2012-07-15 23:54:18 +0000 | |||
92 | @@ -1,6 +1,6 @@ | |||
93 | 1 | Metadata-Version: 1.0 | 1 | Metadata-Version: 1.0 |
94 | 2 | Name: ZConfig | 2 | Name: ZConfig |
96 | 3 | Version: 2.8.0 | 3 | Version: 2.9.3 |
97 | 4 | Summary: Structured Configuration Library | 4 | Summary: Structured Configuration Library |
98 | 5 | Home-page: http://www.zope.org/Members/fdrake/zconfig/ | 5 | Home-page: http://www.zope.org/Members/fdrake/zconfig/ |
99 | 6 | Author: Zope Foundation and Contributors | 6 | Author: Zope Foundation and Contributors |
100 | @@ -107,6 +107,32 @@ | |||
101 | 107 | ========================== | 107 | ========================== |
102 | 108 | 108 | ||
103 | 109 | 109 | ||
104 | 110 | ZConfig 2.9.3 (2012-06-25) | ||
105 | 111 | -------------------------- | ||
106 | 112 | |||
107 | 113 | - Fixed: port values of 0 weren't allowed. Port 0 is used to request | ||
108 | 114 | an ephemeral port. | ||
109 | 115 | |||
110 | 116 | ZConfig 2.9.2 (2012-02-11) | ||
111 | 117 | -------------------------- | ||
112 | 118 | |||
113 | 119 | - Adjust test classes to avoid base classes being considered separate | ||
114 | 120 | test cases by (at least) the "nose" test runner. | ||
115 | 121 | |||
116 | 122 | |||
117 | 123 | ZConfig 2.9.1 (2012-02-11) | ||
118 | 124 | -------------------------- | ||
119 | 125 | |||
120 | 126 | - Make FileHandler.reopen thread safe. | ||
121 | 127 | |||
122 | 128 | |||
123 | 129 | ZConfig 2.9.0 (2011-03-22) | ||
124 | 130 | -------------------------- | ||
125 | 131 | |||
126 | 132 | - Allow identical redefinition of ``%define`` names. | ||
127 | 133 | - Added support for IPv6 addresses. | ||
128 | 134 | |||
129 | 135 | |||
130 | 110 | ZConfig 2.8.0 (2010-04-13) | 136 | ZConfig 2.8.0 (2010-04-13) |
131 | 111 | -------------------------- | 137 | -------------------------- |
132 | 112 | 138 | ||
133 | @@ -320,4 +346,4 @@ | |||
134 | 320 | Classifier: Programming Language :: Python :: 2.4 | 346 | Classifier: Programming Language :: Python :: 2.4 |
135 | 321 | Classifier: Programming Language :: Python :: 2.5 | 347 | Classifier: Programming Language :: Python :: 2.5 |
136 | 322 | Classifier: Programming Language :: Python :: 2.6 | 348 | Classifier: Programming Language :: Python :: 2.6 |
138 | 323 | Classifier: Topic :: Software Development :: Libraries :: Python Modules | 349 | Classifier: Programming Language :: Python :: 2.7 |
139 | 324 | 350 | ||
140 | === modified file 'ZConfig/cfgparser.py' | |||
141 | --- ZConfig/cfgparser.py 2011-03-24 18:29:45 +0000 | |||
142 | +++ ZConfig/cfgparser.py 2012-07-15 23:54:18 +0000 | |||
143 | @@ -160,7 +160,8 @@ | |||
144 | 160 | if len(parts) == 2: | 160 | if len(parts) == 2: |
145 | 161 | defvalue = parts[1] | 161 | defvalue = parts[1] |
146 | 162 | if self.defines.has_key(defname): | 162 | if self.defines.has_key(defname): |
148 | 163 | self.error("cannot redefine " + `defname`) | 163 | if self.defines[defname] != defvalue: |
149 | 164 | self.error("cannot redefine " + `defname`) | ||
150 | 164 | if not isname(defname): | 165 | if not isname(defname): |
151 | 165 | self.error("not a substitution legal name: " + `defname`) | 166 | self.error("not a substitution legal name: " + `defname`) |
152 | 166 | self.defines[defname] = self.replace(defvalue) | 167 | self.defines[defname] = self.replace(defvalue) |
153 | 167 | 168 | ||
154 | === modified file 'ZConfig/components/basic/tests/test_mapping.py' | |||
155 | --- ZConfig/components/basic/tests/test_mapping.py 2011-03-24 18:29:45 +0000 | |||
156 | +++ ZConfig/components/basic/tests/test_mapping.py 2012-07-15 23:54:18 +0000 | |||
157 | @@ -15,10 +15,9 @@ | |||
158 | 15 | """Tests of the 'basic' section types provided as part of | 15 | """Tests of the 'basic' section types provided as part of |
159 | 16 | ZConfig.components.basic.""" | 16 | ZConfig.components.basic.""" |
160 | 17 | 17 | ||
161 | 18 | import ZConfig.tests.support | ||
162 | 18 | import unittest | 19 | import unittest |
163 | 19 | 20 | ||
164 | 20 | from ZConfig.tests import support | ||
165 | 21 | |||
166 | 22 | 21 | ||
167 | 23 | SIMPLE_SCHEMA = '''\ | 22 | SIMPLE_SCHEMA = '''\ |
168 | 24 | <schema> | 23 | <schema> |
169 | @@ -43,7 +42,9 @@ | |||
170 | 43 | ''' | 42 | ''' |
171 | 44 | 43 | ||
172 | 45 | 44 | ||
174 | 46 | class BasicSectionTypeTestCase(support.TestBase): | 45 | class BasicSectionTypeTestCase( |
175 | 46 | ZConfig.tests.support.TestHelper, unittest.TestCase): | ||
176 | 47 | |||
177 | 47 | schema = None | 48 | schema = None |
178 | 48 | 49 | ||
179 | 49 | def setUp(self): | 50 | def setUp(self): |
180 | 50 | 51 | ||
181 | === modified file 'ZConfig/components/logger/loghandler.py' | |||
182 | --- ZConfig/components/logger/loghandler.py 2011-03-24 18:29:45 +0000 | |||
183 | +++ ZConfig/components/logger/loghandler.py 2012-07-15 23:54:18 +0000 | |||
184 | @@ -84,8 +84,12 @@ | |||
185 | 84 | _remove_from_reopenable(self._wr) | 84 | _remove_from_reopenable(self._wr) |
186 | 85 | 85 | ||
187 | 86 | def reopen(self): | 86 | def reopen(self): |
190 | 87 | self.stream.close() | 87 | self.acquire() |
191 | 88 | self.stream = open(self.baseFilename, self.mode) | 88 | try: |
192 | 89 | self.stream.close() | ||
193 | 90 | self.stream = open(self.baseFilename, self.mode) | ||
194 | 91 | finally: | ||
195 | 92 | self.release() | ||
196 | 89 | 93 | ||
197 | 90 | 94 | ||
198 | 91 | class Win32FileHandler(FileHandler): | 95 | class Win32FileHandler(FileHandler): |
199 | 92 | 96 | ||
200 | === modified file 'ZConfig/components/logger/tests/test_logger.py' | |||
201 | --- ZConfig/components/logger/tests/test_logger.py 2011-03-24 18:29:45 +0000 | |||
202 | +++ ZConfig/components/logger/tests/test_logger.py 2012-07-15 23:54:18 +0000 | |||
203 | @@ -41,7 +41,10 @@ | |||
204 | 41 | return sio.getvalue() + "... Don't panic!" | 41 | return sio.getvalue() + "... Don't panic!" |
205 | 42 | 42 | ||
206 | 43 | 43 | ||
208 | 44 | class LoggingTestBase(unittest.TestCase): | 44 | class LoggingTestHelper: |
209 | 45 | |||
210 | 46 | # Not derived from unittest.TestCase; some test runners seem to | ||
211 | 47 | # think that means this class contains tests. | ||
212 | 45 | 48 | ||
213 | 46 | # XXX This tries to save and restore the state of logging around | 49 | # XXX This tries to save and restore the state of logging around |
214 | 47 | # the test. Somewhat surgical; there may be a better way. | 50 | # the test. Somewhat surgical; there may be a better way. |
215 | @@ -100,7 +103,7 @@ | |||
216 | 100 | return conf | 103 | return conf |
217 | 101 | 104 | ||
218 | 102 | 105 | ||
220 | 103 | class TestConfig(LoggingTestBase): | 106 | class TestConfig(LoggingTestHelper, unittest.TestCase): |
221 | 104 | 107 | ||
222 | 105 | _schematext = """ | 108 | _schematext = """ |
223 | 106 | <schema> | 109 | <schema> |
224 | @@ -404,10 +407,12 @@ | |||
225 | 404 | return logger | 407 | return logger |
226 | 405 | 408 | ||
227 | 406 | 409 | ||
229 | 407 | class TestReopeningLogfilesBase(LoggingTestBase): | 410 | class TestReopeningRotatingLogfiles(LoggingTestHelper, unittest.TestCase): |
230 | 408 | 411 | ||
231 | 409 | # These tests should not be run on Windows. | 412 | # These tests should not be run on Windows. |
232 | 410 | 413 | ||
233 | 414 | handler_factory = loghandler.RotatingFileHandler | ||
234 | 415 | |||
235 | 411 | _schematext = """ | 416 | _schematext = """ |
236 | 412 | <schema> | 417 | <schema> |
237 | 413 | <import package='ZConfig.components.logger'/> | 418 | <import package='ZConfig.components.logger'/> |
238 | @@ -415,6 +420,40 @@ | |||
239 | 415 | </schema> | 420 | </schema> |
240 | 416 | """ | 421 | """ |
241 | 417 | 422 | ||
242 | 423 | _sampleconfig_template = """ | ||
243 | 424 | <logger> | ||
244 | 425 | name foo.bar | ||
245 | 426 | <logfile> | ||
246 | 427 | path %(path0)s | ||
247 | 428 | level debug | ||
248 | 429 | max-size 1mb | ||
249 | 430 | old-files 10 | ||
250 | 431 | </logfile> | ||
251 | 432 | <logfile> | ||
252 | 433 | path %(path1)s | ||
253 | 434 | level info | ||
254 | 435 | max-size 1mb | ||
255 | 436 | old-files 3 | ||
256 | 437 | </logfile> | ||
257 | 438 | <logfile> | ||
258 | 439 | path %(path1)s | ||
259 | 440 | level info | ||
260 | 441 | when D | ||
261 | 442 | old-files 3 | ||
262 | 443 | </logfile> | ||
263 | 444 | </logger> | ||
264 | 445 | |||
265 | 446 | <logger> | ||
266 | 447 | name bar.foo | ||
267 | 448 | <logfile> | ||
268 | 449 | path %(path2)s | ||
269 | 450 | level info | ||
270 | 451 | max-size 10mb | ||
271 | 452 | old-files 10 | ||
272 | 453 | </logfile> | ||
273 | 454 | </logger> | ||
274 | 455 | """ | ||
275 | 456 | |||
276 | 418 | def test_filehandler_reopen(self): | 457 | def test_filehandler_reopen(self): |
277 | 419 | 458 | ||
278 | 420 | def mkrecord(msg): | 459 | def mkrecord(msg): |
279 | @@ -458,7 +497,59 @@ | |||
280 | 458 | self.assert_("message 4" in text2) | 497 | self.assert_("message 4" in text2) |
281 | 459 | self.assert_("message 5" in text3) | 498 | self.assert_("message 5" in text3) |
282 | 460 | 499 | ||
284 | 461 | class TestReopeningLogfiles(TestReopeningLogfilesBase): | 500 | def test_logfile_reopening(self): |
285 | 501 | # | ||
286 | 502 | # This test only applies to the simple logfile reopening; it | ||
287 | 503 | # doesn't work the same way as the rotating logfile handler. | ||
288 | 504 | # | ||
289 | 505 | paths = self.mktemp(), self.mktemp(), self.mktemp() | ||
290 | 506 | d = { | ||
291 | 507 | "path0": paths[0], | ||
292 | 508 | "path1": paths[1], | ||
293 | 509 | "path2": paths[2], | ||
294 | 510 | } | ||
295 | 511 | text = self._sampleconfig_template % d | ||
296 | 512 | conf = self.get_config(text) | ||
297 | 513 | self.assertEqual(len(conf.loggers), 2) | ||
298 | 514 | # Build the loggers from the configuration, and write to them: | ||
299 | 515 | conf.loggers[0]().info("message 1") | ||
300 | 516 | conf.loggers[1]().info("message 2") | ||
301 | 517 | # | ||
302 | 518 | # We expect this to re-open the original filenames, so we'll | ||
303 | 519 | # have six files instead of three. | ||
304 | 520 | # | ||
305 | 521 | loghandler.reopenFiles() | ||
306 | 522 | # | ||
307 | 523 | # Write to them again: | ||
308 | 524 | conf.loggers[0]().info("message 3") | ||
309 | 525 | conf.loggers[1]().info("message 4") | ||
310 | 526 | # | ||
311 | 527 | # We expect this to re-open the original filenames, so we'll | ||
312 | 528 | # have nine files instead of six. | ||
313 | 529 | # | ||
314 | 530 | loghandler.reopenFiles() | ||
315 | 531 | # | ||
316 | 532 | # Write to them again: | ||
317 | 533 | conf.loggers[0]().info("message 5") | ||
318 | 534 | conf.loggers[1]().info("message 6") | ||
319 | 535 | # | ||
320 | 536 | # We should now have all nine files: | ||
321 | 537 | for fn in paths: | ||
322 | 538 | fn1 = fn + ".1" | ||
323 | 539 | fn2 = fn + ".2" | ||
324 | 540 | self.assert_(os.path.isfile(fn), "%r must exist" % fn) | ||
325 | 541 | self.assert_(os.path.isfile(fn1), "%r must exist" % fn1) | ||
326 | 542 | self.assert_(os.path.isfile(fn2), "%r must exist" % fn2) | ||
327 | 543 | # | ||
328 | 544 | # Clean up: | ||
329 | 545 | for logger in conf.loggers: | ||
330 | 546 | logger = logger() | ||
331 | 547 | for handler in logger.handlers[:]: | ||
332 | 548 | logger.removeHandler(handler) | ||
333 | 549 | handler.close() | ||
334 | 550 | |||
335 | 551 | |||
336 | 552 | class TestReopeningLogfiles(TestReopeningRotatingLogfiles): | ||
337 | 462 | 553 | ||
338 | 463 | handler_factory = loghandler.FileHandler | 554 | handler_factory = loghandler.FileHandler |
339 | 464 | 555 | ||
340 | @@ -537,95 +628,23 @@ | |||
341 | 537 | logger.removeHandler(handler) | 628 | logger.removeHandler(handler) |
342 | 538 | handler.close() | 629 | handler.close() |
343 | 539 | 630 | ||
433 | 540 | 631 | def test_filehandler_reopen_thread_safety(self): | |
434 | 541 | class TestReopeningRotatingLogfiles(TestReopeningLogfilesBase): | 632 | # The reopen method needs to do locking to avoid a race condition |
435 | 542 | 633 | # with emit calls. For simplicity we replace the "acquire" and | |
436 | 543 | _sampleconfig_template = """ | 634 | # "release" methods with dummies that record calls to them. |
437 | 544 | <logger> | 635 | |
438 | 545 | name foo.bar | 636 | fn = self.mktemp() |
439 | 546 | <logfile> | 637 | h = self.handler_factory(fn) |
440 | 547 | path %(path0)s | 638 | |
441 | 548 | level debug | 639 | calls = [] |
442 | 549 | max-size 1mb | 640 | h.acquire = lambda: calls.append("acquire") |
443 | 550 | old-files 10 | 641 | h.release = lambda: calls.append("release") |
444 | 551 | </logfile> | 642 | |
445 | 552 | <logfile> | 643 | h.reopen() |
446 | 553 | path %(path1)s | 644 | h.close() |
447 | 554 | level info | 645 | |
448 | 555 | max-size 1mb | 646 | self.assertEqual(calls, ["acquire", "release"]) |
449 | 556 | old-files 3 | 647 | |
361 | 557 | </logfile> | ||
362 | 558 | <logfile> | ||
363 | 559 | path %(path1)s | ||
364 | 560 | level info | ||
365 | 561 | when D | ||
366 | 562 | old-files 3 | ||
367 | 563 | </logfile> | ||
368 | 564 | </logger> | ||
369 | 565 | |||
370 | 566 | <logger> | ||
371 | 567 | name bar.foo | ||
372 | 568 | <logfile> | ||
373 | 569 | path %(path2)s | ||
374 | 570 | level info | ||
375 | 571 | max-size 10mb | ||
376 | 572 | old-files 10 | ||
377 | 573 | </logfile> | ||
378 | 574 | </logger> | ||
379 | 575 | """ | ||
380 | 576 | |||
381 | 577 | handler_factory = loghandler.RotatingFileHandler | ||
382 | 578 | |||
383 | 579 | def test_logfile_reopening(self): | ||
384 | 580 | # | ||
385 | 581 | # This test only applies to the simple logfile reopening; it | ||
386 | 582 | # doesn't work the same way as the rotating logfile handler. | ||
387 | 583 | # | ||
388 | 584 | paths = self.mktemp(), self.mktemp(), self.mktemp() | ||
389 | 585 | d = { | ||
390 | 586 | "path0": paths[0], | ||
391 | 587 | "path1": paths[1], | ||
392 | 588 | "path2": paths[2], | ||
393 | 589 | } | ||
394 | 590 | text = self._sampleconfig_template % d | ||
395 | 591 | conf = self.get_config(text) | ||
396 | 592 | self.assertEqual(len(conf.loggers), 2) | ||
397 | 593 | # Build the loggers from the configuration, and write to them: | ||
398 | 594 | conf.loggers[0]().info("message 1") | ||
399 | 595 | conf.loggers[1]().info("message 2") | ||
400 | 596 | # | ||
401 | 597 | # We expect this to re-open the original filenames, so we'll | ||
402 | 598 | # have six files instead of three. | ||
403 | 599 | # | ||
404 | 600 | loghandler.reopenFiles() | ||
405 | 601 | # | ||
406 | 602 | # Write to them again: | ||
407 | 603 | conf.loggers[0]().info("message 3") | ||
408 | 604 | conf.loggers[1]().info("message 4") | ||
409 | 605 | # | ||
410 | 606 | # We expect this to re-open the original filenames, so we'll | ||
411 | 607 | # have nine files instead of six. | ||
412 | 608 | # | ||
413 | 609 | loghandler.reopenFiles() | ||
414 | 610 | # | ||
415 | 611 | # Write to them again: | ||
416 | 612 | conf.loggers[0]().info("message 5") | ||
417 | 613 | conf.loggers[1]().info("message 6") | ||
418 | 614 | # | ||
419 | 615 | # We should now have all nine files: | ||
420 | 616 | for fn in paths: | ||
421 | 617 | fn1 = fn + ".1" | ||
422 | 618 | fn2 = fn + ".2" | ||
423 | 619 | self.assert_(os.path.isfile(fn), "%r must exist" % fn) | ||
424 | 620 | self.assert_(os.path.isfile(fn1), "%r must exist" % fn1) | ||
425 | 621 | self.assert_(os.path.isfile(fn2), "%r must exist" % fn2) | ||
426 | 622 | # | ||
427 | 623 | # Clean up: | ||
428 | 624 | for logger in conf.loggers: | ||
429 | 625 | logger = logger() | ||
430 | 626 | for handler in logger.handlers[:]: | ||
431 | 627 | logger.removeHandler(handler) | ||
432 | 628 | handler.close() | ||
450 | 629 | 648 | ||
451 | 630 | def test_logger_convenience_function_and_ommiting_name_to_get_root_logger(): | 649 | def test_logger_convenience_function_and_ommiting_name_to_get_root_logger(): |
452 | 631 | """ | 650 | """ |
453 | 632 | 651 | ||
454 | === modified file 'ZConfig/datatypes.py' | |||
455 | --- ZConfig/datatypes.py 2011-03-24 18:29:45 +0000 | |||
456 | +++ ZConfig/datatypes.py 2012-07-15 23:54:18 +0000 | |||
457 | @@ -164,7 +164,7 @@ | |||
458 | 164 | return s.split() | 164 | return s.split() |
459 | 165 | 165 | ||
460 | 166 | 166 | ||
462 | 167 | port_number = RangeCheckedConversion(integer, min=1, max=0xffff).__call__ | 167 | port_number = RangeCheckedConversion(integer, min=0, max=0xffff).__call__ |
463 | 168 | 168 | ||
464 | 169 | 169 | ||
465 | 170 | class InetAddress: | 170 | class InetAddress: |
466 | @@ -177,9 +177,17 @@ | |||
467 | 177 | host = '' | 177 | host = '' |
468 | 178 | port = None | 178 | port = None |
469 | 179 | if ":" in s: | 179 | if ":" in s: |
473 | 180 | host, s = s.split(":", 1) | 180 | host, p = s.rsplit(":", 1) |
474 | 181 | if s: | 181 | if host.startswith('[') and host.endswith(']'): |
475 | 182 | port = port_number(s) | 182 | # [IPv6]:port |
476 | 183 | host = host[1:-1] | ||
477 | 184 | elif ':' in host: | ||
478 | 185 | # Unbracketed IPv6 address; | ||
479 | 186 | # last part is not the port number | ||
480 | 187 | host = s | ||
481 | 188 | p = None | ||
482 | 189 | if p: # else leave port at None | ||
483 | 190 | port = port_number(p) | ||
484 | 183 | host = host.lower() | 191 | host = host.lower() |
485 | 184 | else: | 192 | else: |
486 | 185 | try: | 193 | try: |
487 | @@ -203,6 +211,14 @@ | |||
488 | 203 | inet_binding_address = InetAddress("") | 211 | inet_binding_address = InetAddress("") |
489 | 204 | 212 | ||
490 | 205 | class SocketAddress: | 213 | class SocketAddress: |
491 | 214 | # Parsing results in family and address | ||
492 | 215 | # Family can be AF_UNIX (for addresses that are path names) | ||
493 | 216 | # or AF_INET6 (for inet addresses with colons in them) | ||
494 | 217 | # or AF_INET (for all other inet addresses); | ||
495 | 218 | # An inet address is a (host, port) pair | ||
496 | 219 | # Notice that no DNS lookup is performed, so if the host | ||
497 | 220 | # is a DNS name, DNS lookup may end up with either IPv4 or | ||
498 | 221 | # IPv6 addresses, or both | ||
499 | 206 | def __init__(self, s): | 222 | def __init__(self, s): |
500 | 207 | import socket | 223 | import socket |
501 | 208 | if "/" in s or s.find(os.sep) >= 0: | 224 | if "/" in s or s.find(os.sep) >= 0: |
502 | @@ -211,6 +227,8 @@ | |||
503 | 211 | else: | 227 | else: |
504 | 212 | self.family = socket.AF_INET | 228 | self.family = socket.AF_INET |
505 | 213 | self.address = self._parse_address(s) | 229 | self.address = self._parse_address(s) |
506 | 230 | if ':' in self.address[0]: | ||
507 | 231 | self.family = socket.AF_INET6 | ||
508 | 214 | 232 | ||
509 | 215 | def _parse_address(self, s): | 233 | def _parse_address(self, s): |
510 | 216 | return inet_address(s) | 234 | return inet_address(s) |
511 | @@ -237,15 +255,28 @@ | |||
512 | 237 | # IP address regex from the Perl Cookbook, Recipe 6.23 (revised ed.) | 255 | # IP address regex from the Perl Cookbook, Recipe 6.23 (revised ed.) |
513 | 238 | # We allow underscores in hostnames although this is considered | 256 | # We allow underscores in hostnames although this is considered |
514 | 239 | # illegal according to RFC1034. | 257 | # illegal according to RFC1034. |
515 | 258 | # Addition: IPv6 addresses are now also accepted | ||
516 | 240 | expr = (r"(^(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr | 259 | expr = (r"(^(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr |
517 | 241 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd | 260 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd |
518 | 242 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd | 261 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd |
519 | 243 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])$)" #ipaddr cont'd | 262 | r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])$)" #ipaddr cont'd |
521 | 244 | r"|([A-Za-z_][-A-Za-z0-9_.]*[-A-Za-z0-9_])") # or hostname | 263 | r"|([A-Za-z_][-A-Za-z0-9_.]*[-A-Za-z0-9_])" # or hostname |
522 | 264 | r"|([0-9A-Fa-f:.]+:[0-9A-Fa-f:.]*)" # or superset of IPv6 addresses | ||
523 | 265 | # (requiring at least one colon) | ||
524 | 266 | ) | ||
525 | 245 | RegularExpressionConversion.__init__(self, expr) | 267 | RegularExpressionConversion.__init__(self, expr) |
526 | 246 | 268 | ||
527 | 247 | def __call__(self, value): | 269 | def __call__(self, value): |
529 | 248 | return RegularExpressionConversion.__call__(self, value).lower() | 270 | result = RegularExpressionConversion.__call__(self, value).lower() |
530 | 271 | # Use C library to validate IPv6 addresses, in particular wrt. | ||
531 | 272 | # number of colons and number of digits per group | ||
532 | 273 | if ':' in result: | ||
533 | 274 | import socket | ||
534 | 275 | try: | ||
535 | 276 | socket.inet_pton(socket.AF_INET6, result) | ||
536 | 277 | except socket.error: | ||
537 | 278 | raise ValueError('%r is not a valid IPv6 address' % value) | ||
538 | 279 | return result | ||
539 | 249 | 280 | ||
540 | 250 | def existing_directory(v): | 281 | def existing_directory(v): |
541 | 251 | nv = os.path.expanduser(v) | 282 | nv = os.path.expanduser(v) |
542 | 252 | 283 | ||
543 | === modified file 'ZConfig/tests/support.py' | |||
544 | --- ZConfig/tests/support.py 2011-03-24 18:29:45 +0000 | |||
545 | +++ ZConfig/tests/support.py 2012-07-15 23:54:18 +0000 | |||
546 | @@ -16,7 +16,6 @@ | |||
547 | 16 | 16 | ||
548 | 17 | import os | 17 | import os |
549 | 18 | import StringIO | 18 | import StringIO |
550 | 19 | import unittest | ||
551 | 20 | import urllib | 19 | import urllib |
552 | 21 | 20 | ||
553 | 22 | import ZConfig | 21 | import ZConfig |
554 | @@ -35,9 +34,12 @@ | |||
555 | 35 | CONFIG_BASE = "file://%s/" % urllib.pathname2url(d) | 34 | CONFIG_BASE = "file://%s/" % urllib.pathname2url(d) |
556 | 36 | 35 | ||
557 | 37 | 36 | ||
559 | 38 | class TestBase(unittest.TestCase): | 37 | class TestHelper: |
560 | 39 | """Utility methods which can be used with the schema support.""" | 38 | """Utility methods which can be used with the schema support.""" |
561 | 40 | 39 | ||
562 | 40 | # Not derived from unittest.TestCase; some test runners seem to | ||
563 | 41 | # think that means this class contains tests. | ||
564 | 42 | |||
565 | 41 | def load_both(self, schema_url, conf_url): | 43 | def load_both(self, schema_url, conf_url): |
566 | 42 | schema = self.load_schema(schema_url) | 44 | schema = self.load_schema(schema_url) |
567 | 43 | conf = self.load_config(schema, conf_url) | 45 | conf = self.load_config(schema, conf_url) |
568 | 44 | 46 | ||
569 | === modified file 'ZConfig/tests/test_cfgimports.py' | |||
570 | --- ZConfig/tests/test_cfgimports.py 2011-03-24 18:29:45 +0000 | |||
571 | +++ ZConfig/tests/test_cfgimports.py 2012-07-15 23:54:18 +0000 | |||
572 | @@ -24,7 +24,8 @@ | |||
573 | 24 | import ZConfig.tests.support | 24 | import ZConfig.tests.support |
574 | 25 | 25 | ||
575 | 26 | 26 | ||
577 | 27 | class TestImportFromConfiguration(ZConfig.tests.support.TestBase): | 27 | class TestImportFromConfiguration( |
578 | 28 | ZConfig.tests.support.TestHelper, unittest.TestCase): | ||
579 | 28 | 29 | ||
580 | 29 | def test_simple_import(self): | 30 | def test_simple_import(self): |
581 | 30 | schema = self.load_schema_text("<schema/>") | 31 | schema = self.load_schema_text("<schema/>") |
582 | 31 | 32 | ||
583 | === modified file 'ZConfig/tests/test_cmdline.py' | |||
584 | --- ZConfig/tests/test_cmdline.py 2011-03-24 18:29:45 +0000 | |||
585 | +++ ZConfig/tests/test_cmdline.py 2012-07-15 23:54:18 +0000 | |||
586 | @@ -17,12 +17,12 @@ | |||
587 | 17 | import unittest | 17 | import unittest |
588 | 18 | 18 | ||
589 | 19 | import ZConfig | 19 | import ZConfig |
590 | 20 | import ZConfig.tests.support | ||
591 | 20 | 21 | ||
592 | 21 | from ZConfig.cmdline import ExtendedConfigLoader | 22 | from ZConfig.cmdline import ExtendedConfigLoader |
597 | 22 | from ZConfig.tests.support import TestBase | 23 | |
598 | 23 | 24 | ||
599 | 24 | 25 | class CommandLineTest(ZConfig.tests.support.TestHelper, unittest.TestCase): | |
596 | 25 | class CommandLineTest(TestBase): | ||
600 | 26 | 26 | ||
601 | 27 | def create_config_loader(self, schema): | 27 | def create_config_loader(self, schema): |
602 | 28 | loader = ExtendedConfigLoader(schema) | 28 | loader = ExtendedConfigLoader(schema) |
603 | 29 | 29 | ||
604 | === modified file 'ZConfig/tests/test_config.py' | |||
605 | --- ZConfig/tests/test_config.py 2011-03-24 18:29:45 +0000 | |||
606 | +++ ZConfig/tests/test_config.py 2012-07-15 23:54:18 +0000 | |||
607 | @@ -133,7 +133,9 @@ | |||
608 | 133 | self.assertRaises(ZConfig.ConfigurationSyntaxError, | 133 | self.assertRaises(ZConfig.ConfigurationSyntaxError, |
609 | 134 | self.loadtext, "%define abc-def\n") | 134 | self.loadtext, "%define abc-def\n") |
610 | 135 | self.assertRaises(ZConfig.ConfigurationSyntaxError, | 135 | self.assertRaises(ZConfig.ConfigurationSyntaxError, |
612 | 136 | self.loadtext, "%define a value\n%define a value\n") | 136 | self.loadtext, "%define a value\n%define a other\n") |
613 | 137 | # doesn't raise if value is equal | ||
614 | 138 | self.loadtext("%define a value\n%define a value\n") | ||
615 | 137 | 139 | ||
616 | 138 | def test_fragment_ident_disallowed(self): | 140 | def test_fragment_ident_disallowed(self): |
617 | 139 | self.assertRaises(ZConfig.ConfigurationError, | 141 | self.assertRaises(ZConfig.ConfigurationError, |
618 | 140 | 142 | ||
619 | === modified file 'ZConfig/tests/test_cookbook.py' | |||
620 | --- ZConfig/tests/test_cookbook.py 2011-03-24 18:29:45 +0000 | |||
621 | +++ ZConfig/tests/test_cookbook.py 2012-07-15 23:54:18 +0000 | |||
622 | @@ -20,10 +20,9 @@ | |||
623 | 20 | 20 | ||
624 | 21 | """ | 21 | """ |
625 | 22 | 22 | ||
626 | 23 | import ZConfig.tests.support | ||
627 | 23 | import unittest | 24 | import unittest |
628 | 24 | 25 | ||
629 | 25 | from ZConfig.tests.support import TestBase | ||
630 | 26 | |||
631 | 27 | 26 | ||
632 | 28 | def basic_key_mapping_password_to_passwd(key): | 27 | def basic_key_mapping_password_to_passwd(key): |
633 | 29 | # Lower-case the key since that's what basic-key does: | 28 | # Lower-case the key since that's what basic-key does: |
634 | @@ -37,7 +36,7 @@ | |||
635 | 37 | return section | 36 | return section |
636 | 38 | 37 | ||
637 | 39 | 38 | ||
639 | 40 | class CookbookTestCase(TestBase): | 39 | class CookbookTestCase(ZConfig.tests.support.TestHelper, unittest.TestCase): |
640 | 41 | 40 | ||
641 | 42 | def test_rewriting_key_names(self): | 41 | def test_rewriting_key_names(self): |
642 | 43 | schema = self.load_schema_text(""" | 42 | schema = self.load_schema_text(""" |
643 | 44 | 43 | ||
644 | === modified file 'ZConfig/tests/test_datatypes.py' | |||
645 | --- ZConfig/tests/test_datatypes.py 2011-03-24 18:29:45 +0000 | |||
646 | +++ ZConfig/tests/test_datatypes.py 2012-07-15 23:54:18 +0000 | |||
647 | @@ -183,9 +183,12 @@ | |||
648 | 183 | eq = self.assertEqual | 183 | eq = self.assertEqual |
649 | 184 | defhost = ZConfig.datatypes.DEFAULT_HOST | 184 | defhost = ZConfig.datatypes.DEFAULT_HOST |
650 | 185 | eq(convert("Host.Example.Com:80"), ("host.example.com", 80)) | 185 | eq(convert("Host.Example.Com:80"), ("host.example.com", 80)) |
651 | 186 | eq(convert("Host.Example.Com:0"), ("host.example.com", 0)) | ||
652 | 186 | eq(convert(":80"), (defhost, 80)) | 187 | eq(convert(":80"), (defhost, 80)) |
653 | 187 | eq(convert("80"), (defhost, 80)) | 188 | eq(convert("80"), (defhost, 80)) |
654 | 189 | eq(convert("[::1]:80"), ("::1", 80)) | ||
655 | 188 | eq(convert("host.EXAMPLE.com"), ("host.example.com", None)) | 190 | eq(convert("host.EXAMPLE.com"), ("host.example.com", None)) |
656 | 191 | eq(convert("2001::ABCD"), ("2001::abcd", None)) | ||
657 | 189 | self.assertRaises(ValueError, convert, "40 # foo") | 192 | self.assertRaises(ValueError, convert, "40 # foo") |
658 | 190 | 193 | ||
659 | 191 | def test_datatype_inet_binding_address(self): | 194 | def test_datatype_inet_binding_address(self): |
660 | @@ -245,7 +248,7 @@ | |||
661 | 245 | raises = self.assertRaises | 248 | raises = self.assertRaises |
662 | 246 | 249 | ||
663 | 247 | raises(ValueError, convert, '-1') | 250 | raises(ValueError, convert, '-1') |
665 | 248 | raises(ValueError, convert, '0') | 251 | eq(convert('0'), 0) |
666 | 249 | eq(convert('1'), 1) | 252 | eq(convert('1'), 1) |
667 | 250 | eq(convert('80'), 80) | 253 | eq(convert('80'), 80) |
668 | 251 | eq(convert('1023'), 1023) | 254 | eq(convert('1023'), 1023) |
669 | @@ -258,6 +261,7 @@ | |||
670 | 258 | convert = self.types.get("socket-address") | 261 | convert = self.types.get("socket-address") |
671 | 259 | eq = self.assertEqual | 262 | eq = self.assertEqual |
672 | 260 | AF_INET = socket.AF_INET | 263 | AF_INET = socket.AF_INET |
673 | 264 | AF_INET6 = socket.AF_INET6 | ||
674 | 261 | defhost = ZConfig.datatypes.DEFAULT_HOST | 265 | defhost = ZConfig.datatypes.DEFAULT_HOST |
675 | 262 | 266 | ||
676 | 263 | def check(value, family, address, self=self, convert=convert): | 267 | def check(value, family, address, self=self, convert=convert): |
677 | @@ -269,6 +273,8 @@ | |||
678 | 269 | check(":80", AF_INET, (defhost, 80)) | 273 | check(":80", AF_INET, (defhost, 80)) |
679 | 270 | check("80", AF_INET, (defhost, 80)) | 274 | check("80", AF_INET, (defhost, 80)) |
680 | 271 | check("host.EXAMPLE.com", AF_INET, ("host.example.com",None)) | 275 | check("host.EXAMPLE.com", AF_INET, ("host.example.com",None)) |
681 | 276 | check("::1", AF_INET6,("::1", None)) | ||
682 | 277 | check("[::]:80", AF_INET6,("::", 80)) | ||
683 | 272 | a1 = convert("/tmp/var/@345.4") | 278 | a1 = convert("/tmp/var/@345.4") |
684 | 273 | a2 = convert("/tmp/var/@345.4:80") | 279 | a2 = convert("/tmp/var/@345.4:80") |
685 | 274 | self.assertEqual(a1.address, "/tmp/var/@345.4") | 280 | self.assertEqual(a1.address, "/tmp/var/@345.4") |
686 | @@ -291,11 +297,16 @@ | |||
687 | 291 | eq(convert('HOSTNAME.COM'), 'hostname.com') | 297 | eq(convert('HOSTNAME.COM'), 'hostname.com') |
688 | 292 | eq(convert('WWW.HOSTNAME.COM'), 'www.hostname.com') | 298 | eq(convert('WWW.HOSTNAME.COM'), 'www.hostname.com') |
689 | 293 | eq(convert('127.0.0.1'), '127.0.0.1') | 299 | eq(convert('127.0.0.1'), '127.0.0.1') |
690 | 300 | eq(convert('::1'), '::1') | ||
691 | 301 | eq(convert('2001:DB8:1234:4567:89AB:cdef:0:1'), '2001:db8:1234:4567:89ab:cdef:0:1') | ||
692 | 302 | eq(convert('2001:DB8:1234:4567::10.11.12.13'), '2001:db8:1234:4567::10.11.12.13') | ||
693 | 294 | raises(ValueError, convert, '1hostnamewithleadingnumeric') | 303 | raises(ValueError, convert, '1hostnamewithleadingnumeric') |
694 | 295 | raises(ValueError, convert, '255.255') | 304 | raises(ValueError, convert, '255.255') |
695 | 296 | raises(ValueError, convert, '12345678') | 305 | raises(ValueError, convert, '12345678') |
696 | 297 | raises(ValueError, convert, '999.999.999.999') | 306 | raises(ValueError, convert, '999.999.999.999') |
697 | 298 | raises(ValueError, convert, 'a!badhostname') | 307 | raises(ValueError, convert, 'a!badhostname') |
698 | 308 | raises(ValueError, convert, '2001:DB8:0123:4567:89AB:cdef:0:1:2') | ||
699 | 309 | raises(ValueError, convert, '2001:DB8:0123:4567::10.11.12.13.14') | ||
700 | 299 | 310 | ||
701 | 300 | def test_existing_directory(self): | 311 | def test_existing_directory(self): |
702 | 301 | convert = self.types.get('existing-directory') | 312 | convert = self.types.get('existing-directory') |
703 | 302 | 313 | ||
704 | === modified file 'ZConfig/tests/test_loader.py' | |||
705 | --- ZConfig/tests/test_loader.py 2011-03-24 18:29:45 +0000 | |||
706 | +++ ZConfig/tests/test_loader.py 2012-07-15 23:54:18 +0000 | |||
707 | @@ -25,7 +25,7 @@ | |||
708 | 25 | import ZConfig.loader | 25 | import ZConfig.loader |
709 | 26 | import ZConfig.url | 26 | import ZConfig.url |
710 | 27 | 27 | ||
712 | 28 | from ZConfig.tests.support import CONFIG_BASE, TestBase | 28 | from ZConfig.tests.support import CONFIG_BASE, TestHelper |
713 | 29 | 29 | ||
714 | 30 | 30 | ||
715 | 31 | try: | 31 | try: |
716 | @@ -37,7 +37,7 @@ | |||
717 | 37 | LIBRARY_DIR = os.path.join(os.path.dirname(myfile), "library") | 37 | LIBRARY_DIR = os.path.join(os.path.dirname(myfile), "library") |
718 | 38 | 38 | ||
719 | 39 | 39 | ||
721 | 40 | class LoaderTestCase(TestBase): | 40 | class LoaderTestCase(TestHelper, unittest.TestCase): |
722 | 41 | 41 | ||
723 | 42 | def test_schema_caching(self): | 42 | def test_schema_caching(self): |
724 | 43 | loader = ZConfig.loader.SchemaLoader() | 43 | loader = ZConfig.loader.SchemaLoader() |
725 | 44 | 44 | ||
726 | === modified file 'ZConfig/tests/test_readme.py' | |||
727 | --- ZConfig/tests/test_readme.py 2011-03-24 18:29:45 +0000 | |||
728 | +++ ZConfig/tests/test_readme.py 2012-07-15 23:54:18 +0000 | |||
729 | @@ -11,16 +11,17 @@ | |||
730 | 11 | # FOR A PARTICULAR PURPOSE. | 11 | # FOR A PARTICULAR PURPOSE. |
731 | 12 | # | 12 | # |
732 | 13 | ############################################################################## | 13 | ############################################################################## |
737 | 14 | import logging,os,unittest | 14 | import doctest |
738 | 15 | from zope.testing.doctest import DocFileSuite, REPORT_NDIFF,ELLIPSIS | 15 | import logging |
739 | 16 | 16 | ||
740 | 17 | options = REPORT_NDIFF|ELLIPSIS | 17 | |
741 | 18 | options = doctest.REPORT_NDIFF | doctest.ELLIPSIS | ||
742 | 18 | 19 | ||
743 | 19 | old = {} | 20 | old = {} |
744 | 20 | def setUp(test): | 21 | def setUp(test): |
745 | 21 | global old | 22 | global old |
748 | 22 | logger=logging.getLogger() | 23 | logger = logging.getLogger() |
749 | 23 | old['level']=logger.level | 24 | old['level'] = logger.level |
750 | 24 | old['handlers'] = logger.handlers[:] | 25 | old['handlers'] = logger.handlers[:] |
751 | 25 | 26 | ||
752 | 26 | def tearDown(test): | 27 | def tearDown(test): |
753 | @@ -29,7 +30,8 @@ | |||
754 | 29 | logger.handlers = old['handlers'] | 30 | logger.handlers = old['handlers'] |
755 | 30 | 31 | ||
756 | 31 | def test_suite(): | 32 | def test_suite(): |
761 | 32 | return unittest.TestSuite(( | 33 | return doctest.DocFileSuite( |
762 | 33 | DocFileSuite('../../README.txt', optionflags=options, | 34 | '../../README.txt', |
763 | 34 | setUp=setUp,tearDown=tearDown), | 35 | optionflags=options, |
764 | 35 | )) | 36 | setUp=setUp, tearDown=tearDown, |
765 | 37 | ) | ||
766 | 36 | 38 | ||
767 | === modified file 'ZConfig/tests/test_schema.py' | |||
768 | --- ZConfig/tests/test_schema.py 2011-03-24 18:29:45 +0000 | |||
769 | +++ ZConfig/tests/test_schema.py 2012-07-15 23:54:18 +0000 | |||
770 | @@ -17,7 +17,7 @@ | |||
771 | 17 | 17 | ||
772 | 18 | import ZConfig | 18 | import ZConfig |
773 | 19 | 19 | ||
775 | 20 | from ZConfig.tests.support import TestBase, CONFIG_BASE | 20 | from ZConfig.tests.support import TestHelper, CONFIG_BASE |
776 | 21 | 21 | ||
777 | 22 | 22 | ||
778 | 23 | def uppercase(value): | 23 | def uppercase(value): |
779 | @@ -40,7 +40,7 @@ | |||
780 | 40 | return L | 40 | return L |
781 | 41 | 41 | ||
782 | 42 | 42 | ||
784 | 43 | class SchemaTestCase(TestBase): | 43 | class SchemaTestCase(TestHelper, unittest.TestCase): |
785 | 44 | """Tests of the basic schema support itself.""" | 44 | """Tests of the basic schema support itself.""" |
786 | 45 | 45 | ||
787 | 46 | def test_minimal_schema(self): | 46 | def test_minimal_schema(self): |
788 | 47 | 47 | ||
789 | === modified file 'ZConfig/tests/test_schemaless.py' | |||
790 | --- ZConfig/tests/test_schemaless.py 2011-03-24 18:29:45 +0000 | |||
791 | +++ ZConfig/tests/test_schemaless.py 2012-07-15 23:54:18 +0000 | |||
792 | @@ -17,10 +17,7 @@ | |||
793 | 17 | """ | 17 | """ |
794 | 18 | __docformat__ = "reStructuredText" | 18 | __docformat__ = "reStructuredText" |
795 | 19 | 19 | ||
800 | 20 | try: | 20 | import doctest |
797 | 21 | from zope.testing import doctest | ||
798 | 22 | except ImportError: | ||
799 | 23 | import doctest | ||
801 | 24 | 21 | ||
802 | 25 | 22 | ||
803 | 26 | def test_suite(): | 23 | def test_suite(): |
804 | 27 | 24 | ||
805 | === modified file 'bootstrap.py' | |||
806 | --- bootstrap.py 2011-03-24 18:29:45 +0000 | |||
807 | +++ bootstrap.py 2012-07-15 23:54:18 +0000 | |||
808 | @@ -16,37 +16,245 @@ | |||
809 | 16 | Simply run this script in a directory containing a buildout.cfg. | 16 | Simply run this script in a directory containing a buildout.cfg. |
810 | 17 | The script accepts buildout command-line options, so you can | 17 | The script accepts buildout command-line options, so you can |
811 | 18 | use the -c option to specify an alternate configuration file. | 18 | use the -c option to specify an alternate configuration file. |
812 | 19 | |||
813 | 20 | $Id: bootstrap.py 72703 2007-02-20 11:49:26Z jim $ | ||
814 | 21 | """ | 19 | """ |
815 | 22 | 20 | ||
828 | 23 | import os, shutil, sys, tempfile, urllib2 | 21 | import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess |
829 | 24 | 22 | from optparse import OptionParser | |
830 | 25 | tmpeggs = tempfile.mkdtemp() | 23 | |
819 | 26 | |||
820 | 27 | ez = {} | ||
821 | 28 | exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' | ||
822 | 29 | ).read() in ez | ||
823 | 30 | ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) | ||
824 | 31 | |||
825 | 32 | import pkg_resources | ||
826 | 33 | |||
827 | 34 | cmd = 'from setuptools.command.easy_install import main; main()' | ||
831 | 35 | if sys.platform == 'win32': | 24 | if sys.platform == 'win32': |
834 | 36 | cmd = '"%s"' % cmd # work around spawn lamosity on windows | 25 | def quote(c): |
835 | 37 | 26 | if ' ' in c: | |
836 | 27 | return '"%s"' % c # work around spawn lamosity on windows | ||
837 | 28 | else: | ||
838 | 29 | return c | ||
839 | 30 | else: | ||
840 | 31 | quote = str | ||
841 | 32 | |||
842 | 33 | # See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. | ||
843 | 34 | stdout, stderr = subprocess.Popen( | ||
844 | 35 | [sys.executable, '-Sc', | ||
845 | 36 | 'try:\n' | ||
846 | 37 | ' import ConfigParser\n' | ||
847 | 38 | 'except ImportError:\n' | ||
848 | 39 | ' print 1\n' | ||
849 | 40 | 'else:\n' | ||
850 | 41 | ' print 0\n'], | ||
851 | 42 | stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() | ||
852 | 43 | has_broken_dash_S = bool(int(stdout.strip())) | ||
853 | 44 | |||
854 | 45 | # In order to be more robust in the face of system Pythons, we want to | ||
855 | 46 | # run without site-packages loaded. This is somewhat tricky, in | ||
856 | 47 | # particular because Python 2.6's distutils imports site, so starting | ||
857 | 48 | # with the -S flag is not sufficient. However, we'll start with that: | ||
858 | 49 | if not has_broken_dash_S and 'site' in sys.modules: | ||
859 | 50 | # We will restart with python -S. | ||
860 | 51 | args = sys.argv[:] | ||
861 | 52 | args[0:0] = [sys.executable, '-S'] | ||
862 | 53 | args = map(quote, args) | ||
863 | 54 | os.execv(sys.executable, args) | ||
864 | 55 | # Now we are running with -S. We'll get the clean sys.path, import site | ||
865 | 56 | # because distutils will do it later, and then reset the path and clean | ||
866 | 57 | # out any namespace packages from site-packages that might have been | ||
867 | 58 | # loaded by .pth files. | ||
868 | 59 | clean_path = sys.path[:] | ||
869 | 60 | import site | ||
870 | 61 | sys.path[:] = clean_path | ||
871 | 62 | for k, v in sys.modules.items(): | ||
872 | 63 | if k in ('setuptools', 'pkg_resources') or ( | ||
873 | 64 | hasattr(v, '__path__') and | ||
874 | 65 | len(v.__path__)==1 and | ||
875 | 66 | not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): | ||
876 | 67 | # This is a namespace package. Remove it. | ||
877 | 68 | sys.modules.pop(k) | ||
878 | 69 | |||
879 | 70 | is_jython = sys.platform.startswith('java') | ||
880 | 71 | |||
881 | 72 | setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' | ||
882 | 73 | distribute_source = 'http://python-distribute.org/distribute_setup.py' | ||
883 | 74 | |||
884 | 75 | # parsing arguments | ||
885 | 76 | def normalize_to_url(option, opt_str, value, parser): | ||
886 | 77 | if value: | ||
887 | 78 | if '://' not in value: # It doesn't smell like a URL. | ||
888 | 79 | value = 'file://%s' % ( | ||
889 | 80 | urllib.pathname2url( | ||
890 | 81 | os.path.abspath(os.path.expanduser(value))),) | ||
891 | 82 | if opt_str == '--download-base' and not value.endswith('/'): | ||
892 | 83 | # Download base needs a trailing slash to make the world happy. | ||
893 | 84 | value += '/' | ||
894 | 85 | else: | ||
895 | 86 | value = None | ||
896 | 87 | name = opt_str[2:].replace('-', '_') | ||
897 | 88 | setattr(parser.values, name, value) | ||
898 | 89 | |||
899 | 90 | usage = '''\ | ||
900 | 91 | [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] | ||
901 | 92 | |||
902 | 93 | Bootstraps a buildout-based project. | ||
903 | 94 | |||
904 | 95 | Simply run this script in a directory containing a buildout.cfg, using the | ||
905 | 96 | Python that you want bin/buildout to use. | ||
906 | 97 | |||
907 | 98 | Note that by using --setup-source and --download-base to point to | ||
908 | 99 | local resources, you can keep this script from going over the network. | ||
909 | 100 | ''' | ||
910 | 101 | |||
911 | 102 | parser = OptionParser(usage=usage) | ||
912 | 103 | parser.add_option("-v", "--version", dest="version", | ||
913 | 104 | help="use a specific zc.buildout version") | ||
914 | 105 | parser.add_option("-d", "--distribute", | ||
915 | 106 | action="store_true", dest="use_distribute", default=False, | ||
916 | 107 | help="Use Distribute rather than Setuptools.") | ||
917 | 108 | parser.add_option("--setup-source", action="callback", dest="setup_source", | ||
918 | 109 | callback=normalize_to_url, nargs=1, type="string", | ||
919 | 110 | help=("Specify a URL or file location for the setup file. " | ||
920 | 111 | "If you use Setuptools, this will default to " + | ||
921 | 112 | setuptools_source + "; if you use Distribute, this " | ||
922 | 113 | "will default to " + distribute_source +".")) | ||
923 | 114 | parser.add_option("--download-base", action="callback", dest="download_base", | ||
924 | 115 | callback=normalize_to_url, nargs=1, type="string", | ||
925 | 116 | help=("Specify a URL or directory for downloading " | ||
926 | 117 | "zc.buildout and either Setuptools or Distribute. " | ||
927 | 118 | "Defaults to PyPI.")) | ||
928 | 119 | parser.add_option("--eggs", | ||
929 | 120 | help=("Specify a directory for storing eggs. Defaults to " | ||
930 | 121 | "a temporary directory that is deleted when the " | ||
931 | 122 | "bootstrap script completes.")) | ||
932 | 123 | parser.add_option("-t", "--accept-buildout-test-releases", | ||
933 | 124 | dest='accept_buildout_test_releases', | ||
934 | 125 | action="store_true", default=False, | ||
935 | 126 | help=("Normally, if you do not specify a --version, the " | ||
936 | 127 | "bootstrap script and buildout gets the newest " | ||
937 | 128 | "*final* versions of zc.buildout and its recipes and " | ||
938 | 129 | "extensions for you. If you use this flag, " | ||
939 | 130 | "bootstrap and buildout will get the newest releases " | ||
940 | 131 | "even if they are alphas or betas.")) | ||
941 | 132 | parser.add_option("-c", None, action="store", dest="config_file", | ||
942 | 133 | help=("Specify the path to the buildout configuration " | ||
943 | 134 | "file to be used.")) | ||
944 | 135 | |||
945 | 136 | options, args = parser.parse_args() | ||
946 | 137 | |||
947 | 138 | # if -c was provided, we push it back into args for buildout's main function | ||
948 | 139 | if options.config_file is not None: | ||
949 | 140 | args += ['-c', options.config_file] | ||
950 | 141 | |||
951 | 142 | if options.eggs: | ||
952 | 143 | eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) | ||
953 | 144 | else: | ||
954 | 145 | eggs_dir = tempfile.mkdtemp() | ||
955 | 146 | |||
956 | 147 | if options.setup_source is None: | ||
957 | 148 | if options.use_distribute: | ||
958 | 149 | options.setup_source = distribute_source | ||
959 | 150 | else: | ||
960 | 151 | options.setup_source = setuptools_source | ||
961 | 152 | |||
962 | 153 | if options.accept_buildout_test_releases: | ||
963 | 154 | args.append('buildout:accept-buildout-test-releases=true') | ||
964 | 155 | args.append('bootstrap') | ||
965 | 156 | |||
966 | 157 | try: | ||
967 | 158 | import pkg_resources | ||
968 | 159 | import setuptools # A flag. Sometimes pkg_resources is installed alone. | ||
969 | 160 | if not hasattr(pkg_resources, '_distribute'): | ||
970 | 161 | raise ImportError | ||
971 | 162 | except ImportError: | ||
972 | 163 | ez_code = urllib2.urlopen( | ||
973 | 164 | options.setup_source).read().replace('\r\n', '\n') | ||
974 | 165 | ez = {} | ||
975 | 166 | exec ez_code in ez | ||
976 | 167 | setup_args = dict(to_dir=eggs_dir, download_delay=0) | ||
977 | 168 | if options.download_base: | ||
978 | 169 | setup_args['download_base'] = options.download_base | ||
979 | 170 | if options.use_distribute: | ||
980 | 171 | setup_args['no_fake'] = True | ||
981 | 172 | ez['use_setuptools'](**setup_args) | ||
982 | 173 | if 'pkg_resources' in sys.modules: | ||
983 | 174 | reload(sys.modules['pkg_resources']) | ||
984 | 175 | import pkg_resources | ||
985 | 176 | # This does not (always?) update the default working set. We will | ||
986 | 177 | # do it. | ||
987 | 178 | for path in sys.path: | ||
988 | 179 | if path not in pkg_resources.working_set.entries: | ||
989 | 180 | pkg_resources.working_set.add_entry(path) | ||
990 | 181 | |||
991 | 182 | cmd = [quote(sys.executable), | ||
992 | 183 | '-c', | ||
993 | 184 | quote('from setuptools.command.easy_install import main; main()'), | ||
994 | 185 | '-mqNxd', | ||
995 | 186 | quote(eggs_dir)] | ||
996 | 187 | |||
997 | 188 | if not has_broken_dash_S: | ||
998 | 189 | cmd.insert(1, '-S') | ||
999 | 190 | |||
1000 | 191 | find_links = options.download_base | ||
1001 | 192 | if not find_links: | ||
1002 | 193 | find_links = os.environ.get('bootstrap-testing-find-links') | ||
1003 | 194 | if find_links: | ||
1004 | 195 | cmd.extend(['-f', quote(find_links)]) | ||
1005 | 196 | |||
1006 | 197 | if options.use_distribute: | ||
1007 | 198 | setup_requirement = 'distribute' | ||
1008 | 199 | else: | ||
1009 | 200 | setup_requirement = 'setuptools' | ||
1010 | 38 | ws = pkg_resources.working_set | 201 | ws = pkg_resources.working_set |
1022 | 39 | assert os.spawnle( | 202 | setup_requirement_path = ws.find( |
1023 | 40 | os.P_WAIT, sys.executable, sys.executable, | 203 | pkg_resources.Requirement.parse(setup_requirement)).location |
1024 | 41 | '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', | 204 | env = dict( |
1025 | 42 | dict(os.environ, | 205 | os.environ, |
1026 | 43 | PYTHONPATH= | 206 | PYTHONPATH=setup_requirement_path) |
1027 | 44 | ws.find(pkg_resources.Requirement.parse('setuptools')).location | 207 | |
1028 | 45 | ), | 208 | requirement = 'zc.buildout' |
1029 | 46 | ) == 0 | 209 | version = options.version |
1030 | 47 | 210 | if version is None and not options.accept_buildout_test_releases: | |
1031 | 48 | ws.add_entry(tmpeggs) | 211 | # Figure out the most recent final version of zc.buildout. |
1032 | 49 | ws.require('zc.buildout') | 212 | import setuptools.package_index |
1033 | 213 | _final_parts = '*final-', '*final' | ||
1034 | 214 | def _final_version(parsed_version): | ||
1035 | 215 | for part in parsed_version: | ||
1036 | 216 | if (part[:1] == '*') and (part not in _final_parts): | ||
1037 | 217 | return False | ||
1038 | 218 | return True | ||
1039 | 219 | index = setuptools.package_index.PackageIndex( | ||
1040 | 220 | search_path=[setup_requirement_path]) | ||
1041 | 221 | if find_links: | ||
1042 | 222 | index.add_find_links((find_links,)) | ||
1043 | 223 | req = pkg_resources.Requirement.parse(requirement) | ||
1044 | 224 | if index.obtain(req) is not None: | ||
1045 | 225 | best = [] | ||
1046 | 226 | bestv = None | ||
1047 | 227 | for dist in index[req.project_name]: | ||
1048 | 228 | distv = dist.parsed_version | ||
1049 | 229 | if _final_version(distv): | ||
1050 | 230 | if bestv is None or distv > bestv: | ||
1051 | 231 | best = [dist] | ||
1052 | 232 | bestv = distv | ||
1053 | 233 | elif distv == bestv: | ||
1054 | 234 | best.append(dist) | ||
1055 | 235 | if best: | ||
1056 | 236 | best.sort() | ||
1057 | 237 | version = best[-1].version | ||
1058 | 238 | if version: | ||
1059 | 239 | requirement = '=='.join((requirement, version)) | ||
1060 | 240 | cmd.append(requirement) | ||
1061 | 241 | |||
1062 | 242 | if is_jython: | ||
1063 | 243 | import subprocess | ||
1064 | 244 | exitcode = subprocess.Popen(cmd, env=env).wait() | ||
1065 | 245 | else: # Windows prefers this, apparently; otherwise we would prefer subprocess | ||
1066 | 246 | exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) | ||
1067 | 247 | if exitcode != 0: | ||
1068 | 248 | sys.stdout.flush() | ||
1069 | 249 | sys.stderr.flush() | ||
1070 | 250 | print ("An error occurred when trying to install zc.buildout. " | ||
1071 | 251 | "Look above this message for any errors that " | ||
1072 | 252 | "were output by easy_install.") | ||
1073 | 253 | sys.exit(exitcode) | ||
1074 | 254 | |||
1075 | 255 | ws.add_entry(eggs_dir) | ||
1076 | 256 | ws.require(requirement) | ||
1077 | 50 | import zc.buildout.buildout | 257 | import zc.buildout.buildout |
1080 | 51 | zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) | 258 | zc.buildout.buildout.main(args) |
1081 | 52 | shutil.rmtree(tmpeggs) | 259 | if not options.eggs: # clean up temporary egg directory |
1082 | 260 | shutil.rmtree(eggs_dir) | ||
1083 | 53 | 261 | ||
1084 | === modified file 'buildout.cfg' | |||
1085 | --- buildout.cfg 2009-06-18 17:30:22 +0000 | |||
1086 | +++ buildout.cfg 2012-07-15 23:54:18 +0000 | |||
1087 | @@ -1,9 +1,14 @@ | |||
1088 | 1 | [buildout] | 1 | [buildout] |
1089 | 2 | develop = . | 2 | develop = . |
1092 | 3 | find-links = http://download.zope.org/distribution/ | 3 | parts = nosetests test |
1093 | 4 | parts = test | 4 | prefer-final = true |
1094 | 5 | |||
1095 | 6 | [nosetests] | ||
1096 | 7 | recipe = zc.recipe.egg | ||
1097 | 8 | eggs = nose | ||
1098 | 9 | scripts = nosetests | ||
1099 | 5 | 10 | ||
1100 | 6 | [test] | 11 | [test] |
1101 | 7 | recipe = zc.recipe.testrunner | 12 | recipe = zc.recipe.testrunner |
1102 | 8 | eggs = ZConfig | 13 | eggs = ZConfig |
1104 | 9 | defaults = '--exit-with-status -1'.split() | 14 | defaults = ['-1'] |
1105 | 10 | 15 | ||
1106 | === modified file 'debian/changelog' | |||
1107 | --- debian/changelog 2011-12-31 08:17:16 +0000 | |||
1108 | +++ debian/changelog 2012-07-15 23:54:18 +0000 | |||
1109 | @@ -1,3 +1,10 @@ | |||
1110 | 1 | zconfig (2.9.3-0ubuntu1) quantal; urgency=low | ||
1111 | 2 | |||
1112 | 3 | * New upstream release. | ||
1113 | 4 | * Bump Standards-Version to 3.9.3. | ||
1114 | 5 | |||
1115 | 6 | -- Logan Rosen <logatronico@gmail.com> Sun, 15 Jul 2012 19:48:02 -0400 | ||
1116 | 7 | |||
1117 | 1 | zconfig (2.8.0-1build1) precise; urgency=low | 8 | zconfig (2.8.0-1build1) precise; urgency=low |
1118 | 2 | 9 | ||
1119 | 3 | * Rebuild to drop python2.6 dependencies. | 10 | * Rebuild to drop python2.6 dependencies. |
1120 | 4 | 11 | ||
1121 | === modified file 'debian/control' | |||
1122 | --- debian/control 2011-05-06 22:36:13 +0000 | |||
1123 | +++ debian/control 2012-07-15 23:54:18 +0000 | |||
1124 | @@ -8,7 +8,7 @@ | |||
1125 | 8 | python-all (>= 2.6.6-3~), | 8 | python-all (>= 2.6.6-3~), |
1126 | 9 | python-setuptools, | 9 | python-setuptools, |
1127 | 10 | python-van.pydeb (>= 1.3.0-4) | 10 | python-van.pydeb (>= 1.3.0-4) |
1129 | 11 | Standards-Version: 3.9.2 | 11 | Standards-Version: 3.9.3 |
1130 | 12 | X-Python-Version: >= 2.4 | 12 | X-Python-Version: >= 2.4 |
1131 | 13 | Homepage: http://www.zope.org/Members/fdrake/zconfig | 13 | Homepage: http://www.zope.org/Members/fdrake/zconfig |
1132 | 14 | Vcs-Svn: svn://svn.debian.org/pkg-zope/zconfig/trunk | 14 | Vcs-Svn: svn://svn.debian.org/pkg-zope/zconfig/trunk |
1133 | 15 | 15 | ||
1134 | === modified file 'doc/zconfig.tex' | |||
1135 | --- doc/zconfig.tex 2011-03-24 18:29:45 +0000 | |||
1136 | +++ doc/zconfig.tex 2012-07-15 23:54:18 +0000 | |||
1137 | @@ -272,9 +272,8 @@ | |||
1138 | 272 | pairs. | 272 | pairs. |
1139 | 273 | 273 | ||
1140 | 274 | Names must be defined before they are used, and may not be | 274 | Names must be defined before they are used, and may not be |
1144 | 275 | re-defined. All resources being parsed as part of a configuration | 275 | re-defined with a different value. All resources being parsed as part of |
1145 | 276 | share a single namespace for defined names. This means that resources | 276 | a configuration share a single namespace for defined names. |
1143 | 277 | which may be included more than once should not define any names. | ||
1146 | 278 | 277 | ||
1147 | 279 | References to defined names from configuration values use the syntax | 278 | References to defined names from configuration values use the syntax |
1148 | 280 | described for the \refmodule{ZConfig.substitution} module. | 279 | described for the \refmodule{ZConfig.substitution} module. |
1149 | @@ -906,7 +905,9 @@ | |||
1150 | 906 | will be returned for \var{hostname}. The default host is | 905 | will be returned for \var{hostname}. The default host is |
1151 | 907 | \code{localhost} on Windows and the empty string on all other | 906 | \code{localhost} on Windows and the empty string on all other |
1152 | 908 | platforms. If the port is omitted, \code{None} will be returned for | 907 | platforms. If the port is omitted, \code{None} will be returned for |
1154 | 909 | \var{port}. | 908 | \var{port}. IPv6 addresses can be specified in colon-separated notation; |
1155 | 909 | if both host and port need to be specified, the bracketed form | ||
1156 | 910 | (\code{[addr]:port}) must be used. | ||
1157 | 910 | 911 | ||
1158 | 911 | \term{\datatype{inet-binding-address}} | 912 | \term{\datatype{inet-binding-address}} |
1159 | 912 | An Internet address expressed as a \code{(\var{hostname}, | 913 | An Internet address expressed as a \code{(\var{hostname}, |
1160 | @@ -932,7 +933,8 @@ | |||
1161 | 932 | Validates a valid IP address or hostname. If the first | 933 | Validates a valid IP address or hostname. If the first |
1162 | 933 | character is a digit, the value is assumed to be an IP | 934 | character is a digit, the value is assumed to be an IP |
1163 | 934 | address. If the first character is not a digit, the value | 935 | address. If the first character is not a digit, the value |
1165 | 935 | is assumed to be a hostname. Hostnames are converted to lower | 936 | is assumed to be a hostname. Strings containing colons are |
1166 | 937 | considered IPv6 address. Hostnames are converted to lower | ||
1167 | 936 | case. | 938 | case. |
1168 | 937 | 939 | ||
1169 | 938 | \term{\datatype{locale}} | 940 | \term{\datatype{locale}} |
1170 | 939 | 941 | ||
1171 | === modified file 'setup.py' | |||
1172 | --- setup.py 2011-03-24 18:29:45 +0000 | |||
1173 | +++ setup.py 2012-07-15 23:54:18 +0000 | |||
1174 | @@ -4,23 +4,21 @@ | |||
1175 | 4 | def alltests(): | 4 | def alltests(): |
1176 | 5 | import os | 5 | import os |
1177 | 6 | import sys | 6 | import sys |
1180 | 7 | from unittest import TestSuite | 7 | import unittest |
1181 | 8 | # use the zope.testing testrunner machinery to find all the | 8 | # use the zope.testrunner machinery to find all the |
1182 | 9 | # test suites we've put under ourselves | 9 | # test suites we've put under ourselves |
1187 | 10 | from zope.testing.testrunner import get_options | 10 | import zope.testrunner.find |
1188 | 11 | from zope.testing.testrunner import find_suites | 11 | import zope.testrunner.options |
1185 | 12 | from zope.testing.testrunner import configure_logging | ||
1186 | 13 | configure_logging() | ||
1189 | 14 | here = os.path.abspath(os.path.dirname(sys.argv[0])) | 12 | here = os.path.abspath(os.path.dirname(sys.argv[0])) |
1190 | 15 | args = sys.argv[:] | 13 | args = sys.argv[:] |
1191 | 16 | defaults = ["--test-path", here] | 14 | defaults = ["--test-path", here] |
1195 | 17 | options = get_options(args, defaults) | 15 | options = zope.testrunner.options.get_options(args, defaults) |
1196 | 18 | suites = list(find_suites(options)) | 16 | suites = list(zope.testrunner.find.find_suites(options)) |
1197 | 19 | return TestSuite(suites) | 17 | return unittest.TestSuite(suites) |
1198 | 20 | 18 | ||
1199 | 21 | options = dict( | 19 | options = dict( |
1200 | 22 | name="ZConfig", | 20 | name="ZConfig", |
1202 | 23 | version="2.8.0", | 21 | version="2.9.3", |
1203 | 24 | author="Fred L. Drake, Jr.", | 22 | author="Fred L. Drake, Jr.", |
1204 | 25 | author_email="fred@zope.com", | 23 | author_email="fred@zope.com", |
1205 | 26 | maintainer="Zope Foundation and Contributors", | 24 | maintainer="Zope Foundation and Contributors", |
1206 | @@ -53,12 +51,12 @@ | |||
1207 | 53 | "Programming Language :: Python :: 2.4", | 51 | "Programming Language :: Python :: 2.4", |
1208 | 54 | "Programming Language :: Python :: 2.5", | 52 | "Programming Language :: Python :: 2.5", |
1209 | 55 | "Programming Language :: Python :: 2.6", | 53 | "Programming Language :: Python :: 2.6", |
1211 | 56 | "Topic :: Software Development :: Libraries :: Python Modules", | 54 | "Programming Language :: Python :: 2.7", |
1212 | 57 | ], | 55 | ], |
1213 | 58 | # Support for 'setup.py test' when setuptools is available: | 56 | # Support for 'setup.py test' when setuptools is available: |
1214 | 59 | test_suite="__main__.alltests", | 57 | test_suite="__main__.alltests", |
1215 | 60 | tests_require=[ | 58 | tests_require=[ |
1217 | 61 | "zope.testing", | 59 | "zope.testrunner", |
1218 | 62 | ], | 60 | ], |
1219 | 63 | ) | 61 | ) |
1220 | 64 | 62 |
Looks good, thanks! I will sponsor it. Please submit a bug in Debian for them to update to the latest version, and then create a bug in Launchpad that links to it. This way, we can resync to Debian when the new version is available there.