Skip to content

Commit 6242229

Browse files
Shigeki Ohtsubnoordhuis
Shigeki Ohtsu
authored andcommitted
tools: add python-gflags module
closure_linter needs the gflags module. PR-URL: #464 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 0cd9546 commit 6242229

20 files changed

+4122
-0
lines changed

tools/gflags/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

tools/gflags/COPYING

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2006, Google Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above
11+
copyright notice, this list of conditions and the following disclaimer
12+
in the documentation and/or other materials provided with the
13+
distribution.
14+
* Neither the name of Google Inc. nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

tools/gflags/ChangeLog

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Wed Jan 18 13:57:39 2012 Google Inc. <[email protected]>
2+
3+
* python-gflags: version 2.0
4+
* No changes from version 1.8.
5+
6+
Wed Jan 18 11:54:03 2012 Google Inc. <[email protected]>
7+
8+
* python-gflags: version 1.8
9+
* Don't raise DuplicateFlag when re-importing a module (mmcdonald)
10+
* Changed the 'official' python-gflags email in setup.py/etc
11+
* Changed copyright text to reflect Google's relinquished ownership
12+
13+
Tue Dec 20 17:10:41 2011 Google Inc. <[email protected]>
14+
15+
* python-gflags: version 1.7
16+
* Prepare gflags for python 3.x, keeping 2.4 compatibility (twouters)
17+
* If output is a tty, use terminal's width to wrap help-text (wiesmann)
18+
* PORTING: Fix ImportError for non-Unix platforms (kdeus)
19+
* PORTING: Run correctly when termios isn't available (shines)
20+
* Add unicode support to flags (csilvers)
21+
22+
Fri Jul 29 12:24:08 2011 Google Inc. <[email protected]>
23+
24+
* python-gflags: version 1.6
25+
* Document FlagValues.UseGnuGetOpt (garymm)
26+
* replace fchmod with chmod to work on python 2.4 (mshields)
27+
* Fix bug in flag decl reporting for dup flags (craigcitro)
28+
* Add multi_float, and tests for multi_float/int (simonf)
29+
* Make flagfiles expand in place, to follow docs (dmlynch)
30+
* Raise exception if --flagfile can't be read (tlim)
31+
32+
Wed Jan 26 13:50:46 2011 Google Inc. <[email protected]>
33+
34+
* python-gflags: version 1.5.1
35+
* Fix manifest and setup.py to include new files
36+
37+
Mon Jan 24 16:58:10 2011 Google Inc. <[email protected]>
38+
39+
* python-gflags: version 1.5
40+
* Add support for flag validators (olexiy)
41+
* Better reporting on UnrecognizedFlagError (sorenj)
42+
* Cache ArgumentParser, to save space (tmarek)
43+
44+
Wed Oct 13 17:40:12 2010 Google Inc. <[email protected]>
45+
46+
* python-gflags: version 1.4
47+
* Unregister per-command flags after running the command (dnr)
48+
* Allow key-flags to work with special flags (salcianu)
49+
* Allow printing flags of a specific module (mikecurtis)
50+
* BUGFIX: Fix an error message for float flags (olexiy)
51+
* BUGFIX: Can now import while defining flags (salcianu)
52+
* BUGFIX: Fix flagfile parsing in python (chronos)
53+
* DOC: Better explain the format of --helpxml output (salcianu)
54+
* DOC: Better error message on parse failure (tstromberg)
55+
* Better test coverage under python 2.2 (mshields)
56+
* Added a Makefile for building the packages.
57+
58+
Mon Jan 4 18:46:29 2010 Tim 'mithro' Ansell <[email protected]>
59+
60+
* python-gflags: version 1.3
61+
* Fork from the C++ package (google-gflags 1.3)
62+
* Add debian packaging

tools/gflags/MANIFEST.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
include AUTHORS
2+
include COPYING
3+
include ChangeLog
4+
include MANIFEST.in
5+
include Makefile
6+
include NEWS
7+
include README
8+
include debian/README
9+
include debian/changelog
10+
include debian/compat
11+
include debian/control
12+
include debian/copyright
13+
include debian/docs
14+
include debian/rules
15+
include gflags.py
16+
include gflags2man.py
17+
include gflags_validators.py
18+
include setup.py
19+
recursive-include tests *.py

