Merge lp:~arsenal-devel/arsenal/python-launchpadlib-toolkit into lp:arsenal/trunk

Proposed by Brian Murray
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: not available
Proposed branch: lp:~arsenal-devel/arsenal/python-launchpadlib-toolkit
Merge into: lp:arsenal/trunk
Diff against target: 1411 lines (+1320/-0) (has conflicts)
17 files modified
AUTHORS (+5/-0)
COPYING (+341/-0)
COPYING.LIB (+510/-0)
NEWS (+26/-0)
README (+116/-0)
debian/changelog (+21/-0)
debian/compat (+1/-0)
debian/control (+20/-0)
debian/copyright (+34/-0)
debian/docs (+1/-0)
debian/pycompat (+1/-0)
debian/rules (+13/-0)
example-ls-series.py (+22/-0)
lpltoolkit/LaunchpadService.py (+142/-0)
lpltoolkit/__init__.py (+3/-0)
lpltoolkit/debug.py (+44/-0)
setup.py (+20/-0)
Conflict adding file AUTHORS.  Moved existing file to AUTHORS.moved.
Conflict adding file README.  Moved existing file to README.moved.
Conflict adding file debian.  Moved existing file to debian.moved.
Conflict adding file setup.py.  Moved existing file to setup.py.moved.
To merge this branch: bzr merge lp:~arsenal-devel/arsenal/python-launchpadlib-toolkit
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Review via email: mp+21182@code.launchpad.net

Description of the change

example-ls-series.py wasn't working for me so I fixed it and as I was adding in load_distro_series I noticed some more die statements in LaunchpadService.py so I fixed those.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi brian, looks good merged.

(Something was wrong with the merge proposal, so I just merged from your branch directly.)

