Merge lp://staging/~gary/lazr.batchnavigator/license_and_build into lp://staging/~launchpad-pqm/lazr.batchnavigator/trunk

Proposed by Gary Poster
Status: Merged
Approved by: Francis J. Lacoste
Approved revision: 28
Merged at revision: not available
Proposed branch: lp://staging/~gary/lazr.batchnavigator/license_and_build
Merge into: lp://staging/~launchpad-pqm/lazr.batchnavigator/trunk
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~gary/lazr.batchnavigator/license_and_build
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) Approve
Review via email: mp+4853@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

The same changes as for the other lazr packages:

- license specifies v3 of LGPL

- buildout updates

Thanks

Gary

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

On March 24, 2009, Gary Poster wrote:
> Gary Poster has proposed merging
> lp:~gary/lazr.batchnavigator/license_and_build into
> lp:~launchpad-pqm/lazr.batchnavigator/trunk.
>
> 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

All good.

--
Francis J. Lacoste
<email address hidden>

review: Approve
Revision history for this message
Gary Poster (gary) wrote :

This was a mistaken review request. It simply updates the date, as requested in the review of lp:~gary/lazr.batchnavigator/build-license-changes. Sorry for the noise.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-03-03 19:43:53 +0000
+++ .bzrignore 2009-03-23 16:14:28 +0000
@@ -3,6 +3,9 @@
3.installed.cfg3.installed.cfg
4develop-eggs4develop-eggs
5parts5parts
6src/lazr.batchnavigator.egg-info6*.egg-info
7tags7tags
8TAGS8TAGS
9build
10*.egg
11dist
912
=== modified file 'HACKING.txt'
--- HACKING.txt 2009-03-03 19:43:53 +0000
+++ HACKING.txt 2009-03-23 16:14:28 +0000
@@ -1,18 +1,18 @@
1..1..
2 This file is part of lazr.batchnavigator.2 This file is part of lazr.batchnavigator.
33
4 lazr.batchnavigator is free software: you can redistribute it and/or modify it4 lazr.batchnavigator is free software: you can redistribute it and/or
5 under the terms of the GNU Lesser General Public License as published by5 modify it under the terms of the GNU Lesser General Public License as
6 the Free Software Foundation, either version 3 of the License, or (at your6 published by the Free Software Foundation, version 3 of the License.
7 option) any later version.
87
9 lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT8 lazr.batchnavigator is distributed in the hope that it will be useful, but
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public10 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details.11 License for more details.
1312
14 You should have received a copy of the GNU Lesser General Public License13 You should have received a copy of the GNU Lesser General Public License
15 along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.14 along with lazr.batchnavigator. If not, see
15 <http://www.gnu.org/licenses/>.
1616
17This project uses zc.buildout for development.17This project uses zc.buildout for development.
1818
1919
=== added file 'MANIFEST.in'
--- MANIFEST.in 1970-01-01 00:00:00 +0000
+++ MANIFEST.in 2009-03-24 15:07:42 +0000
@@ -0,0 +1,2 @@
1exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore
2prune _bootstrap
03
=== modified file 'README.txt'
--- README.txt 2009-03-05 23:19:16 +0000
+++ README.txt 2009-03-23 16:14:28 +0000
@@ -3,15 +3,15 @@
3..3..
4 This file is part of lazr.batchnavigator.4 This file is part of lazr.batchnavigator.
55
6 lazr.batchnavigator is free software: you can redistribute it and/or modify it6 lazr.batchnavigator is free software: you can redistribute it and/or
7 under the terms of the GNU Lesser General Public License as published by7 modify it under the terms of the GNU Lesser General Public License as
8 the Free Software Foundation, either version 3 of the License, or (at your8 published by the Free Software Foundation, version 3 of the License.
9 option) any later version.
109
11 lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT10 lazr.batchnavigator is distributed in the hope that it will be useful, but
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.13 License for more details.
1514
16 You should have received a copy of the GNU Lesser General Public License15 You should have received a copy of the GNU Lesser General Public License
17 along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.16 along with lazr.batchnavigator. If not, see
17 <http://www.gnu.org/licenses/>.
1818
=== added directory '_bootstrap'
=== added file '_bootstrap/COPYRIGHT.txt'
--- _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000
+++ _bootstrap/COPYRIGHT.txt 2009-03-24 15:07:42 +0000
@@ -0,0 +1,9 @@
1Copyright (c) 2004-2009 Zope Corporation and Contributors.
2All Rights Reserved.
3
4This software is subject to the provisions of the Zope Public License,
5Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
6THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
7WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
9FOR A PARTICULAR PURPOSE.
010
=== added file '_bootstrap/LICENSE.txt'
--- _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000
+++ _bootstrap/LICENSE.txt 2009-03-24 15:07:42 +0000
@@ -0,0 +1,54 @@
1Zope Public License (ZPL) Version 2.1
2-------------------------------------
3
4A copyright notice accompanies this license document that
5identifies the copyright holders.
6
7This license has been certified as open source. It has also
8been designated as GPL compatible by the Free Software
9Foundation (FSF).
10
11Redistribution and use in source and binary forms, with or
12without modification, are permitted provided that the
13following conditions are met:
14
151. Redistributions in source code must retain the
16 accompanying copyright notice, this list of conditions,
17 and the following disclaimer.
18
192. Redistributions in binary form must reproduce the accompanying
20 copyright notice, this list of conditions, and the
21 following disclaimer in the documentation and/or other
22 materials provided with the distribution.
23
243. Names of the copyright holders must not be used to
25 endorse or promote products derived from this software
26 without prior written permission from the copyright
27 holders.
28
294. The right to distribute this software or to use it for
30 any purpose does not give you the right to use
31 Servicemarks (sm) or Trademarks (tm) of the copyright
32 holders. Use of them is covered by separate agreement
33 with the copyright holders.
34
355. If any files are modified, you must cause the modified
36 files to carry prominent notices stating that you changed
37 the files and the date of any change.
38
39Disclaimer
40
41 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
42 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
43 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
44 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
45 NO EVENT SHALL THE COPYRIGHT HOLDERS BE
46 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
47 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
52 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
53 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54 DAMAGE.
0\ No newline at end of file55\ No newline at end of file
156
=== renamed file 'bootstrap.py' => '_bootstrap/bootstrap.py'
=== added symlink 'bootstrap.py'
=== target is '_bootstrap/bootstrap.py'
=== modified file 'buildout.cfg'
--- buildout.cfg 2009-03-03 19:43:53 +0000
+++ buildout.cfg 2009-03-23 16:14:28 +0000
@@ -2,6 +2,7 @@
2parts =2parts =
3 interpreter3 interpreter
4 test4 test
5 docs
5 tags6 tags
6unzip = true7unzip = true
78
@@ -10,7 +11,14 @@
10[test]11[test]
11recipe = zc.recipe.testrunner12recipe = zc.recipe.testrunner
12eggs = lazr.batchnavigator13eggs = lazr.batchnavigator
13defaults = '--tests-pattern ^tests --exit-with-status'.split()14defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split()
15
16[docs]
17recipe = z3c.recipe.sphinxdoc
18eggs = lazr.batchnavigator [docs]
19index-doc = README
20default.css =
21layout.html =
1422
15[interpreter]23[interpreter]
16recipe = zc.recipe.egg24recipe = zc.recipe.egg
1725
=== added file 'ez_setup.py'
--- ez_setup.py 1970-01-01 00:00:00 +0000
+++ ez_setup.py 2009-03-23 16:14:28 +0000
@@ -0,0 +1,241 @@
1#!python
2"""Bootstrap setuptools installation
3
4If you want to use setuptools in your package's setup.py, just include this
5file in the same directory with it, and add this to the top of your setup.py::
6
7 from ez_setup import use_setuptools
8 use_setuptools()
9
10If you want to require a specific version of setuptools, set a download
11mirror, or use an alternate download directory, you can do so by supplying
12the appropriate options to ``use_setuptools()``.
13
14This file can also be run as a script to install or upgrade setuptools.
15"""
16import sys
17DEFAULT_VERSION = "0.6c8"
18DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
19
20md5_data = {
21 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
22 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
23 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
24 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
25 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
26 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
27 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
28 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
29 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
30 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
31 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
32 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
33 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
34 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
35 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
36 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
37 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
38 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
39 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
40 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
41 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
42 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
43 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
44 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
45 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
46 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
47 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
48 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
49 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
50 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
51}
52
53import sys, os
54
55def _validate_md5(egg_name, data):
56 if egg_name in md5_data:
57 from md5 import md5
58 digest = md5(data).hexdigest()
59 if digest != md5_data[egg_name]:
60 print >>sys.stderr, (
61 "md5 validation of %s failed! (Possible download problem?)"
62 % egg_name
63 )
64 sys.exit(2)
65 return data
66
67
68def use_setuptools(
69 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
70 download_delay=15, min_version=None
71):
72 """Automatically find/download setuptools and make it available on sys.path
73
74 `version` should be a valid setuptools version number that is available
75 as an egg for download under the `download_base` URL (which should end with
76 a '/'). `to_dir` is the directory where setuptools will be downloaded, if
77 it is not already available. If `download_delay` is specified, it should
78 be the number of seconds that will be paused before initiating a download,
79 should one be required. If an older version of setuptools is installed,
80 this routine will print a message to ``sys.stderr`` and raise SystemExit in
81 an attempt to abort the calling script.
82 """
83 # Work around a hack in the ez_setup.py file from simplejson==1.7.3.
84 if min_version:
85 version = min_version
86
87 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
88 def do_download():
89 egg = download_setuptools(version, download_base, to_dir, download_delay)
90 sys.path.insert(0, egg)
91 import setuptools; setuptools.bootstrap_install_from = egg
92 try:
93 import pkg_resources
94 except ImportError:
95 return do_download()
96 try:
97 pkg_resources.require("setuptools>="+version); return
98 except pkg_resources.VersionConflict, e:
99 if was_imported:
100 print >>sys.stderr, (
101 "The required version of setuptools (>=%s) is not available, and\n"
102 "can't be installed while this script is running. Please install\n"
103 " a more recent version first, using 'easy_install -U setuptools'."
104 "\n\n(Currently using %r)"
105 ) % (version, e.args[0])
106 sys.exit(2)
107 else:
108 del pkg_resources, sys.modules['pkg_resources'] # reload ok
109 return do_download()
110 except pkg_resources.DistributionNotFound:
111 return do_download()
112
113def download_setuptools(
114 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
115 delay = 15
116):
117 """Download setuptools from a specified location and return its filename
118
119 `version` should be a valid setuptools version number that is available
120 as an egg for download under the `download_base` URL (which should end
121 with a '/'). `to_dir` is the directory where the egg will be downloaded.
122 `delay` is the number of seconds to pause before an actual download attempt.
123 """
124 import urllib2, shutil
125 egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
126 url = download_base + egg_name
127 saveto = os.path.join(to_dir, egg_name)
128 src = dst = None
129 if not os.path.exists(saveto): # Avoid repeated downloads
130 try:
131 from distutils import log
132 if delay:
133 log.warn("""
134---------------------------------------------------------------------------
135This script requires setuptools version %s to run (even to display
136help). I will attempt to download it for you (from
137%s), but
138you may need to enable firewall access for this script first.
139I will start the download in %d seconds.
140
141(Note: if this machine does not have network access, please obtain the file
142
143 %s
144
145and place it in this directory before rerunning this script.)
146---------------------------------------------------------------------------""",
147 version, download_base, delay, url
148 ); from time import sleep; sleep(delay)
149 log.warn("Downloading %s", url)
150 src = urllib2.urlopen(url)
151 # Read/write all in one block, so we don't create a corrupt file
152 # if the download is interrupted.
153 data = _validate_md5(egg_name, src.read())
154 dst = open(saveto,"wb"); dst.write(data)
155 finally:
156 if src: src.close()
157 if dst: dst.close()
158 return os.path.realpath(saveto)
159
160def main(argv, version=DEFAULT_VERSION):
161 """Install or upgrade setuptools and EasyInstall"""
162 try:
163 import setuptools
164 except ImportError:
165 egg = None
166 try:
167 egg = download_setuptools(version, delay=0)
168 sys.path.insert(0,egg)
169 from setuptools.command.easy_install import main
170 return main(list(argv)+[egg]) # we're done here
171 finally:
172 if egg and os.path.exists(egg):
173 os.unlink(egg)
174 else:
175 if setuptools.__version__ == '0.0.1':
176 print >>sys.stderr, (
177 "You have an obsolete version of setuptools installed. Please\n"
178 "remove it from your system entirely before rerunning this script."
179 )
180 sys.exit(2)
181
182 req = "setuptools>="+version
183 import pkg_resources
184 try:
185 pkg_resources.require(req)
186 except pkg_resources.VersionConflict:
187 try:
188 from setuptools.command.easy_install import main
189 except ImportError:
190 from easy_install import main
191 main(list(argv)+[download_setuptools(delay=0)])
192 sys.exit(0) # try to force an exit
193 else:
194 if argv:
195 from setuptools.command.easy_install import main
196 main(argv)
197 else:
198 print "Setuptools version",version,"or greater has been installed."
199 print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
200
201def update_md5(filenames):
202 """Update our built-in md5 registry"""
203
204 import re
205 from md5 import md5
206
207 for name in filenames:
208 base = os.path.basename(name)
209 f = open(name,'rb')
210 md5_data[base] = md5(f.read()).hexdigest()
211 f.close()
212
213 data = [" %r: %r,\n" % it for it in md5_data.items()]
214 data.sort()
215 repl = "".join(data)
216
217 import inspect
218 srcfile = inspect.getsourcefile(sys.modules[__name__])
219 f = open(srcfile, 'rb'); src = f.read(); f.close()
220
221 match = re.search("\nmd5_data = {\n([^}]+)}", src)
222 if not match:
223 print >>sys.stderr, "Internal error!"
224 sys.exit(2)
225
226 src = src[:match.start(1)] + repl + src[match.end(1):]
227 f = open(srcfile,'w')
228 f.write(src)
229 f.close()
230
231
232if __name__=='__main__':
233 if len(sys.argv)>2 and sys.argv[1]=='--md5update':
234 update_md5(sys.argv[2:])
235 else:
236 main(sys.argv[1:])
237
238
239
240
241
0242
=== modified file 'setup.py' (properties changed: -x to +x)
--- setup.py 2009-03-05 23:19:16 +0000
+++ setup.py 2009-03-23 16:14:28 +0000
@@ -1,19 +1,23 @@
1#!/usr/bin/env python
2
1# Copyright 2009 Canonical Ltd. All rights reserved.3# Copyright 2009 Canonical Ltd. All rights reserved.
2#4#
3# This file is part of lazr.batchnavigator5# This file is part of lazr.batchnavigator
4#6#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify it7# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# under the terms of the GNU Lesser General Public License as published by8# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your9# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#10#
10# lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT11# lazr.batchnavigator is distributed in the hope that it will be useful, but
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13# License for more details.14# License for more details.
14#15#
15# You should have received a copy of the GNU Lesser General Public License16# You should have received a copy of the GNU Lesser General Public License
16# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.17# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
18
19import ez_setup
20ez_setup.use_setuptools()
1721
18import sys22import sys
19from setuptools import setup, find_packages23from setuptools import setup, find_packages
@@ -32,7 +36,8 @@
32 return '\n'.join(res)36 return '\n'.join(res)
33# end generic helpers37# end generic helpers
3438
35__version__ = '0.1'39sys.path.insert(0, 'src')
40from lazr.batchnavigator import __version__
3641
37setup(42setup(
38 name='lazr.batchnavigator',43 name='lazr.batchnavigator',
@@ -56,10 +61,17 @@
56 'zope.publisher',61 'zope.publisher',
57 ],62 ],
58 url='https://launchpad.net/lazr.batchnavigator',63 url='https://launchpad.net/lazr.batchnavigator',
64 download_url= 'https://launchpad.net/lazr.batchnavigator/+download',
59 classifiers=[65 classifiers=[
60 "Development Status :: 5 - Production/Stable",66 "Development Status :: 5 - Production/Stable",
61 "Intended Audience :: Developers",67 "Intended Audience :: Developers",
62 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",68 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
63 "Operating System :: OS Independent",69 "Operating System :: OS Independent",
64 "Programming Language :: Python"],70 "Programming Language :: Python"],
71 extras_require=dict(
72 docs=['Sphinx',
73 'z3c.recipe.sphinxdoc']
74 ),
75 setup_requires=['eggtestinfo', 'setuptools_bzr'],
76 test_suite='lazr.yourpkg.tests',
65 )77 )
6678
=== modified file 'src/lazr/__init__.py'
--- src/lazr/__init__.py 2009-03-03 19:43:53 +0000
+++ src/lazr/__init__.py 2009-03-23 16:14:28 +0000
@@ -2,18 +2,17 @@
2#2#
3# This file is part of lazr.batchnavigator.3# This file is part of lazr.batchnavigator.
4#4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify it5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your7# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#8#
10# lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT9# lazr.batchnavigator is distributed in the hope that it will be useful, but
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13# License for more details.12# License for more details.
14#13#
15# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
16# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
1716
18# this is a namespace package17# this is a namespace package
19try:18try:
2019
=== modified file 'src/lazr/batchnavigator/NEWS.txt'
--- src/lazr/batchnavigator/NEWS.txt 2009-03-03 19:43:53 +0000
+++ src/lazr/batchnavigator/NEWS.txt 2009-03-24 15:57:40 +0000
@@ -1,8 +1,8 @@
1=====================1============================
2NEWS for lazr.batchnavigator2NEWS for lazr.batchnavigator
3=====================3============================
44
51.0 (200X-XX-XX)51.0 (2009-03-24)
6================6================
77
8- Initial release8- Initial release on PyPI
99
=== modified file 'src/lazr/batchnavigator/README.txt'
--- src/lazr/batchnavigator/README.txt 2009-03-05 23:19:16 +0000
+++ src/lazr/batchnavigator/README.txt 2009-03-23 16:14:28 +0000
@@ -1,18 +1,18 @@
1..1..
2 This file is part of lazr.batchnavigator.2 This file is part of lazr.batchnavigator.
33
4 lazr.batchnavigator is free software: you can redistribute it and/or modify4 lazr.batchnavigator is free software: you can redistribute it and/or
5 it under the terms of the GNU Lesser General Public License as published by5 modify it under the terms of the GNU Lesser General Public License as
6 the Free Software Foundation, either version 3 of the License, or (at your6 published by the Free Software Foundation, version 3 of the License.
7 option) any later version.
87
9 lazr.batchnavigator is distributed in the hope that it will be useful, but8 lazr.batchnavigator is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY9 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public10 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details.11 License for more details.
1312
14 You should have received a copy of the GNU Lesser General Public License13 You should have received a copy of the GNU Lesser General Public License
15 along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.14 along with lazr.batchnavigator. If not, see
15 <http://www.gnu.org/licenses/>.
1616
17Batch Navigation17Batch Navigation
18****************18****************
@@ -40,7 +40,7 @@
40 >>> from zope.component import getSiteManager40 >>> from zope.component import getSiteManager
41 >>> sm = getSiteManager()41 >>> sm = getSiteManager()
42 >>> sm.registerAdapter(HTTPCharsets)42 >>> sm.registerAdapter(HTTPCharsets)
43 43
44 >>> def build_request(query_string_args=None, method='GET'):44 >>> def build_request(query_string_args=None, method='GET'):
45 ... if query_string_args is None:45 ... if query_string_args is None:
46 ... query_string = ''46 ... query_string = ''
@@ -119,7 +119,7 @@
119119
120 >>> last_reindeer_batch_navigator.firstBatchURL()120 >>> last_reindeer_batch_navigator.firstBatchURL()
121 'http://www.example.com/foo?start=0&batch=3'121 'http://www.example.com/foo?start=0&batch=3'
122 122
123 >>> last_reindeer_batch_navigator.prevBatchURL()123 >>> last_reindeer_batch_navigator.prevBatchURL()
124 'http://www.example.com/foo?start=0&batch=3'124 'http://www.example.com/foo?start=0&batch=3'
125125
@@ -176,7 +176,7 @@
176 ... 'batch': '3'}, method='POST')176 ... 'batch': '3'}, method='POST')
177 >>> reindeer_batch_navigator_post_with_qs = BatchNavigator(177 >>> reindeer_batch_navigator_post_with_qs = BatchNavigator(
178 ... reindeer, request)178 ... reindeer, request)
179 179
180 >>> reindeer_batch_navigator_post_with_qs.start180 >>> reindeer_batch_navigator_post_with_qs.start
181 3181 3
182 >>> reindeer_batch_navigator_post_with_qs.nextBatchURL()182 >>> reindeer_batch_navigator_post_with_qs.nextBatchURL()
@@ -207,7 +207,7 @@
207 ''207 ''
208 >>> null_batch_navigator.lastBatchURL()208 >>> null_batch_navigator.lastBatchURL()
209 ''209 ''
210 210
211 >>> null_batch_navigator = BatchNavigator(211 >>> null_batch_navigator = BatchNavigator(
212 ... [], build_request(), size=3)212 ... [], build_request(), size=3)
213 >>> null_batch_navigator.firstBatchURL()213 >>> null_batch_navigator.firstBatchURL()
@@ -242,7 +242,7 @@
242 ... def __init__(self, results):242 ... def __init__(self, results):
243 ... self.stub_results = results243 ... self.stub_results = results
244 ... def count(self):244 ... def count(self):
245 ... # imagine this actually returned 245 ... # imagine this actually returned
246 ... return len(self.stub_results)246 ... return len(self.stub_results)
247 ... def __getitem__(self, ix):247 ... def __getitem__(self, ix):
248 ... return self.stub_results[ix] # also works with slices248 ... return self.stub_results[ix] # also works with slices
@@ -300,7 +300,7 @@
300and it is undesirable or overly expensive to execute the query for300and it is undesirable or overly expensive to execute the query for
301every value in the entire result set.301every value in the entire result set.
302302
303The callback function must define two parameters. The first is the 303The callback function must define two parameters. The first is the
304batch navigator object itself, and the second it the current batch.304batch navigator object itself, and the second it the current batch.
305The callback function is called once and only once when the305The callback function is called once and only once when the
306BatchNavigator is constructed, and the current batch is determined.306BatchNavigator is constructed, and the current batch is determined.
@@ -308,13 +308,13 @@
308 >>> def print_callback(context, batch):308 >>> def print_callback(context, batch):
309 ... for item in batch:309 ... for item in batch:
310 ... print item310 ... print item
311 311
312 >>> reindeer_batch_navigator = BatchNavigator(312 >>> reindeer_batch_navigator = BatchNavigator(
313 ... reindeer, build_request(), size=3, callback=print_callback)313 ... reindeer, build_request(), size=3, callback=print_callback)
314 Dasher314 Dasher
315 Dancer315 Dancer
316 Prancer316 Prancer
317 317
318 >>> request = build_request({"start": "3", "batch": "20"})318 >>> request = build_request({"start": "3", "batch": "20"})
319 >>> last_reindeer_batch_navigator = BatchNavigator(319 >>> last_reindeer_batch_navigator = BatchNavigator(
320 ... reindeer, request=request, callback=print_callback)320 ... reindeer, request=request, callback=print_callback)
@@ -339,7 +339,7 @@
339 ... return BatchNavigator(339 ... return BatchNavigator(
340 ... reindeer, build_request(), size=3,340 ... reindeer, build_request(), size=3,
341 ... callback=self.constructReindeerFromAtoms)341 ... callback=self.constructReindeerFromAtoms)
342 342
343 >>> view = ReindeerView()343 >>> view = ReindeerView()
344 >>> batch_navigator = view.batchedReindeer()344 >>> batch_navigator = view.batchedReindeer()
345 >>> print view.built_reindeer345 >>> print view.built_reindeer
@@ -441,4 +441,14 @@
441 >>> sm.unregisterAdapter(HTTPCharsets)441 >>> sm.unregisterAdapter(HTTPCharsets)
442 True442 True
443 >>> sm.unregisterAdapter(ExampleAdapter)443 >>> sm.unregisterAdapter(ExampleAdapter)
444 True
445\ No newline at end of file444\ No newline at end of file
445 True
446
447===============
448Other Documents
449===============
450
451.. toctree::
452 :glob:
453
454 *
455 docs/*
446456
=== added file 'src/lazr/batchnavigator/__init__.py'
--- src/lazr/batchnavigator/__init__.py 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/__init__.py 2009-03-23 16:14:28 +0000
@@ -0,0 +1,30 @@
1# Copyright 2004-2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.batchnavigator
4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.batchnavigator is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
16
17"""Functions for working with generic syntax URIs."""
18
19__version__ = 1.0
20
21# Re-export in such a way that __version__ can still be imported if
22# dependencies are not yet available.
23try:
24 # While we generally frown on "*" imports, this, combined with the fact we
25 # only test code from this module, means that we can verify what has been
26 # exported.
27 from lazr.batchnavigator._batchnavigator import *
28 from lazr.batchnavigator._batchnavigator import __all__
29except ImportError:
30 pass
031
=== renamed file 'src/lazr/batchnavigator/__init__.py' => 'src/lazr/batchnavigator/_batchnavigator.py'
--- src/lazr/batchnavigator/__init__.py 2009-03-05 23:29:09 +0000
+++ src/lazr/batchnavigator/_batchnavigator.py 2009-03-23 16:14:28 +0000
@@ -2,18 +2,17 @@
2#2#
3# This file is part of lazr.batchnavigator3# This file is part of lazr.batchnavigator
4#4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify it5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your7# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#8#
10# lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT9# lazr.batchnavigator is distributed in the hope that it will be useful, but
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13# License for more details.12# License for more details.
14#13#
15# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
16# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
1716
18__metaclass__ = type17__metaclass__ = type
1918
@@ -27,6 +26,7 @@
27from lazr.batchnavigator.interfaces import (26from lazr.batchnavigator.interfaces import (
28 IBatchNavigator, InvalidBatchSizeError, IBatchNavigatorFactory)27 IBatchNavigator, InvalidBatchSizeError, IBatchNavigatorFactory)
2928
29__all__ = ['BatchNavigator']
3030
31class BatchNavigator:31class BatchNavigator:
3232
@@ -57,7 +57,7 @@
57 @Lazy57 @Lazy
58 def query_string_parameters(self):58 def query_string_parameters(self):
59 query_string = self.request.get('QUERY_STRING', '')59 query_string = self.request.get('QUERY_STRING', '')
60 60
61 # Just in case QUERY_STRING is in the environment explicitly as61 # Just in case QUERY_STRING is in the environment explicitly as
62 # None (Some tests seem to do this, but not sure if it can ever62 # None (Some tests seem to do this, but not sure if it can ever
63 # happen outside of tests.)63 # happen outside of tests.)
@@ -259,4 +259,3 @@
259259
260 def currentBatch(self):260 def currentBatch(self):
261 return self.batch261 return self.batch
262
263262
=== modified file 'src/lazr/batchnavigator/interfaces.py'
--- src/lazr/batchnavigator/interfaces.py 2009-03-05 23:29:09 +0000
+++ src/lazr/batchnavigator/interfaces.py 2009-03-23 16:14:28 +0000
@@ -2,18 +2,17 @@
2#2#
3# This file is part of lazr.batchnavigator3# This file is part of lazr.batchnavigator
4#4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify it5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your7# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#8#
10# lazr.batchnavigator is distributed in the hope that it will be useful, but WITHOUT9# lazr.batchnavigator is distributed in the hope that it will be useful, but
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13# License for more details.12# License for more details.
14#13#
15# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
16# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
1716
18from zope.interface import Interface, Attribute17from zope.interface import Interface, Attribute
1918
2019
=== modified file 'src/lazr/batchnavigator/tests/__init__.py'
--- src/lazr/batchnavigator/tests/__init__.py 2009-01-09 02:10:26 +0000
+++ src/lazr/batchnavigator/tests/__init__.py 2009-03-23 16:14:28 +0000
@@ -0,0 +1,16 @@
1# Copyright 2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.batchnavigator
4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.batchnavigator is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
16"The lazr.batchnavigator tests."
017
=== renamed file 'src/lazr/batchnavigator/tests/test_documentation.py' => 'src/lazr/batchnavigator/tests/test_docs.py'
--- src/lazr/batchnavigator/tests/test_documentation.py 2009-03-04 16:27:16 +0000
+++ src/lazr/batchnavigator/tests/test_docs.py 2009-03-23 16:14:28 +0000
@@ -1,14 +1,29 @@
1# Copyright 2009 Canonical Ltd. All rights reserved.1# Copyright 2009 Canonical Ltd. All rights reserved.
22#
3"""Test harness."""3# This file is part of lazr.batchnavigator
4#
5# lazr.batchnavigator is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.batchnavigator is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.batchnavigator. If not, see <http://www.gnu.org/licenses/>.
16"Test harness for doctests."
417
5__metaclass__ = type18__metaclass__ = type
6__all__ = [19__all__ = [
7 'test_suite',20 'additional_tests',
8 ]21 ]
922
23import atexit
24import doctest
10import os25import os
11import doctest26import pkg_resources
12import unittest27import unittest
1328
14DOCTEST_FLAGS = (29DOCTEST_FLAGS = (
@@ -16,12 +31,20 @@
16 doctest.NORMALIZE_WHITESPACE |31 doctest.NORMALIZE_WHITESPACE |
17 doctest.REPORT_NDIFF)32 doctest.REPORT_NDIFF)
1833
19def test_suite():34
20 readme = os.path.normpath(35def additional_tests():
36 "Run the doc tests (README.txt and docs/*, if any exist)"
37 doctest_files = [
21 os.path.abspath(38 os.path.abspath(
22 os.path.join(os.path.dirname(__file__),39 pkg_resources.resource_filename('lazr.batchnavigator', 'README.txt'))]
23 os.path.pardir,40 if pkg_resources.resource_exists('lazr.batchnavigator', 'docs'):
24 'README.txt')))41 for name in pkg_resources.resource_listdir('lazr.batchnavigator', 'docs'):
42 if name.endswith('.txt'):
43 doctest_files.append(
44 os.path.abspath(
45 pkg_resources.resource_filename(
46 'lazr.batchnavigator', 'docs/%s' % name)))
47 kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)
48 atexit.register(pkg_resources.cleanup_resources)
25 return unittest.TestSuite((49 return unittest.TestSuite((
26 doctest.DocFileSuite(50 doctest.DocFileSuite(*doctest_files, **kwargs)))
27 readme, module_relative=False, optionflags=DOCTEST_FLAGS)))
2851
=== modified file 'src/lazr/batchnavigator/tests/test_z3batching.py'
--- src/lazr/batchnavigator/tests/test_z3batching.py 2009-03-03 18:02:58 +0000
+++ src/lazr/batchnavigator/tests/test_z3batching.py 2009-03-23 16:14:28 +0000
@@ -199,10 +199,7 @@
199 self.assertEqual(batch.endNumber(), 100)199 self.assertEqual(batch.endNumber(), 100)
200200
201201
202def test_suite():202def additional_tests():
203 return unittest.TestSuite((203 return unittest.TestSuite((
204 unittest.makeSuite(BatchTest),204 unittest.makeSuite(BatchTest),
205 ))205 ))
206
207if __name__ == '__main__':
208 unittest.main()
209206
=== added file 'src/lazr/batchnavigator/z3batching/COPYRIGHT.txt'
--- src/lazr/batchnavigator/z3batching/COPYRIGHT.txt 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/z3batching/COPYRIGHT.txt 2009-03-24 15:07:42 +0000
@@ -0,0 +1,9 @@
1Copyright (c) 2004-2009 Zope Corporation and Contributors, and Canonical Ltd.
2All Rights Reserved.
3
4This software is subject to the provisions of the Zope Public License,
5Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
6THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
7WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
9FOR A PARTICULAR PURPOSE.
010
=== added file 'src/lazr/batchnavigator/z3batching/LICENSE.txt'
--- src/lazr/batchnavigator/z3batching/LICENSE.txt 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/z3batching/LICENSE.txt 2009-03-24 15:07:42 +0000
@@ -0,0 +1,54 @@
1Zope Public License (ZPL) Version 2.1
2-------------------------------------
3
4A copyright notice accompanies this license document that
5identifies the copyright holders.
6
7This license has been certified as open source. It has also
8been designated as GPL compatible by the Free Software
9Foundation (FSF).
10
11Redistribution and use in source and binary forms, with or
12without modification, are permitted provided that the
13following conditions are met:
14
151. Redistributions in source code must retain the
16 accompanying copyright notice, this list of conditions,
17 and the following disclaimer.
18
192. Redistributions in binary form must reproduce the accompanying
20 copyright notice, this list of conditions, and the
21 following disclaimer in the documentation and/or other
22 materials provided with the distribution.
23
243. Names of the copyright holders must not be used to
25 endorse or promote products derived from this software
26 without prior written permission from the copyright
27 holders.
28
294. The right to distribute this software or to use it for
30 any purpose does not give you the right to use
31 Servicemarks (sm) or Trademarks (tm) of the copyright
32 holders. Use of them is covered by separate agreement
33 with the copyright holders.
34
355. If any files are modified, you must cause the modified
36 files to carry prominent notices stating that you changed
37 the files and the date of any change.
38
39Disclaimer
40
41 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
42 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
43 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
44 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
45 NO EVENT SHALL THE COPYRIGHT HOLDERS BE
46 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
47 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
52 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
53 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54 DAMAGE.
0\ No newline at end of file55\ No newline at end of file
156
=== added file 'src/lazr/batchnavigator/z3batching/README.txt'
--- src/lazr/batchnavigator/z3batching/README.txt 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/z3batching/README.txt 2009-03-24 15:07:42 +0000
@@ -0,0 +1,5 @@
1This code is a very old fork of batching code from the Zope project. The
2z3c.batching package (http://pypi.python.org/pypi/z3c.batching) appears to
3have evolved from the same, or very similar, source. Ideally, we will be able
4to change lazr.batchnavigator to depend on z3c.batching, perhaps contributing
5to that package any necessary changes for our usage needs.

Subscribers

People subscribed via source and target branches