tools/gflags/Makefile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
prep:
3+
@echo
4+
# Install needed packages
5+
sudo apt-get install subversion fakeroot python-setuptools python-subversion
6+
#
7+
@echo
8+
# Check that the person has .pypirc
9+
@if [ ! -e ~/.pypirc ]; then \
10+
echo "Please create a ~/.pypirc with the following contents:"; \
11+
echo "[server-login]"; \
12+
echo "username:google_opensource"; \
13+
echo "password:<see valentine>"; \
14+
fi
15+
#
16+
@echo
17+
# FIXME(tansell): Check that the person has .dputrc for PPA
18+
19+
clean:
20+
# Clean up any build files.
21+
python setup.py clean --all
22+
#
23+
# Clean up the debian stuff
24+
fakeroot ./debian/rules clean
25+
#
26+
# Clean up everything else
27+
rm MANIFEST || true
28+
rm -rf build-*
29+
#
30+
# Clean up the egg files
31+
rm -rf *egg*
32+
#
33+
# Remove dist
34+
rm -rf dist
35+
36+
dist:
37+
# Generate the tarball based on MANIFEST.in
38+
python setup.py sdist
39+
#
40+
# Build the debian packages
41+
fakeroot ./debian/rules binary
42+
mv ../python-gflags*.deb ./dist/
43+
#
44+
# Build the python Egg
45+
python setup.py bdist_egg
46+
#
47+
@echo
48+
@echo "Files to upload:"
49+
@echo "--------------------------"
50+
@ls -l ./dist/
51+
52+
push:
53+
# Send the updates to svn
54+
# Upload the source package to code.google.com
55+
- /home/build/opensource/tools/googlecode_upload.py \
56+
-p python-gflags ./dist/*
57+
#
58+
# Upload the package to PyPi
59+
- python setup.py sdist upload
60+
- python setup.py bdist_egg upload
61+
#
62+
# Upload the package to the ppa
63+
# FIXME(tansell): dput should run here
64+
65+
check:
66+
# Run all the tests.
67+
for test in tests/*.py; do PYTHONPATH=. python $$test || exit 1; done
68+
69+
.PHONY: prep dist clean push check

tools/gflags/NEWS

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
== 18 January 2012 ==
2+
3+
[Prependum:] I just realized I should have named the new version 2.0,
4+
to reflect the new ownership and status as a community run project.
5+
Not too late, I guess. I've just released python-gflags 2.0, which is
6+
identical to python-gflags 1.8 except for the version number.
7+
8+
I've just released python-gflags 1.8. This fixes a bug, allowing
9+
modules defining flags to be re-imported without raising duplicate
10+
flag errors.
11+
12+
Administrative note: In the coming weeks, I'll be stepping down as
13+
maintainer for the python-gflags project, and as part of that Google
14+
is relinquishing ownership of the project; it will now be entirely
15+
community run. The remaining
16+
[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.8/ChangeLog changes]
17+
in this release reflect that shift.
18+
19+
20+
=== 20 December 2011 ===
21+
22+
I've just released python-gflags 1.7. The major change here is
23+
improved unicode support, in both flag default values and
24+
help-strings. We've also made big steps toward making gflags work
25+
with python 3.x (while keeping 2.4 compatibility), and improving
26+
--help output in the common case where output is a tty.
27+
28+
For a full list of changes since last release, see the
29+
[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.7/ChangeLog ChangeLog].
30+
31+
=== 29 July 2011 ===
32+
33+
I've just released python-gflags 1.6. This release has only minor
34+
changes, including support for multi_float flags. The full list of
35+
changes is in the
36+
[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.6/ChangeLog ChangeLog].
37+
38+
The major change with this release is procedural: I've changed the
39+
internal tools used to integrate Google-supplied patches for gflags
40+
into the opensource release. These new tools should result in more
41+
frequent updates with better change descriptions. They will also
42+
result in future `ChangeLog` entries being much more verbose (for
43+
better or for worse).
44+
45+
=== 26 January 2011 ===
46+
47+
I've just released python-gflags 1.5.1. I had improperly packaged
48+
python-gflags 1.5, so it probably doesn't work. All users who have
49+
updated to python-gflags 1.5 are encouraged to update again to 1.5.1.
50+
51+
=== 24 January 2011 ===
52+
53+
I've just released python-gflags 1.5. This release adds support for
54+
flag verifiers: small functions you can associate with flags, that are
55+
called whenever the flag value is set or modified, and can verify that
56+
the new value is legal. It also has other, minor changes, described
57+
in the
58+
[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.5/ChangeLog ChangeLog].
59+
60+
=== 11 October 2010 ===
61+
62+
I've just released python-gflags 1.4. This release has only minor
63+
changes from 1.3, including support for printing flags of a specific
64+
module, allowing key-flags to work with special flags, somewhat better
65+
error messaging, and
66+
[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.4/ChangeLog so forth].
67+
If 1.3 is working well for you, there's no particular reason to upgrade.
68+
69+
=== 4 January 2010 ===
70+
71+
I just released python-gflags 1.3. This is the first python-gflags
72+
release; it is version 1.3 because this code is forked from the 1.3
73+
release of google-gflags.
74+
75+
I don't have a tarball or .deb file up quite yet, so for now you will
76+
have to get the source files by browsing under the 'source'
77+
tag. Downloadable files will be available soon.

tools/gflags/PKG-INFO

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Metadata-Version: 1.0
2+
Name: python-gflags
3+
Version: 2.0
4+
Summary: Google Commandline Flags Module
5+
Home-page: http://code.google.com/p/python-gflags
6+
Author: Google Inc. and others
7+
Author-email: [email protected]
8+
License: BSD
9+
Description: UNKNOWN
10+
Platform: UNKNOWN

tools/gflags/README

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
This repository contains a python implementation of the Google commandline
2+
flags module.
3+
4+
GFlags defines a *distributed* command line system, replacing systems like
5+
getopt(), optparse and manual argument processing. Rather than an application
6+
having to define all flags in or near main(), each python module defines flags
7+
that are useful to it. When one python module imports another, it gains
8+
access to the other's flags.
9+
10+
It includes the ability to define flag types (boolean, float, interger, list),
11+
autogeneration of help (in both human and machine readable format) and reading
12+
arguments from a file. It also includes the ability to automatically generate
13+
man pages from the help flags.
14+
15+
Documentation for implementation is at the top of gflags.py file.
16+
17+
To install the python module, run
18+
python ./setup.py install
19+
20+
When you install this library, you also get a helper application,
21+
gflags2man.py, installed into /usr/local/bin. You can run gflags2man.py to
22+
create an instant man page, with all the commandline flags and their docs, for
23+
any C++ or python program you've written using the gflags library.

tools/gflags/debian/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The list of files here isn't complete. For a step-by-step guide on
2+
how to set this package up correctly, check out
3+
http://www.debian.org/doc/maint-guide/
4+
5+
Most of the files that are in this directory are boilerplate.
6+
However, you may need to change the list of binary-arch dependencies
7+
in 'rules'.

tools/gflags/debian/changelog

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
python-gflags (2.0-1) unstable; urgency=low
2+
3+
* New upstream release.
4+
5+
-- Google Inc. <[email protected]> Wed, 18 Jan 2012 13:57:39 -0800
6+
7+
python-gflags (1.8-1) unstable; urgency=low
8+
9+
* New upstream release.
10+
11+
-- Google Inc. <[email protected]> Wed, 18 Jan 2012 11:54:03 -0800
12+
13+
python-gflags (1.7-1) unstable; urgency=low
14+
15+
* New upstream release.
16+
17+
-- Google Inc. <[email protected]> Tue, 20 Dec 2011 17:10:41 -0800
18+
19+
python-gflags (1.6-1) unstable; urgency=low
20+
21+
* New upstream release.
22+
23+
-- Google Inc. <[email protected]> Fri, 29 Jul 2011 12:24:08 -0700
24+
25+
python-gflags (1.5.1-1) unstable; urgency=low
26+
27+
* New upstream release (fixes manifest and setup.py files)
28+
29+
-- Google Inc. <[email protected]> Wed, 26 Jan 2011 13:50:46 -0800
30+
31+
python-gflags (1.5-1) unstable; urgency=low
32+
33+
* New upstream release.
34+
35+
-- Google Inc. <[email protected]> Mon, 24 Jan 2011 16:58:10 -0800
36+
37+
python-gflags (1.4-1) unstable; urgency=low
38+
39+
* New upstream release.
40+
41+
-- Google Inc. <[email protected]> Wed, 13 Oct 2010 17:40:12 -0700
42+
43+
python-gflags (1.3-2) unstable; urgency=low
44+
45+
* Fixed man-page generation.
46+
47+
-- Tim 'mithro' Ansell <[email protected]> Mon, 07 Jan 2010 13:46:10 +1100
48+
49+
python-gflags (1.3-1) unstable; urgency=low
50+
51+
* Initial release.
52+
* Packaging based on gflags 1.3
53+
54+
-- Tim 'mithro' Ansell <[email protected]> Mon, 04 Jan 2010 18:46:10 -0800

tools/gflags/debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5

tools/gflags/debian/control

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Source: python-gflags
2+
Section: python
3+
XS-Python-Version: all
4+
Priority: optional
5+
Maintainer: Craig Silverstein <[email protected]>
6+
Build-Depends-Indep: python-central (>= 0.5.6), python-setuptools (>= 0.6b3-1), python-all
7+
Build-Depends: debhelper (>= 5.0.38)
8+
Standards-Version: 3.7.2
9+
10+
Package: python-gflags
11+
Architecture: all
12+
Depends: ${python:Depends}
13+
XB-Python-Version: ${python:Versions}
14+
Description: A Python implementation of the Google commandline flags module
15+
.
16+
GFlags defines a *distributed* command line system, replacing systems like
17+
getopt(), optparse and manual argument processing. Rather than an application
18+
having to define all flags in or near main(), each Python module defines flags
19+
that are useful to it. When one Python module imports another, it gains
20+
access to the other's flags.
21+
.
22+
It includes the ability to define flag types (boolean, float, interger, list),
23+
autogeneration of help (in both human and machine readable format) and reading
24+
arguments from a file. It also includes the ability to automatically generate
25+
man pages from the help flags.

0 commit comments

Comments
 (0)