Revision history for this message
Bryce Harrington (bryce) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'AUTHORS'
2--- AUTHORS 1970-01-01 00:00:00 +0000
3+++ AUTHORS 2010-03-11 21:15:48 +0000
4@@ -0,0 +1,5 @@
5+Maintainers:
6+ Bryce Harrington <bryce@canonical.com>
7+
8+Contributions, ideas, and inspiration from:
9+ Markus Korn <thekorn@gmx.de>
10
11=== renamed file 'AUTHORS' => 'AUTHORS.moved'
12=== added file 'COPYING'
13--- COPYING 1970-01-01 00:00:00 +0000
14+++ COPYING 2010-03-11 21:15:48 +0000
15@@ -0,0 +1,341 @@
16+ GNU GENERAL PUBLIC LICENSE
17+ Version 2, June 1991
18+
19+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
20+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21+ Everyone is permitted to copy and distribute verbatim copies
22+ of this license document, but changing it is not allowed.
23+
24+ Preamble
25+
26+ The licenses for most software are designed to take away your
27+freedom to share and change it. By contrast, the GNU General Public
28+License is intended to guarantee your freedom to share and change free
29+software--to make sure the software is free for all its users. This
30+General Public License applies to most of the Free Software
31+Foundation's software and to any other program whose authors commit to
32+using it. (Some other Free Software Foundation software is covered by
33+the GNU Library General Public License instead.) You can apply it to
34+your programs, too.
35+
36+ When we speak of free software, we are referring to freedom, not
37+price. Our General Public Licenses are designed to make sure that you
38+have the freedom to distribute copies of free software (and charge for
39+this service if you wish), that you receive source code or can get it
40+if you want it, that you can change the software or use pieces of it
41+in new free programs; and that you know you can do these things.
42+
43+ To protect your rights, we need to make restrictions that forbid
44+anyone to deny you these rights or to ask you to surrender the rights.
45+These restrictions translate to certain responsibilities for you if you
46+distribute copies of the software, or if you modify it.
47+
48+ For example, if you distribute copies of such a program, whether
49+gratis or for a fee, you must give the recipients all the rights that
50+you have. You must make sure that they, too, receive or can get the
51+source code. And you must show them these terms so they know their
52+rights.
53+
54+ We protect your rights with two steps: (1) copyright the software, and
55+(2) offer you this license which gives you legal permission to copy,
56+distribute and/or modify the software.
57+
58+ Also, for each author's protection and ours, we want to make certain
59+that everyone understands that there is no warranty for this free
60+software. If the software is modified by someone else and passed on, we
61+want its recipients to know that what they have is not the original, so
62+that any problems introduced by others will not reflect on the original
63+authors' reputations.
64+
65+ Finally, any free program is threatened constantly by software
66+patents. We wish to avoid the danger that redistributors of a free
67+program will individually obtain patent licenses, in effect making the
68+program proprietary. To prevent this, we have made it clear that any
69+patent must be licensed for everyone's free use or not licensed at all.
70+
71+ The precise terms and conditions for copying, distribution and
72+modification follow.
73+
74
75+ GNU GENERAL PUBLIC LICENSE
76+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
77+
78+ 0. This License applies to any program or other work which contains
79+a notice placed by the copyright holder saying it may be distributed
80+under the terms of this General Public License. The "Program", below,
81+refers to any such program or work, and a "work based on the Program"
82+means either the Program or any derivative work under copyright law:
83+that is to say, a work containing the Program or a portion of it,
84+either verbatim or with modifications and/or translated into another
85+language. (Hereinafter, translation is included without limitation in
86+the term "modification".) Each licensee is addressed as "you".
87+
88+Activities other than copying, distribution and modification are not
89+covered by this License; they are outside its scope. The act of
90+running the Program is not restricted, and the output from the Program
91+is covered only if its contents constitute a work based on the
92+Program (independent of having been made by running the Program).
93+Whether that is true depends on what the Program does.
94+
95+ 1. You may copy and distribute verbatim copies of the Program's
96+source code as you receive it, in any medium, provided that you
97+conspicuously and appropriately publish on each copy an appropriate
98+copyright notice and disclaimer of warranty; keep intact all the
99+notices that refer to this License and to the absence of any warranty;
100+and give any other recipients of the Program a copy of this License
101+along with the Program.
102+
103+You may charge a fee for the physical act of transferring a copy, and
104+you may at your option offer warranty protection in exchange for a fee.
105+
106+ 2. You may modify your copy or copies of the Program or any portion
107+of it, thus forming a work based on the Program, and copy and
108+distribute such modifications or work under the terms of Section 1
109+above, provided that you also meet all of these conditions:
110+
111+ a) You must cause the modified files to carry prominent notices
112+ stating that you changed the files and the date of any change.
113+
114+ b) You must cause any work that you distribute or publish, that in
115+ whole or in part contains or is derived from the Program or any
116+ part thereof, to be licensed as a whole at no charge to all third
117+ parties under the terms of this License.
118+
119+ c) If the modified program normally reads commands interactively
120+ when run, you must cause it, when started running for such
121+ interactive use in the most ordinary way, to print or display an
122+ announcement including an appropriate copyright notice and a
123+ notice that there is no warranty (or else, saying that you provide
124+ a warranty) and that users may redistribute the program under
125+ these conditions, and telling the user how to view a copy of this
126+ License. (Exception: if the Program itself is interactive but
127+ does not normally print such an announcement, your work based on
128+ the Program is not required to print an announcement.)
129+
130
131+These requirements apply to the modified work as a whole. If
132+identifiable sections of that work are not derived from the Program,
133+and can be reasonably considered independent and separate works in
134+themselves, then this License, and its terms, do not apply to those
135+sections when you distribute them as separate works. But when you
136+distribute the same sections as part of a whole which is a work based
137+on the Program, the distribution of the whole must be on the terms of
138+this License, whose permissions for other licensees extend to the
139+entire whole, and thus to each and every part regardless of who wrote it.
140+
141+Thus, it is not the intent of this section to claim rights or contest
142+your rights to work written entirely by you; rather, the intent is to
143+exercise the right to control the distribution of derivative or
144+collective works based on the Program.
145+
146+In addition, mere aggregation of another work not based on the Program
147+with the Program (or with a work based on the Program) on a volume of
148+a storage or distribution medium does not bring the other work under
149+the scope of this License.
150+
151+ 3. You may copy and distribute the Program (or a work based on it,
152+under Section 2) in object code or executable form under the terms of
153+Sections 1 and 2 above provided that you also do one of the following:
154+
155+ a) Accompany it with the complete corresponding machine-readable
156+ source code, which must be distributed under the terms of Sections
157+ 1 and 2 above on a medium customarily used for software interchange; or,
158+
159+ b) Accompany it with a written offer, valid for at least three
160+ years, to give any third party, for a charge no more than your
161+ cost of physically performing source distribution, a complete
162+ machine-readable copy of the corresponding source code, to be
163+ distributed under the terms of Sections 1 and 2 above on a medium
164+ customarily used for software interchange; or,
165+
166+ c) Accompany it with the information you received as to the offer
167+ to distribute corresponding source code. (This alternative is
168+ allowed only for noncommercial distribution and only if you
169+ received the program in object code or executable form with such
170+ an offer, in accord with Subsection b above.)
171+
172+The source code for a work means the preferred form of the work for
173+making modifications to it. For an executable work, complete source
174+code means all the source code for all modules it contains, plus any
175+associated interface definition files, plus the scripts used to
176+control compilation and installation of the executable. However, as a
177+special exception, the source code distributed need not include
178+anything that is normally distributed (in either source or binary
179+form) with the major components (compiler, kernel, and so on) of the
180+operating system on which the executable runs, unless that component
181+itself accompanies the executable.
182+
183+If distribution of executable or object code is made by offering
184+access to copy from a designated place, then offering equivalent
185+access to copy the source code from the same place counts as
186+distribution of the source code, even though third parties are not
187+compelled to copy the source along with the object code.
188+
189
190+ 4. You may not copy, modify, sublicense, or distribute the Program
191+except as expressly provided under this License. Any attempt
192+otherwise to copy, modify, sublicense or distribute the Program is
193+void, and will automatically terminate your rights under this License.
194+However, parties who have received copies, or rights, from you under
195+this License will not have their licenses terminated so long as such
196+parties remain in full compliance.
197+
198+ 5. You are not required to accept this License, since you have not
199+signed it. However, nothing else grants you permission to modify or
200+distribute the Program or its derivative works. These actions are
201+prohibited by law if you do not accept this License. Therefore, by
202+modifying or distributing the Program (or any work based on the
203+Program), you indicate your acceptance of this License to do so, and
204+all its terms and conditions for copying, distributing or modifying
205+the Program or works based on it.
206+
207+ 6. Each time you redistribute the Program (or any work based on the
208+Program), the recipient automatically receives a license from the
209+original licensor to copy, distribute or modify the Program subject to
210+these terms and conditions. You may not impose any further
211+restrictions on the recipients' exercise of the rights granted herein.
212+You are not responsible for enforcing compliance by third parties to
213+this License.
214+
215+ 7. If, as a consequence of a court judgment or allegation of patent
216+infringement or for any other reason (not limited to patent issues),
217+conditions are imposed on you (whether by court order, agreement or
218+otherwise) that contradict the conditions of this License, they do not
219+excuse you from the conditions of this License. If you cannot
220+distribute so as to satisfy simultaneously your obligations under this
221+License and any other pertinent obligations, then as a consequence you
222+may not distribute the Program at all. For example, if a patent
223+license would not permit royalty-free redistribution of the Program by
224+all those who receive copies directly or indirectly through you, then
225+the only way you could satisfy both it and this License would be to
226+refrain entirely from distribution of the Program.
227+
228+If any portion of this section is held invalid or unenforceable under
229+any particular circumstance, the balance of the section is intended to
230+apply and the section as a whole is intended to apply in other
231+circumstances.
232+
233+It is not the purpose of this section to induce you to infringe any
234+patents or other property right claims or to contest validity of any
235+such claims; this section has the sole purpose of protecting the
236+integrity of the free software distribution system, which is
237+implemented by public license practices. Many people have made
238+generous contributions to the wide range of software distributed
239+through that system in reliance on consistent application of that
240+system; it is up to the author/donor to decide if he or she is willing
241+to distribute software through any other system and a licensee cannot
242+impose that choice.
243+
244+This section is intended to make thoroughly clear what is believed to
245+be a consequence of the rest of this License.
246+
247
248+ 8. If the distribution and/or use of the Program is restricted in
249+certain countries either by patents or by copyrighted interfaces, the
250+original copyright holder who places the Program under this License
251+may add an explicit geographical distribution limitation excluding
252+those countries, so that distribution is permitted only in or among
253+countries not thus excluded. In such case, this License incorporates
254+the limitation as if written in the body of this License.
255+
256+ 9. The Free Software Foundation may publish revised and/or new versions
257+of the General Public License from time to time. Such new versions will
258+be similar in spirit to the present version, but may differ in detail to
259+address new problems or concerns.
260+
261+Each version is given a distinguishing version number. If the Program
262+specifies a version number of this License which applies to it and "any
263+later version", you have the option of following the terms and conditions
264+either of that version or of any later version published by the Free
265+Software Foundation. If the Program does not specify a version number of
266+this License, you may choose any version ever published by the Free Software
267+Foundation.
268+
269+ 10. If you wish to incorporate parts of the Program into other free
270+programs whose distribution conditions are different, write to the author
271+to ask for permission. For software which is copyrighted by the Free
272+Software Foundation, write to the Free Software Foundation; we sometimes
273+make exceptions for this. Our decision will be guided by the two goals
274+of preserving the free status of all derivatives of our free software and
275+of promoting the sharing and reuse of software generally.
276+
277+ NO WARRANTY
278+
279+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
280+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
281+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
282+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
283+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
284+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
285+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
286+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
287+REPAIR OR CORRECTION.
288+
289+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
290+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
291+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
292+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
293+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
294+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
295+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
296+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
297+POSSIBILITY OF SUCH DAMAGES.
298+
299+ END OF TERMS AND CONDITIONS
300+
301
302+ How to Apply These Terms to Your New Programs
303+
304+ If you develop a new program, and you want it to be of the greatest
305+possible use to the public, the best way to achieve this is to make it
306+free software which everyone can redistribute and change under these terms.
307+
308+ To do so, attach the following notices to the program. It is safest
309+to attach them to the start of each source file to most effectively
310+convey the exclusion of warranty; and each file should have at least
311+the "copyright" line and a pointer to where the full notice is found.
312+
313+ <one line to give the program's name and a brief idea of what it does.>
314+ Copyright (C) <year> <name of author>
315+
316+ This program is free software; you can redistribute it and/or modify
317+ it under the terms of the GNU General Public License as published by
318+ the Free Software Foundation; either version 2 of the License, or
319+ (at your option) any later version.
320+
321+ This program is distributed in the hope that it will be useful,
322+ but WITHOUT ANY WARRANTY; without even the implied warranty of
323+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
324+ GNU General Public License for more details.
325+
326+ You should have received a copy of the GNU General Public License
327+ along with this program; if not, write to the Free Software
328+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
329+
330+
331+Also add information on how to contact you by electronic and paper mail.
332+
333+If the program is interactive, make it output a short notice like this
334+when it starts in an interactive mode:
335+
336+ Gnomovision version 69, Copyright (C) year name of author
337+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
338+ This is free software, and you are welcome to redistribute it
339+ under certain conditions; type `show c' for details.
340+
341+The hypothetical commands `show w' and `show c' should show the appropriate
342+parts of the General Public License. Of course, the commands you use may
343+be called something other than `show w' and `show c'; they could even be
344+mouse-clicks or menu items--whatever suits your program.
345+
346+You should also get your employer (if you work as a programmer) or your
347+school, if any, to sign a "copyright disclaimer" for the program, if
348+necessary. Here is a sample; alter the names:
349+
350+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
351+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
352+
353+ <signature of Ty Coon>, 1 April 1989
354+ Ty Coon, President of Vice
355+
356+This General Public License does not permit incorporating your program into
357+proprietary programs. If your program is a subroutine library, you may
358+consider it more useful to permit linking proprietary applications with the
359+library. If this is what you want to do, use the GNU Library General
360+Public License instead of this License.
361+
362
363=== added file 'COPYING.LIB'
364--- COPYING.LIB 1970-01-01 00:00:00 +0000
365+++ COPYING.LIB 2010-03-11 21:15:48 +0000
366@@ -0,0 +1,510 @@
367+
368+ GNU LESSER GENERAL PUBLIC LICENSE
369+ Version 2.1, February 1999
370+
371+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
372+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
373+ Everyone is permitted to copy and distribute verbatim copies
374+ of this license document, but changing it is not allowed.
375+
376+[This is the first released version of the Lesser GPL. It also counts
377+ as the successor of the GNU Library Public License, version 2, hence
378+ the version number 2.1.]
379+
380+ Preamble
381+
382+ The licenses for most software are designed to take away your
383+freedom to share and change it. By contrast, the GNU General Public
384+Licenses are intended to guarantee your freedom to share and change
385+free software--to make sure the software is free for all its users.
386+
387+ This license, the Lesser General Public License, applies to some
388+specially designated software packages--typically libraries--of the
389+Free Software Foundation and other authors who decide to use it. You
390+can use it too, but we suggest you first think carefully about whether
391+this license or the ordinary General Public License is the better
392+strategy to use in any particular case, based on the explanations
393+below.
394+
395+ When we speak of free software, we are referring to freedom of use,
396+not price. Our General Public Licenses are designed to make sure that
397+you have the freedom to distribute copies of free software (and charge
398+for this service if you wish); that you receive source code or can get
399+it if you want it; that you can change the software and use pieces of
400+it in new free programs; and that you are informed that you can do
401+these things.
402+
403+ To protect your rights, we need to make restrictions that forbid
404+distributors to deny you these rights or to ask you to surrender these
405+rights. These restrictions translate to certain responsibilities for
406+you if you distribute copies of the library or if you modify it.
407+
408+ For example, if you distribute copies of the library, whether gratis
409+or for a fee, you must give the recipients all the rights that we gave
410+you. You must make sure that they, too, receive or can get the source
411+code. If you link other code with the library, you must provide
412+complete object files to the recipients, so that they can relink them
413+with the library after making changes to the library and recompiling
414+it. And you must show them these terms so they know their rights.
415+
416+ We protect your rights with a two-step method: (1) we copyright the
417+library, and (2) we offer you this license, which gives you legal
418+permission to copy, distribute and/or modify the library.
419+
420+ To protect each distributor, we want to make it very clear that
421+there is no warranty for the free library. Also, if the library is
422+modified by someone else and passed on, the recipients should know
423+that what they have is not the original version, so that the original
424+author's reputation will not be affected by problems that might be
425+introduced by others.
426+
427
428+ Finally, software patents pose a constant threat to the existence of
429+any free program. We wish to make sure that a company cannot
430+effectively restrict the users of a free program by obtaining a
431+restrictive license from a patent holder. Therefore, we insist that
432+any patent license obtained for a version of the library must be
433+consistent with the full freedom of use specified in this license.
434+
435+ Most GNU software, including some libraries, is covered by the
436+ordinary GNU General Public License. This license, the GNU Lesser
437+General Public License, applies to certain designated libraries, and
438+is quite different from the ordinary General Public License. We use
439+this license for certain libraries in order to permit linking those
440+libraries into non-free programs.
441+
442+ When a program is linked with a library, whether statically or using
443+a shared library, the combination of the two is legally speaking a
444+combined work, a derivative of the original library. The ordinary
445+General Public License therefore permits such linking only if the
446+entire combination fits its criteria of freedom. The Lesser General
447+Public License permits more lax criteria for linking other code with
448+the library.
449+
450+ We call this license the "Lesser" General Public License because it
451+does Less to protect the user's freedom than the ordinary General
452+Public License. It also provides other free software developers Less
453+of an advantage over competing non-free programs. These disadvantages
454+are the reason we use the ordinary General Public License for many
455+libraries. However, the Lesser license provides advantages in certain
456+special circumstances.
457+
458+ For example, on rare occasions, there may be a special need to
459+encourage the widest possible use of a certain library, so that it
460+becomes a de-facto standard. To achieve this, non-free programs must
461+be allowed to use the library. A more frequent case is that a free
462+library does the same job as widely used non-free libraries. In this
463+case, there is little to gain by limiting the free library to free
464+software only, so we use the Lesser General Public License.
465+
466+ In other cases, permission to use a particular library in non-free
467+programs enables a greater number of people to use a large body of
468+free software. For example, permission to use the GNU C Library in
469+non-free programs enables many more people to use the whole GNU
470+operating system, as well as its variant, the GNU/Linux operating
471+system.
472+
473+ Although the Lesser General Public License is Less protective of the
474+users' freedom, it does ensure that the user of a program that is
475+linked with the Library has the freedom and the wherewithal to run
476+that program using a modified version of the Library.
477+
478+ The precise terms and conditions for copying, distribution and
479+modification follow. Pay close attention to the difference between a
480+"work based on the library" and a "work that uses the library". The
481+former contains code derived from the library, whereas the latter must
482+be combined with the library in order to run.
483+
484
485+ GNU LESSER GENERAL PUBLIC LICENSE
486+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
487+
488+ 0. This License Agreement applies to any software library or other
489+program which contains a notice placed by the copyright holder or
490+other authorized party saying it may be distributed under the terms of
491+this Lesser General Public License (also called "this License").
492+Each licensee is addressed as "you".
493+
494+ A "library" means a collection of software functions and/or data
495+prepared so as to be conveniently linked with application programs
496+(which use some of those functions and data) to form executables.
497+
498+ The "Library", below, refers to any such software library or work
499+which has been distributed under these terms. A "work based on the
500+Library" means either the Library or any derivative work under
501+copyright law: that is to say, a work containing the Library or a
502+portion of it, either verbatim or with modifications and/or translated
503+straightforwardly into another language. (Hereinafter, translation is
504+included without limitation in the term "modification".)
505+
506+ "Source code" for a work means the preferred form of the work for
507+making modifications to it. For a library, complete source code means
508+all the source code for all modules it contains, plus any associated
509+interface definition files, plus the scripts used to control
510+compilation and installation of the library.
511+
512+ Activities other than copying, distribution and modification are not
513+covered by this License; they are outside its scope. The act of
514+running a program using the Library is not restricted, and output from
515+such a program is covered only if its contents constitute a work based
516+on the Library (independent of the use of the Library in a tool for
517+writing it). Whether that is true depends on what the Library does
518+and what the program that uses the Library does.
519+
520+ 1. You may copy and distribute verbatim copies of the Library's
521+complete source code as you receive it, in any medium, provided that
522+you conspicuously and appropriately publish on each copy an
523+appropriate copyright notice and disclaimer of warranty; keep intact
524+all the notices that refer to this License and to the absence of any
525+warranty; and distribute a copy of this License along with the
526+Library.
527+
528+ You may charge a fee for the physical act of transferring a copy,
529+and you may at your option offer warranty protection in exchange for a
530+fee.
531+
532
533+ 2. You may modify your copy or copies of the Library or any portion
534+of it, thus forming a work based on the Library, and copy and
535+distribute such modifications or work under the terms of Section 1
536+above, provided that you also meet all of these conditions:
537+
538+ a) The modified work must itself be a software library.
539+
540+ b) You must cause the files modified to carry prominent notices
541+ stating that you changed the files and the date of any change.
542+
543+ c) You must cause the whole of the work to be licensed at no
544+ charge to all third parties under the terms of this License.
545+
546+ d) If a facility in the modified Library refers to a function or a
547+ table of data to be supplied by an application program that uses
548+ the facility, other than as an argument passed when the facility
549+ is invoked, then you must make a good faith effort to ensure that,
550+ in the event an application does not supply such function or
551+ table, the facility still operates, and performs whatever part of
552+ its purpose remains meaningful.
553+
554+ (For example, a function in a library to compute square roots has
555+ a purpose that is entirely well-defined independent of the
556+ application. Therefore, Subsection 2d requires that any
557+ application-supplied function or table used by this function must
558+ be optional: if the application does not supply it, the square
559+ root function must still compute square roots.)
560+
561+These requirements apply to the modified work as a whole. If
562+identifiable sections of that work are not derived from the Library,
563+and can be reasonably considered independent and separate works in
564+themselves, then this License, and its terms, do not apply to those
565+sections when you distribute them as separate works. But when you
566+distribute the same sections as part of a whole which is a work based
567+on the Library, the distribution of the whole must be on the terms of
568+this License, whose permissions for other licensees extend to the
569+entire whole, and thus to each and every part regardless of who wrote
570+it.
571+
572+Thus, it is not the intent of this section to claim rights or contest
573+your rights to work written entirely by you; rather, the intent is to
574+exercise the right to control the distribution of derivative or
575+collective works based on the Library.
576+
577+In addition, mere aggregation of another work not based on the Library
578+with the Library (or with a work based on the Library) on a volume of
579+a storage or distribution medium does not bring the other work under
580+the scope of this License.
581+
582+ 3. You may opt to apply the terms of the ordinary GNU General Public
583+License instead of this License to a given copy of the Library. To do
584+this, you must alter all the notices that refer to this License, so
585+that they refer to the ordinary GNU General Public License, version 2,
586+instead of to this License. (If a newer version than version 2 of the
587+ordinary GNU General Public License has appeared, then you can specify
588+that version instead if you wish.) Do not make any other change in
589+these notices.
590+
591
592+ Once this change is made in a given copy, it is irreversible for
593+that copy, so the ordinary GNU General Public License applies to all
594+subsequent copies and derivative works made from that copy.
595+
596+ This option is useful when you wish to copy part of the code of
597+the Library into a program that is not a library.
598+
599+ 4. You may copy and distribute the Library (or a portion or
600+derivative of it, under Section 2) in object code or executable form
601+under the terms of Sections 1 and 2 above provided that you accompany
602+it with the complete corresponding machine-readable source code, which
603+must be distributed under the terms of Sections 1 and 2 above on a
604+medium customarily used for software interchange.
605+
606+ If distribution of object code is made by offering access to copy
607+from a designated place, then offering equivalent access to copy the
608+source code from the same place satisfies the requirement to
609+distribute the source code, even though third parties are not
610+compelled to copy the source along with the object code.
611+
612+ 5. A program that contains no derivative of any portion of the
613+Library, but is designed to work with the Library by being compiled or
614+linked with it, is called a "work that uses the Library". Such a
615+work, in isolation, is not a derivative work of the Library, and
616+therefore falls outside the scope of this License.
617+
618+ However, linking a "work that uses the Library" with the Library
619+creates an executable that is a derivative of the Library (because it
620+contains portions of the Library), rather than a "work that uses the
621+library". The executable is therefore covered by this License.
622+Section 6 states terms for distribution of such executables.
623+
624+ When a "work that uses the Library" uses material from a header file
625+that is part of the Library, the object code for the work may be a
626+derivative work of the Library even though the source code is not.
627+Whether this is true is especially significant if the work can be
628+linked without the Library, or if the work is itself a library. The
629+threshold for this to be true is not precisely defined by law.
630+
631+ If such an object file uses only numerical parameters, data
632+structure layouts and accessors, and small macros and small inline
633+functions (ten lines or less in length), then the use of the object
634+file is unrestricted, regardless of whether it is legally a derivative
635+work. (Executables containing this object code plus portions of the
636+Library will still fall under Section 6.)
637+
638+ Otherwise, if the work is a derivative of the Library, you may
639+distribute the object code for the work under the terms of Section 6.
640+Any executables containing that work also fall under Section 6,
641+whether or not they are linked directly with the Library itself.
642+
643
644+ 6. As an exception to the Sections above, you may also combine or
645+link a "work that uses the Library" with the Library to produce a
646+work containing portions of the Library, and distribute that work
647+under terms of your choice, provided that the terms permit
648+modification of the work for the customer's own use and reverse
649+engineering for debugging such modifications.
650+
651+ You must give prominent notice with each copy of the work that the
652+Library is used in it and that the Library and its use are covered by
653+this License. You must supply a copy of this License. If the work
654+during execution displays copyright notices, you must include the
655+copyright notice for the Library among them, as well as a reference
656+directing the user to the copy of this License. Also, you must do one
657+of these things:
658+
659+ a) Accompany the work with the complete corresponding
660+ machine-readable source code for the Library including whatever
661+ changes were used in the work (which must be distributed under
662+ Sections 1 and 2 above); and, if the work is an executable linked
663+ with the Library, with the complete machine-readable "work that
664+ uses the Library", as object code and/or source code, so that the
665+ user can modify the Library and then relink to produce a modified
666+ executable containing the modified Library. (It is understood
667+ that the user who changes the contents of definitions files in the
668+ Library will not necessarily be able to recompile the application
669+ to use the modified definitions.)
670+
671+ b) Use a suitable shared library mechanism for linking with the
672+ Library. A suitable mechanism is one that (1) uses at run time a
673+ copy of the library already present on the user's computer system,
674+ rather than copying library functions into the executable, and (2)
675+ will operate properly with a modified version of the library, if
676+ the user installs one, as long as the modified version is
677+ interface-compatible with the version that the work was made with.
678+
679+ c) Accompany the work with a written offer, valid for at least
680+ three years, to give the same user the materials specified in
681+ Subsection 6a, above, for a charge no more than the cost of
682+ performing this distribution.
683+
684+ d) If distribution of the work is made by offering access to copy
685+ from a designated place, offer equivalent access to copy the above
686+ specified materials from the same place.
687+
688+ e) Verify that the user has already received a copy of these
689+ materials or that you have already sent this user a copy.
690+
691+ For an executable, the required form of the "work that uses the
692+Library" must include any data and utility programs needed for
693+reproducing the executable from it. However, as a special exception,
694+the materials to be distributed need not include anything that is
695+normally distributed (in either source or binary form) with the major
696+components (compiler, kernel, and so on) of the operating system on
697+which the executable runs, unless that component itself accompanies
698+the executable.
699+
700+ It may happen that this requirement contradicts the license
701+restrictions of other proprietary libraries that do not normally
702+accompany the operating system. Such a contradiction means you cannot
703+use both them and the Library together in an executable that you
704+distribute.
705+
706
707+ 7. You may place library facilities that are a work based on the
708+Library side-by-side in a single library together with other library
709+facilities not covered by this License, and distribute such a combined
710+library, provided that the separate distribution of the work based on
711+the Library and of the other library facilities is otherwise
712+permitted, and provided that you do these two things:
713+
714+ a) Accompany the combined library with a copy of the same work
715+ based on the Library, uncombined with any other library
716+ facilities. This must be distributed under the terms of the
717+ Sections above.
718+
719+ b) Give prominent notice with the combined library of the fact
720+ that part of it is a work based on the Library, and explaining
721+ where to find the accompanying uncombined form of the same work.
722+
723+ 8. You may not copy, modify, sublicense, link with, or distribute
724+the Library except as expressly provided under this License. Any
725+attempt otherwise to copy, modify, sublicense, link with, or
726+distribute the Library is void, and will automatically terminate your
727+rights under this License. However, parties who have received copies,
728+or rights, from you under this License will not have their licenses
729+terminated so long as such parties remain in full compliance.
730+
731+ 9. You are not required to accept this License, since you have not
732+signed it. However, nothing else grants you permission to modify or
733+distribute the Library or its derivative works. These actions are
734+prohibited by law if you do not accept this License. Therefore, by
735+modifying or distributing the Library (or any work based on the
736+Library), you indicate your acceptance of this License to do so, and
737+all its terms and conditions for copying, distributing or modifying
738+the Library or works based on it.
739+
740+ 10. Each time you redistribute the Library (or any work based on the
741+Library), the recipient automatically receives a license from the
742+original licensor to copy, distribute, link with or modify the Library
743+subject to these terms and conditions. You may not impose any further
744+restrictions on the recipients' exercise of the rights granted herein.
745+You are not responsible for enforcing compliance by third parties with
746+this License.
747+
748
749+ 11. If, as a consequence of a court judgment or allegation of patent
750+infringement or for any other reason (not limited to patent issues),
751+conditions are imposed on you (whether by court order, agreement or
752+otherwise) that contradict the conditions of this License, they do not
753+excuse you from the conditions of this License. If you cannot
754+distribute so as to satisfy simultaneously your obligations under this
755+License and any other pertinent obligations, then as a consequence you
756+may not distribute the Library at all. For example, if a patent
757+license would not permit royalty-free redistribution of the Library by
758+all those who receive copies directly or indirectly through you, then
759+the only way you could satisfy both it and this License would be to
760+refrain entirely from distribution of the Library.
761+
762+If any portion of this section is held invalid or unenforceable under
763+any particular circumstance, the balance of the section is intended to
764+apply, and the section as a whole is intended to apply in other
765+circumstances.
766+
767+It is not the purpose of this section to induce you to infringe any
768+patents or other property right claims or to contest validity of any
769+such claims; this section has the sole purpose of protecting the
770+integrity of the free software distribution system which is
771+implemented by public license practices. Many people have made
772+generous contributions to the wide range of software distributed
773+through that system in reliance on consistent application of that
774+system; it is up to the author/donor to decide if he or she is willing
775+to distribute software through any other system and a licensee cannot
776+impose that choice.
777+
778+This section is intended to make thoroughly clear what is believed to
779+be a consequence of the rest of this License.
780+
781+ 12. If the distribution and/or use of the Library is restricted in
782+certain countries either by patents or by copyrighted interfaces, the
783+original copyright holder who places the Library under this License
784+may add an explicit geographical distribution limitation excluding those
785+countries, so that distribution is permitted only in or among
786+countries not thus excluded. In such case, this License incorporates
787+the limitation as if written in the body of this License.
788+
789+ 13. The Free Software Foundation may publish revised and/or new
790+versions of the Lesser General Public License from time to time.
791+Such new versions will be similar in spirit to the present version,
792+but may differ in detail to address new problems or concerns.
793+
794+Each version is given a distinguishing version number. If the Library
795+specifies a version number of this License which applies to it and
796+"any later version", you have the option of following the terms and
797+conditions either of that version or of any later version published by
798+the Free Software Foundation. If the Library does not specify a
799+license version number, you may choose any version ever published by
800+the Free Software Foundation.
801+
802
803+ 14. If you wish to incorporate parts of the Library into other free
804+programs whose distribution conditions are incompatible with these,
805+write to the author to ask for permission. For software which is
806+copyrighted by the Free Software Foundation, write to the Free
807+Software Foundation; we sometimes make exceptions for this. Our
808+decision will be guided by the two goals of preserving the free status
809+of all derivatives of our free software and of promoting the sharing
810+and reuse of software generally.
811+
812+ NO WARRANTY
813+
814+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
815+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
816+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
817+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
818+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
819+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
820+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
821+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
822+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
823+
824+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
825+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
826+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
827+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
828+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
829+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
830+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
831+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
832+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
833+DAMAGES.
834+
835+ END OF TERMS AND CONDITIONS
836+
837
838+ How to Apply These Terms to Your New Libraries
839+
840+ If you develop a new library, and you want it to be of the greatest
841+possible use to the public, we recommend making it free software that
842+everyone can redistribute and change. You can do so by permitting
843+redistribution under these terms (or, alternatively, under the terms
844+of the ordinary General Public License).
845+
846+ To apply these terms, attach the following notices to the library.
847+It is safest to attach them to the start of each source file to most
848+effectively convey the exclusion of warranty; and each file should
849+have at least the "copyright" line and a pointer to where the full
850+notice is found.
851+
852+
853+ <one line to give the library's name and a brief idea of what it does.>
854+ Copyright (C) <year> <name of author>
855+
856+ This library is free software; you can redistribute it and/or
857+ modify it under the terms of the GNU Lesser General Public
858+ License as published by the Free Software Foundation; either
859+ version 2.1 of the License, or (at your option) any later version.
860+
861+ This library is distributed in the hope that it will be useful,
862+ but WITHOUT ANY WARRANTY; without even the implied warranty of
863+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
864+ Lesser General Public License for more details.
865+
866+ You should have received a copy of the GNU Lesser General Public
867+ License along with this library; if not, write to the Free Software
868+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
869+
870+Also add information on how to contact you by electronic and paper mail.
871+
872+You should also get your employer (if you work as a programmer) or
873+your school, if any, to sign a "copyright disclaimer" for the library,
874+if necessary. Here is a sample; alter the names:
875+
876+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
877+ library `Frob' (a library for tweaking knobs) written by James
878+ Random Hacker.
879+
880+ <signature of Ty Coon>, 1 April 1990
881+ Ty Coon, President of Vice
882+
883+That's all there is to it!
884+
885+
886
887=== added file 'NEWS'
888--- NEWS 1970-01-01 00:00:00 +0000
889+++ NEWS 2010-03-11 21:15:48 +0000
890@@ -0,0 +1,26 @@
891+
892+
893+Sept 29, 2009 - Version 0.1
894+===========================
895+This is a first draft of the python-launchpadlib-toolkit package. The
896+principle motivation is the widespread duplication of effort in
897+implementing credential handling across a vast array of launchpadlib
898+applications.
899+
900+At Plumbers' it seems there is strong desire for more collaboration
901+between LPL scripters. Since pretty much every LPL script needs to do
902+credentials management, standardizing this into a sharable library seems
903+like a logical first step.
904+
905+There's so much similarity from one credentials implementation to
906+another that this probably could have started from anyone's code. I
907+opted to start with my own implementation from Arsenal since that's the
908+one I'm most familiar with. I've integrated some good implementation
909+ideas from Markus Korn's work on ilaunchpad-shell and ubuntu-dev-tools,
910+such as the nifty DebugStdOut trickery, the use of environment variables
911+for configuration, and the essense of his HTTPError exception handling.
912+
913+One of my major design goals was to keep it simple, so there's been
914+several ideas I've left out simply on the grounds that I wasn't sure if
915+they'd be that useful in real-world cases. Stuff can always be added
916+later as it's proven necessary!
917
918=== added file 'README'
919--- README 1970-01-01 00:00:00 +0000
920+++ README 2010-03-11 21:15:48 +0000
921@@ -0,0 +1,116 @@
922+LaunchpadLib Toolkit
923+====================
924+lpltoolkit is a set of classes for interacting with the Launchpad
925+service API library. It takes care of certain common chores such as
926+obtaining and managing login credentials.
927+
928+By factoring this common code out of individual launchpadlib projects,
929+it makes them more concise and more compatible with one another.
930+
931+
932+Basic Usage
933+===========
934+For most purposes, simply create the LaunchpadService object, which will
935+attend to the credentials automatically. Then retrieve a project object
936+(such as "ubuntu") and from there you can use all the regular Launchpad
937+API calls. In other words:
938+
939+ import lpltoolkit
940+
941+ lp = lpltoolkit.LaunchpadService()
942+ prj = lp.load_project("ubuntu")
943+
944+
945+See example-ls-series.py for a complete working example. Also try
946+running it with LPDEBUG turned on to see how to get debug info:
947+
948+ $ ./example-ls-series.py
949+
950+ $ LPDEBUG=1 ./example-ls-series.py
951+
952+For more elaborate real-world scripts, refer to the Arsenal project at:
953+
954+ http://launchpad.net/arsenal
955+
956+
957+Environment Variables
958+=====================
959+Configuration of the LaunchpadService behavior can be done via
960+environmental variables. This is done principly to make it easy to
961+debug issues without needing to tweak source code.
962+
963+The following environment variables are supported:
964+
965+ LPDEBUG Prints extra debugging messages to stderr if defined.
966+ If set to a numerical argument, it sets the httpdlib2
967+ debuglevel to that value; the http debug output will be
968+ filtered to redact your oauth token and signature, so
969+ you can attach debug info to public bugs without
970+ revealing anything sensitive.
971+
972+ LPSTAGING Use the staging service root rather than the live (edge)
973+ service. This allows testing of your script without
974+ risking actual changes to the official Launchpad.
975+
976+ LPCONFIG Use this directory path for configuration files, rather
977+ than the default of ~/.config/<consumer>. The directory
978+ will be created if it does not already exist.
979+
980+ LPCACHE Use this directory path for cache files (such as credentials),
981+ rather than the default of ~/.cache/<consumer>. The
982+ directory will be created if it does not already exist.
983+
984+
985+API - LaunchpadService
986+======================
987+
988+lp = LaunchpadService([config_path], [cache_path], [consumer])
989+
990+ Creates the Launchpad service object and retrieve credentials from
991+ Launchpad. LPSTAGING, LPCONFIG, and LPCACHE must be specified
992+ prior to instantiating the LaunchpadService object in order to have
993+ any effect.
994+
995+ config_path and cache_path allow the calling script to define the
996+ default paths if not specified by the environment variables.
997+
998+ On any unrecoverable error an exception is thrown.
999+
1000+lp.load_project(project)
1001+
1002+ Loads the named project (such as "ubuntu" distro), returning its
1003+ launchpadapi object.
1004+
1005+lp.reset()
1006+
1007+ Reloads the credentials and project (if any is specified). This is
1008+ handy for recovering from Launchpad out-of-service or other such
1009+ transient errors.
1010+
1011+lp.name: The credentialed consumer name (default: lpltoolkit)
1012+lp.launchpad: The launchpadlib launchpad object
1013+lp.project: The loaded Launchpad project (default: None)
1014+
1015+
1016+API - Debug
1017+===========
1018+dbg(msg), err(msg), die(msg)
1019+
1020+ Convenience routines for printing error and debug messages to
1021+ stderr. dbg() only prints if LPDEBUG is defined.
1022+
1023+StdOut, DebugStdOut
1024+
1025+ STDOUT overloads for debug output filtering. Set sys.stdout to
1026+ DebugStdOut to filter out oauth token and signature details.
1027+
1028+
1029+Wishlist
1030+========
1031+* Get this package into Universe, then into Main
1032+* Add a framework for storing config elements beyond just credentials
1033+* Integrate into existing launchpadlib scripts/applications
1034+* Wrapper classes for Bugs, SourcePackages, etc.
1035+* Strengthen the fault handling, provide better diagnostics, and be more
1036+ robust against Launchpad service failures
1037+
1038
1039=== renamed file 'README' => 'README.moved'
1040=== added directory 'debian'
1041=== renamed directory 'debian' => 'debian.moved'
1042=== added file 'debian/changelog'
1043--- debian/changelog 1970-01-01 00:00:00 +0000
1044+++ debian/changelog 2010-03-11 21:15:48 +0000
1045@@ -0,0 +1,21 @@
1046+python-launchpadlib-toolkit (UNRELEASED) karmic; urgency=low
1047+
1048+ * Fix parameter name in debug routine.
1049+
1050+ -- Bryce Harrington <bryce@ubuntu.com> Thu, 15 Oct 2009 18:51:22 -0700
1051+
1052+python-launchpadlib-toolkit (0.2) karmic; urgency=low
1053+
1054+ * Add handling of socket.error exceptions, which can be triggered when
1055+ the Launchpad service is unreachable (such as from a busted router).
1056+
1057+ -- Bryce Harrington <bryce@ubuntu.com> Tue, 06 Oct 2009 11:19:08 -0700
1058+
1059+python-launchpadlib-toolkit (0.1) karmic; urgency=low
1060+
1061+ * New revision, split off from arsenal, with ideas brazenly thieved from
1062+ Markus Korn's launchpadlib-shell.
1063+ * debian packaging borrowed/adapted from python-launchpad-bugs
1064+
1065+ -- Bryce Harrington <bryce@ubuntu.com> Tue, 29 Sep 2009 16:16:09 -0700
1066+
1067
1068=== added file 'debian/compat'
1069--- debian/compat 1970-01-01 00:00:00 +0000
1070+++ debian/compat 2010-03-11 21:15:48 +0000
1071@@ -0,0 +1,1 @@
1072+5
1073
1074=== added file 'debian/control'
1075--- debian/control 1970-01-01 00:00:00 +0000
1076+++ debian/control 2010-03-11 21:15:48 +0000
1077@@ -0,0 +1,20 @@
1078+Source: python-launchpadlib-toolkit
1079+Section: python
1080+Priority: extra
1081+Maintainer: Arsenal Developers <arsenal-devel@lists.launchpad.net>
1082+Build-Depends: cdbs (>= 0.4.43), debhelper (>= 5), python-central (>= 0.5), python-all-dev (>= 2.5)
1083+Standards-Version: 3.8.3
1084+XS-Vcs-Bzr: https://code.launchpad.net/~arsenal-devel/python-launchpadlib-toolkit/main
1085+XS-Python-Version: all
1086+
1087+Package: python-launchpadlib-toolkit
1088+Section: python
1089+Architecture: all
1090+Depends: ${python:Depends}, ${misc:Depends}, python (>= 2.5), python-launchpadlib
1091+XB-Python-Version: ${python:Versions}
1092+Description: convenience library for launchpadlib
1093+ Classes to manage credentials and access bug information
1094+ in Launchpad using the Launchpad API.
1095+ .
1096+ https://launchpad.net/arsenal/
1097+
1098
1099=== added file 'debian/copyright'
1100--- debian/copyright 1970-01-01 00:00:00 +0000
1101+++ debian/copyright 2010-03-11 21:15:48 +0000
1102@@ -0,0 +1,34 @@
1103+This package was debianized by Bryce Harrington <bryce@canonical.com> on
1104+Mon Sep 28 23:54:18 PDT 2009
1105+
1106+It was downloaded from
1107+#TBD
1108+
1109+Upstream Author:
1110+ Bryce Harrington <bryce@canonical.com>
1111+
1112+Copyright:
1113+ # Written by Bryce Harrington
1114+ # (C) Canonical, Ltd. Licensed under the GPL
1115+
1116+License:
1117+
1118+ This package is free software; you can redistribute it and/or modify
1119+ it under the terms of the GNU General Public License as published by
1120+ the Free Software Foundation; either version 2 of the License, or
1121+ (at your option) any later version.
1122+
1123+ This package is distributed in the hope that it will be useful,
1124+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1125+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1126+ GNU General Public License for more details.
1127+
1128+ You should have received a copy of the GNU General Public License
1129+ along with this package; if not, write to the Free Software
1130+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1131+
1132+On Debian systems, the complete text of the GNU General
1133+Public License can be found in `/usr/share/common-licenses/GPL'.
1134+
1135+The Debian packaging is (C) 2006, Daniel Holbach <daniel.holbach@ubuntu.com> and
1136+is licensed under the GPL, see above.
1137
1138=== added file 'debian/docs'
1139--- debian/docs 1970-01-01 00:00:00 +0000
1140+++ debian/docs 2010-03-11 21:15:48 +0000
1141@@ -0,0 +1,1 @@
1142+README
1143
1144=== added file 'debian/pycompat'
1145--- debian/pycompat 1970-01-01 00:00:00 +0000
1146+++ debian/pycompat 2010-03-11 21:15:48 +0000
1147@@ -0,0 +1,1 @@
1148+>= 2.4
1149
1150=== added file 'debian/rules'
1151--- debian/rules 1970-01-01 00:00:00 +0000
1152+++ debian/rules 2010-03-11 21:15:48 +0000
1153@@ -0,0 +1,13 @@
1154+#!/usr/bin/make -f
1155+
1156+DEB_PYTHON_SYSTEM := pycentral
1157+
1158+include /usr/share/cdbs/1/rules/debhelper.mk
1159+include /usr/share/cdbs/1/class/python-distutils.mk
1160+
1161+DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)
1162+arch-build::
1163+ rm -rf debian/arch-build
1164+ mkdir -p debian/arch-build/$(DEB_SOURCE_PACKAGE)-$(DEB_VERSION)
1165+ tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(DEB_SOURCE_PACKAGE)-$(DEB_VERSION);tar xf -)
1166+ (cd debian/arch-build/$(DEB_SOURCE_PACKAGE)-$(DEB_VERSION) && $(DEB_BUILD_PROG))
1167
1168=== added file 'example-ls-series.py'
1169--- example-ls-series.py 1970-01-01 00:00:00 +0000
1170+++ example-ls-series.py 2010-03-11 21:15:48 +0000
1171@@ -0,0 +1,22 @@
1172+#!/usr/bin/env python
1173+
1174+from lpltoolkit import LaunchpadService
1175+
1176+lp = LaunchpadService()
1177+d = lp.load_project("ubuntu")
1178+
1179+next_milestone = None
1180+for series in d.series:
1181+ print "%-10s %-20s %-25s" % (series.name,
1182+ series.status,
1183+ series.date_created)
1184+ if series.status == "Active Development" or series.status == "Pre-release Freeze":
1185+ for milestone in series.active_milestones:
1186+ print "%10s %-20s %-25s" % ("-->", milestone.name, milestone.date_targeted)
1187+ if milestone.date_targeted and not next_milestone:
1188+ next_milestone = milestone
1189+ elif next_milestone and milestone.date_targeted < next_milestone.date_targeted:
1190+ next_milestone = milestone
1191+
1192+print
1193+print "The next milestone is ", next_milestone.name
1194
1195=== added directory 'lpltoolkit'
1196=== added file 'lpltoolkit/LaunchpadService.py'
1197--- lpltoolkit/LaunchpadService.py 1970-01-01 00:00:00 +0000
1198+++ lpltoolkit/LaunchpadService.py 2010-03-11 21:15:48 +0000
1199@@ -0,0 +1,142 @@
1200+# High level interface to Launchpad API to manage credentials
1201+# Derived from bits of ubuntutools in ubuntu-dev-tools and Arsenal
1202+
1203+import os, sys, socket
1204+import httplib2
1205+
1206+from launchpadlib.credentials import Credentials
1207+from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
1208+from launchpadlib.errors import HTTPError
1209+
1210+from lpltoolkit.debug import *
1211+
1212+class LaunchpadService:
1213+ ''' High level interface to the launchpad service API '''
1214+
1215+ def __init__(self, config_path=None, cache_path=None, consumer='lpltoolkit'):
1216+ ''' Construct Launchpad object, including obtaining launchpad credentials '''
1217+ self._project_name = None
1218+ self._configdir = None
1219+ self._cachedir = None
1220+ self._service_root = EDGE_SERVICE_ROOT
1221+ self.name = consumer
1222+ self.project = None
1223+ self.launchpad = None
1224+
1225+ ''' Debugging '''
1226+ if "LPDEBUG" in os.environ:
1227+ httplib2.debuglevel = os.getenv("LPDEBUG", None)
1228+ sys.stdout = DebugStdOut()
1229+
1230+ ''' Service root '''
1231+ if "LPSTAGING" in os.environ:
1232+ self._service_root = STAGING_SERVICE_ROOT
1233+ elif "LPEDGE" in os.environ:
1234+ self._service_root = EDGE_SERVICE_ROOT
1235+
1236+ home = os.path.expanduser('~')
1237+
1238+ ''' Config dir '''
1239+ if "LPCONFIG" in os.environ:
1240+ self._confdir = os.getenv("LPCONFIG", None)
1241+ elif config_path:
1242+ self._confdir = config_path
1243+ else:
1244+ self._confdir = os.path.join(home, '.config', self.name)
1245+ if not os.path.exists(self._confdir):
1246+ dbg("Creating config directory %s" %(self._confdir))
1247+ os.makedirs(self._confdir)
1248+ assert os.path.exists(self._confdir)
1249+
1250+ ''' Cache dir '''
1251+ if "LPCACHE" in os.environ:
1252+ self._cachedir = os.getenv("LPCACHE", None)
1253+ elif cache_path:
1254+ self._cachedir = cache_path
1255+ else:
1256+ self._cachedir = os.path.join(home, '.cache', self.name)
1257+ if not os.path.exists(self._cachedir):
1258+ dbg("Creating cache directory %s" %(self._cachedir))
1259+ os.makedirs(self._cachedir,0700)
1260+ assert os.path.exists(self._cachedir)
1261+
1262+ try:
1263+ self._get_creds()
1264+ except:
1265+ sys.stderr.write("Could not access Launchpad.")
1266+ sys.exit(1)
1267+ return None
1268+
1269+ def _get_creds(self):
1270+ ''' Credentials '''
1271+ retrieve_credentials = False
1272+ self._credentials_file = os.path.join(self._confdir, "lp-credentials.txt")
1273+ if not os.path.exists(self._credentials_file):
1274+ retrieve_credentials = True
1275+ else:
1276+ try:
1277+ credentials = Credentials()
1278+ dbg("Loading credentials from %s" %(self._credentials_file))
1279+ credentials.load(open(self._credentials_file))
1280+ self.launchpad = Launchpad(credentials, self._service_root, self._cachedir)
1281+ except socket.error:
1282+ excType, excValue, excTraceback = sys.exc_info()
1283+ dbg(" %s\n" %(excValue.response))
1284+ dbg(" %s\n" %(excValue.content))
1285+ sys.stderr.write("Launchpad service connection timed out")
1286+ sys.exit(1)
1287+
1288+ except HTTPError:
1289+ # Can I use e.code here?
1290+ excType, excValue, excTraceback = sys.exc_info()
1291+ err("Failed to retrieve credentials from Launchpad")
1292+ dbg(" %s\n" %(excValue.response))
1293+ dbg(" %s\n" %(excValue.content))
1294+ retrieve_credentials = True
1295+
1296+ if retrieve_credentials:
1297+ dbg("Retrieving token and login")
1298+ try:
1299+ self.launchpad = Launchpad.get_token_and_login(self.name, self._service_root, self._cachedir)
1300+ credfd = open(self._credentials_file, "w")
1301+ os.chmod(self._credentials_file, 0600)
1302+ dbg("Saving retrieved credentials to %s" %(self._credentials_file))
1303+ self.launchpad.credentials.save(credfd)
1304+ credfd.close()
1305+ except:
1306+ sys.stderr.write("Could not set up Launchpad")
1307+ sys.exit(1)
1308+
1309+ return True
1310+
1311+ def reset(self):
1312+ self._get_creds()
1313+
1314+ if self._project_name:
1315+ dbg("Reloading project %s" %(self._project_name))
1316+ self.load_project(self._project_name)
1317+
1318+ def load_project(self, project):
1319+ try:
1320+ if self._service_root == STAGING_SERVICE_ROOT:
1321+ self.project = self.launchpad.load("https://api.staging.launchpad.net/beta/" + project)
1322+ else:
1323+ self.project = self.launchpad.load("https://api.edge.launchpad.net/beta/" + project)
1324+ except:
1325+ err("Exception cast loading project %s" % (project))
1326+ self.project = None
1327+
1328+ return self.project
1329+
1330+ def load_distro_series(self, distro, series):
1331+ try:
1332+ if self._service_root == STAGING_SERVICE_ROOT:
1333+ self.distro_series = self.launchpad.load("https://api.staging.launchpad.net/beta/%s/%s" % (distro, series))
1334+ else:
1335+ self.distro_series = self.launchpad.load("https://api.edge.launchpad.net/beta/%s/%s" % (distro, series))
1336+ except:
1337+ err("Exception cast loading distro %s and series %s" % (distro, series))
1338+ self.distro_series = None
1339+ sys.exit(1)
1340+
1341+ return self.distro_series
1342
1343=== added file 'lpltoolkit/__init__.py'
1344--- lpltoolkit/__init__.py 1970-01-01 00:00:00 +0000
1345+++ lpltoolkit/__init__.py 2010-03-11 21:15:48 +0000
1346@@ -0,0 +1,3 @@
1347+from lpltoolkit.LaunchpadService import LaunchpadService
1348+from lpltoolkit.debug import dbg, err, die, StdOut, DebugStdOut, dump_launchpad_object
1349+
1350
1351=== added file 'lpltoolkit/debug.py'
1352--- lpltoolkit/debug.py 1970-01-01 00:00:00 +0000
1353+++ lpltoolkit/debug.py 2010-03-11 21:15:48 +0000
1354@@ -0,0 +1,44 @@
1355+# Utility routines and classes for debugging info
1356+
1357+# (C) Copyright 2009, Markus Korn <thekorn@gmx.de>
1358+# (C) Copyright 2009, Bryce Harrington <bryce@canonical.com>
1359+
1360+import re, os, sys
1361+
1362+def dbg(msg):
1363+ if "LPDEBUG" in os.environ:
1364+ sys.stderr.write("%s\n" %(msg))
1365+
1366+def err(msg):
1367+ sys.stderr.write("Error: %s\n" %(msg))
1368+
1369+def die(msg):
1370+ sys.stderr.write("Fatal: %s\n" %(msg))
1371+ sys.exit(1)
1372+
1373+StdOut = sys.stdout
1374+class DebugStdOut(object):
1375+ '''
1376+ Debug version of STDOUT to redact out the oauth credentials
1377+ so that if the debug output is posted to a bug, it will not include
1378+ this sensitive info.
1379+ '''
1380+
1381+ RE_OAUTH_TOKEN = re.compile(r"oauth_token=\"([^\"]{2})[^\"]*")
1382+ RE_OAUTH_SIGNATURE = re.compile(r"oauth_signature=\"([^\"]{3})[^\"]*")
1383+
1384+ def write(self, txt):
1385+ txt = DebugStdOut.RE_OAUTH_SIGNATURE.sub(r"""oauth_signature="\1YYYYYYY""", txt)
1386+ txt = DebugStdOut.RE_OAUTH_TOKEN.sub(r"""oauth_token="\1XXXXXXXX""", txt)
1387+ StdOut.write(txt)
1388+
1389+ def __getattr__(self, name):
1390+ return getattr(StdOut, name)
1391+
1392+def dump_launchpad_object(i):
1393+ print repr(i)
1394+ print " attr: ", sorted(i.lp_attributes)
1395+ print " ops: ", sorted(i.lp_operations)
1396+ print " coll: ", sorted(i.lp_collections)
1397+ print " entr: ", sorted(i.lp_entries)
1398+ print
1399
1400=== added file 'setup.py'
1401--- setup.py 1970-01-01 00:00:00 +0000
1402+++ setup.py 2010-03-11 21:15:48 +0000
1403@@ -0,0 +1,20 @@
1404+#!/usr/bin/env python
1405+
1406+# Copyright (C) Canonical, Ltd. Licensed under the GPL
1407+
1408+from distutils.core import setup
1409+import os
1410+import re
1411+
1412+# look/set what version we have
1413+changelog = "debian/changelog"
1414+if os.path.exists(changelog):
1415+ head=open(changelog).readline()
1416+ match = re.compile(".*\((.*)\).*").match(head)
1417+ if match:
1418+ version = match.group(1)
1419+
1420+setup(name = 'python-launchpadlib-toolkit',
1421+ version = version,
1422+ packages = ['lpltoolkit'],
1423+)
1424
1425=== renamed file 'setup.py' => 'setup.py.moved'

Subscribers

People subscribed via source and target branches

to status/vote changes: