summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2010-06-04 06:49:40 +0200
committerMichele Simionato <michele.simionato@gmail.com>2010-06-04 06:49:40 +0200
commit8ba83434306d80091b50051b2d6cdd621a1b4329 (patch)
treee6163aae640940494047b8772d421b4bb1a9260c
parent0842740888483ca9438f4bd2817c239479795eb0 (diff)
downloadmicheles-8ba83434306d80091b50051b2d6cdd621a1b4329.tar.gz
Added missing .help files, made the tests generative and added a note about Clapin the documentation
-rw-r--r--plac/MANIFEST.in2
-rw-r--r--plac/doc/plac.html6
-rw-r--r--plac/doc/plac.pdf666
-rw-r--r--plac/doc/plac.txt7
-rw-r--r--plac/test_plac.py15
5 files changed, 392 insertions, 304 deletions
diff --git a/plac/MANIFEST.in b/plac/MANIFEST.in
index 1075e92..e4c6c2d 100644
--- a/plac/MANIFEST.in
+++ b/plac/MANIFEST.in
@@ -1 +1 @@
-include test_plac.py *.txt doc/*.py doc/*.txt doc/*.html doc/*.pdf
+include test_plac.py *.txt doc/*.py doc/*.help doc/*.txt doc/*.html doc/*.pdf
diff --git a/plac/doc/plac.html b/plac/doc/plac.html
index 4ac326d..a973666 100644
--- a/plac/doc/plac.html
+++ b/plac/doc/plac.html
@@ -1215,10 +1215,14 @@ arguably even easier than <a class="reference external" href="http://pypi.python
<p>Luckily for me none of such projects had the idea of using
function annotations and <a class="reference external" href="http://argparse.googlecode.com">argparse</a>; as a consequence, they are
no match for the capabilities of <a class="reference external" href="http://pypi.python.org/pypi/plac">plac</a>.</p>
+<p>Of course, there are tons of other libraries to parse the command
+line. For instance <a class="reference external" href="http://pypi.python.org/pypi/Clap/0.7">Clap</a> by Matthew Frazier which appeared on PyPI
+just the day before <a class="reference external" href="http://pypi.python.org/pypi/plac">plac</a>; <a class="reference external" href="http://pypi.python.org/pypi/Clap/0.7">Clap</a> is fine but it is certainly not
+easier than <a class="reference external" href="http://pypi.python.org/pypi/plac">plac</a>.</p>
</div>
<div class="section" id="the-future">
<h1><a class="toc-backref" href="#id14">The future</a></h1>
-<p>Currently plac is below 100 lines of code, not counting blanks,
+<p>Currently plac is around 140 lines of code, not counting blanks,
comments and docstrings. I do not plan to extend it much in the
future. The idea is to keep the module short: it is and it should
remain a little wrapper over <a class="reference external" href="http://argparse.googlecode.com">argparse</a>. Actually I have thought about
diff --git a/plac/doc/plac.pdf b/plac/doc/plac.pdf
index 229e51f..961fdec 100644
--- a/plac/doc/plac.pdf
+++ b/plac/doc/plac.pdf
@@ -492,7 +492,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 138 0 R
+ /Dest [ 142 0 R
/XYZ
62.69291
765.0236
@@ -510,7 +510,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 138 0 R
+ /Dest [ 142 0 R
/XYZ
62.69291
765.0236
@@ -528,7 +528,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 138 0 R
+ /Dest [ 142 0 R
/XYZ
62.69291
276.0236
@@ -546,7 +546,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 138 0 R
+ /Dest [ 142 0 R
/XYZ
62.69291
276.0236
@@ -564,7 +564,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 153 0 R
+ /Dest [ 157 0 R
/XYZ
62.69291
765.0236
@@ -582,7 +582,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 153 0 R
+ /Dest [ 157 0 R
/XYZ
62.69291
765.0236
@@ -600,7 +600,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 153 0 R
+ /Dest [ 157 0 R
/XYZ
62.69291
654.0236
@@ -618,7 +618,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 153 0 R
+ /Dest [ 157 0 R
/XYZ
62.69291
654.0236
@@ -778,12 +778,12 @@ endobj
43 0 R
44 0 R
45 0 R ]
- /Contents 173 0 R
+ /Contents 177 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -966,12 +966,12 @@ endobj
55 0 R
56 0 R
57 0 R ]
- /Contents 174 0 R
+ /Contents 178 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1065,12 +1065,12 @@ endobj
61 0 R
62 0 R
63 0 R ]
- /Contents 175 0 R
+ /Contents 179 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1148,12 +1148,12 @@ endobj
66 0 R
67 0 R
68 0 R ]
- /Contents 176 0 R
+ /Contents 180 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1263,12 +1263,12 @@ endobj
73 0 R
74 0 R
75 0 R ]
- /Contents 177 0 R
+ /Contents 181 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1314,12 +1314,12 @@ endobj
% Page dictionary
<< /Annots [ 77 0 R
78 0 R ]
- /Contents 178 0 R
+ /Contents 182 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1365,12 +1365,12 @@ endobj
% Page dictionary
<< /Annots [ 80 0 R
81 0 R ]
- /Contents 179 0 R
+ /Contents 183 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1480,12 +1480,12 @@ endobj
86 0 R
87 0 R
88 0 R ]
- /Contents 180 0 R
+ /Contents 184 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1515,12 +1515,12 @@ endobj
91 0 obj
% Page dictionary
<< /Annots [ 90 0 R ]
- /Contents 181 0 R
+ /Contents 185 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1582,12 +1582,12 @@ endobj
<< /Annots [ 92 0 R
93 0 R
94 0 R ]
- /Contents 182 0 R
+ /Contents 186 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1761,12 +1761,12 @@ endobj
103 0 R
104 0 R
105 0 R ]
- /Contents 183 0 R
+ /Contents 187 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1796,12 +1796,12 @@ endobj
108 0 obj
% Page dictionary
<< /Annots [ 107 0 R ]
- /Contents 184 0 R
+ /Contents 188 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -2247,8 +2247,68 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Page13': class PDFPage
+% 'Annot.NUMBER120': class PDFDictionary
138 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://pypi.python.org/pypi/Clap/0.7) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 455.0104
+ 126.5936
+ 479.9015
+ 138.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER121': class PDFDictionary
+139 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://pypi.python.org/pypi/plac) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 303.707
+ 114.5936
+ 322.047
+ 126.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER122': class PDFDictionary
+140 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://pypi.python.org/pypi/Clap/0.7) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 328.8186
+ 114.5936
+ 353.3701
+ 126.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER123': class PDFDictionary
+141 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://pypi.python.org/pypi/plac) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 62.69291
+ 102.5936
+ 81.03291
+ 114.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Page13': class PDFPage
+142 0 obj
% Page dictionary
<< /Annots [ 109 0 R
110 0 R
@@ -2278,13 +2338,17 @@ endobj
134 0 R
135 0 R
136 0 R
- 137 0 R ]
- /Contents 185 0 R
+ 137 0 R
+ 138 0 R
+ 139 0 R
+ 140 0 R
+ 141 0 R ]
+ /Contents 189 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -2295,8 +2359,8 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER120': class PDFDictionary
-139 0 obj
+% 'Annot.NUMBER124': class PDFDictionary
+143 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2310,8 +2374,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER121': class PDFDictionary
-140 0 obj
+% 'Annot.NUMBER125': class PDFDictionary
+144 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2325,8 +2389,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER122': class PDFDictionary
-141 0 obj
+% 'Annot.NUMBER126': class PDFDictionary
+145 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -2340,8 +2404,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER123': class PDFDictionary
-142 0 obj
+% 'Annot.NUMBER127': class PDFDictionary
+146 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2355,8 +2419,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER124': class PDFDictionary
-143 0 obj
+% 'Annot.NUMBER128': class PDFDictionary
+147 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -2370,8 +2434,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER125': class PDFDictionary
-144 0 obj
+% 'Annot.NUMBER129': class PDFDictionary
+148 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://code.activestate.com/recipes/278844-parsing-the-command-line/) >>
@@ -2385,8 +2449,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER126': class PDFDictionary
-145 0 obj
+% 'Annot.NUMBER130': class PDFDictionary
+149 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -2400,8 +2464,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER127': class PDFDictionary
-146 0 obj
+% 'Annot.NUMBER131': class PDFDictionary
+150 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://docs.python.org/library/optparse.html?highlight=optionparser#optparse.OptionParser) >>
@@ -2415,8 +2479,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER128': class PDFDictionary
-147 0 obj
+% 'Annot.NUMBER132': class PDFDictionary
+151 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2430,8 +2494,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER129': class PDFDictionary
-148 0 obj
+% 'Annot.NUMBER133': class PDFDictionary
+152 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2445,8 +2509,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER130': class PDFDictionary
-149 0 obj
+% 'Annot.NUMBER134': class PDFDictionary
+153 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com/svn/tags/r11/doc/ArgumentParser.html) >>
@@ -2460,8 +2524,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER131': class PDFDictionary
-150 0 obj
+% 'Annot.NUMBER135': class PDFDictionary
+154 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2475,8 +2539,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER132': class PDFDictionary
-151 0 obj
+% 'Annot.NUMBER136': class PDFDictionary
+155 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2490,8 +2554,8 @@ endobj
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER133': class PDFDictionary
-152 0 obj
+% 'Annot.NUMBER137': class PDFDictionary
+156 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/Clap/0.7) >>
@@ -2506,13 +2570,9 @@ endobj
/Type /Annot >>
endobj
% 'Page14': class PDFPage
-153 0 obj
+157 0 obj
% Page dictionary
-<< /Annots [ 139 0 R
- 140 0 R
- 141 0 R
- 142 0 R
- 143 0 R
+<< /Annots [ 143 0 R
144 0 R
145 0 R
146 0 R
@@ -2521,13 +2581,17 @@ endobj
149 0 R
150 0 R
151 0 R
- 152 0 R ]
- /Contents 186 0 R
+ 152 0 R
+ 153 0 R
+ 154 0 R
+ 155 0 R
+ 156 0 R ]
+ /Contents 190 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 172 0 R
+ /Parent 176 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -2538,211 +2602,211 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'R154': class PDFCatalog
-154 0 obj
+% 'R158': class PDFCatalog
+158 0 obj
% Document Root
-<< /Outlines 156 0 R
- /PageLabels 187 0 R
+<< /Outlines 160 0 R
+ /PageLabels 191 0 R
/PageMode /UseNone
- /Pages 172 0 R
+ /Pages 176 0 R
/Type /Catalog >>
endobj
-% 'R155': class PDFInfo
-155 0 obj
+% 'R159': class PDFInfo
+159 0 obj
<< /Author (Michele Simionato)
- /CreationDate (D:20100603212333-01'00')
+ /CreationDate (D:20100604064859-01'00')
/Keywords ()
/Producer (ReportLab http://www.reportlab.com)
/Subject (\(unspecified\))
/Title (Plac: Parsing the Command Line the Easy Way) >>
endobj
-% 'R156': class PDFOutlines
-156 0 obj
+% 'R160': class PDFOutlines
+160 0 obj
<< /Count 15
- /First 157 0 R
- /Last 171 0 R
+ /First 161 0 R
+ /Last 175 0 R
/Type /Outlines >>
endobj
% 'Outline.0': class OutlineEntryObject
-157 0 obj
+161 0 obj
<< /Dest [ 46 0 R
/XYZ
62.69291
293.0236
0 ]
- /Next 158 0 R
- /Parent 156 0 R
+ /Next 162 0 R
+ /Parent 160 0 R
/Title (The importance of scaling down) >>
endobj
% 'Outline.1': class OutlineEntryObject
-158 0 obj
+162 0 obj
<< /Dest [ 58 0 R
/XYZ
62.69291
579.0236
0 ]
- /Next 159 0 R
- /Parent 156 0 R
- /Prev 157 0 R
+ /Next 163 0 R
+ /Parent 160 0 R
+ /Prev 161 0 R
/Title (Scripts with required arguments) >>
endobj
% 'Outline.2': class OutlineEntryObject
-159 0 obj
+163 0 obj
<< /Dest [ 64 0 R
/XYZ
62.69291
295.4236
0 ]
- /Next 160 0 R
- /Parent 156 0 R
- /Prev 158 0 R
+ /Next 164 0 R
+ /Parent 160 0 R
+ /Prev 162 0 R
/Title (Scripts with default arguments) >>
endobj
% 'Outline.3': class OutlineEntryObject
-160 0 obj
+164 0 obj
<< /Dest [ 76 0 R
/XYZ
62.69291
623.8236
0 ]
- /Next 161 0 R
- /Parent 156 0 R
- /Prev 159 0 R
+ /Next 165 0 R
+ /Parent 160 0 R
+ /Prev 163 0 R
/Title (Scripts with options) >>
endobj
% 'Outline.4': class OutlineEntryObject
-161 0 obj
+165 0 obj
<< /Dest [ 82 0 R
/XYZ
62.69291
765.0236
0 ]
- /Next 162 0 R
- /Parent 156 0 R
- /Prev 160 0 R
+ /Next 166 0 R
+ /Parent 160 0 R
+ /Prev 164 0 R
/Title (Scripts with flags) >>
endobj
% 'Outline.5': class OutlineEntryObject
-162 0 obj
+166 0 obj
<< /Dest [ 82 0 R
/XYZ
62.69291
304.7299
0 ]
- /Next 163 0 R
- /Parent 156 0 R
- /Prev 161 0 R
+ /Next 167 0 R
+ /Parent 160 0 R
+ /Prev 165 0 R
/Title (plac for Python 2.X users) >>
endobj
% 'Outline.6': class OutlineEntryObject
-163 0 obj
+167 0 obj
<< /Dest [ 89 0 R
/XYZ
62.69291
558.6236
0 ]
- /Next 164 0 R
- /Parent 156 0 R
- /Prev 162 0 R
+ /Next 168 0 R
+ /Parent 160 0 R
+ /Prev 166 0 R
/Title (More features) >>
endobj
% 'Outline.7': class OutlineEntryObject
-164 0 obj
+168 0 obj
<< /Dest [ 91 0 R
/XYZ
62.69291
474.4849
0 ]
- /Next 165 0 R
- /Parent 156 0 R
- /Prev 163 0 R
+ /Next 169 0 R
+ /Parent 160 0 R
+ /Prev 167 0 R
/Title (Keyword arguments) >>
endobj
% 'Outline.8': class OutlineEntryObject
-165 0 obj
+169 0 obj
<< /Dest [ 95 0 R
/XYZ
62.69291
582.6236
0 ]
- /Next 166 0 R
- /Parent 156 0 R
- /Prev 164 0 R
+ /Next 170 0 R
+ /Parent 160 0 R
+ /Prev 168 0 R
/Title (A realistic example) >>
endobj
% 'Outline.9': class OutlineEntryObject
-166 0 obj
+170 0 obj
<< /Dest [ 106 0 R
/XYZ
62.69291
631.8236
0 ]
- /Next 167 0 R
- /Parent 156 0 R
- /Prev 165 0 R
+ /Next 171 0 R
+ /Parent 160 0 R
+ /Prev 169 0 R
/Title (Advanced usage) >>
endobj
% 'Outline.10': class OutlineEntryObject
-167 0 obj
+171 0 obj
<< /Dest [ 108 0 R
/XYZ
62.69291
695.8236
0 ]
- /Next 168 0 R
- /Parent 156 0 R
- /Prev 166 0 R
+ /Next 172 0 R
+ /Parent 160 0 R
+ /Prev 170 0 R
/Title (Custom annotation objects) >>
endobj
% 'Outline.11': class OutlineEntryObject
-168 0 obj
-<< /Dest [ 138 0 R
+172 0 obj
+<< /Dest [ 142 0 R
/XYZ
62.69291
765.0236
0 ]
- /Next 169 0 R
- /Parent 156 0 R
- /Prev 167 0 R
+ /Next 173 0 R
+ /Parent 160 0 R
+ /Prev 171 0 R
/Title (plac vs argparse) >>
endobj
% 'Outline.12': class OutlineEntryObject
-169 0 obj
-<< /Dest [ 138 0 R
+173 0 obj
+<< /Dest [ 142 0 R
/XYZ
62.69291
276.0236
0 ]
- /Next 170 0 R
- /Parent 156 0 R
- /Prev 168 0 R
+ /Next 174 0 R
+ /Parent 160 0 R
+ /Prev 172 0 R
/Title (plac vs the rest of the world) >>
endobj
% 'Outline.13': class OutlineEntryObject
-170 0 obj
-<< /Dest [ 153 0 R
+174 0 obj
+<< /Dest [ 157 0 R
/XYZ
62.69291
765.0236
0 ]
- /Next 171 0 R
- /Parent 156 0 R
- /Prev 169 0 R
+ /Next 175 0 R
+ /Parent 160 0 R
+ /Prev 173 0 R
/Title (The future) >>
endobj
% 'Outline.14': class OutlineEntryObject
-171 0 obj
-<< /Dest [ 153 0 R
+175 0 obj
+<< /Dest [ 157 0 R
/XYZ
62.69291
654.0236
0 ]
- /Parent 156 0 R
- /Prev 170 0 R
+ /Parent 160 0 R
+ /Prev 174 0 R
/Title (Trivia: the story behind the name) >>
endobj
-% 'R172': class PDFPages
-172 0 obj
+% 'R176': class PDFPages
+176 0 obj
% page tree
<< /Count 14
/Kids [ 46 0 R
@@ -2757,12 +2821,12 @@ endobj
95 0 R
106 0 R
108 0 R
- 138 0 R
- 153 0 R ]
+ 142 0 R
+ 157 0 R ]
/Type /Pages >>
endobj
-% 'R173': class PDFStream
-173 0 obj
+% 'R177': class PDFStream
+177 0 obj
% page stream
<< /Length 8689 >>
stream
@@ -3175,8 +3239,8 @@ Q
endstream
endobj
-% 'R174': class PDFStream
-174 0 obj
+% 'R178': class PDFStream
+178 0 obj
% page stream
<< /Length 5349 >>
stream
@@ -3264,8 +3328,8 @@ Q
endstream
endobj
-% 'R175': class PDFStream
-175 0 obj
+% 'R179': class PDFStream
+179 0 obj
% page stream
<< /Length 3933 >>
stream
@@ -3402,8 +3466,8 @@ Q
endstream
endobj
-% 'R176': class PDFStream
-176 0 obj
+% 'R180': class PDFStream
+180 0 obj
% page stream
<< /Length 4277 >>
stream
@@ -3547,8 +3611,8 @@ Q
endstream
endobj
-% 'R177': class PDFStream
-177 0 obj
+% 'R181': class PDFStream
+181 0 obj
% page stream
<< /Length 4903 >>
stream
@@ -3670,8 +3734,8 @@ Q
endstream
endobj
-% 'R178': class PDFStream
-178 0 obj
+% 'R182': class PDFStream
+182 0 obj
% page stream
<< /Length 5073 >>
stream
@@ -3878,8 +3942,8 @@ Q
endstream
endobj
-% 'R179': class PDFStream
-179 0 obj
+% 'R183': class PDFStream
+183 0 obj
% page stream
<< /Length 4742 >>
stream
@@ -4043,8 +4107,8 @@ Q
endstream
endobj
-% 'R180': class PDFStream
-180 0 obj
+% 'R184': class PDFStream
+184 0 obj
% page stream
<< /Length 5748 >>
stream
@@ -4198,8 +4262,8 @@ Q
endstream
endobj
-% 'R181': class PDFStream
-181 0 obj
+% 'R185': class PDFStream
+185 0 obj
% page stream
<< /Length 3603 >>
stream
@@ -4338,8 +4402,8 @@ Q
endstream
endobj
-% 'R182': class PDFStream
-182 0 obj
+% 'R186': class PDFStream
+186 0 obj
% page stream
<< /Length 4139 >>
stream
@@ -4471,8 +4535,8 @@ Q
endstream
endobj
-% 'R183': class PDFStream
-183 0 obj
+% 'R187': class PDFStream
+187 0 obj
% page stream
<< /Length 5945 >>
stream
@@ -4613,8 +4677,8 @@ Q
endstream
endobj
-% 'R184': class PDFStream
-184 0 obj
+% 'R188': class PDFStream
+188 0 obj
% page stream
<< /Length 4227 >>
stream
@@ -4758,10 +4822,10 @@ Q
endstream
endobj
-% 'R185': class PDFStream
-185 0 obj
+% 'R189': class PDFStream
+189 0 obj
% page stream
-<< /Length 9331 >>
+<< /Length 9833 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
@@ -5047,6 +5111,12 @@ BT 1 0 0 1 0 16.82 Tm 2.136457 Tw 12 TL /F1 10 Tf 0 0 0 rg (Luckily for me none
Q
Q
q
+1 0 0 1 62.69291 99.02362 cm
+q
+BT 1 0 0 1 0 28.82 Tm 1.551163 Tw 12 TL /F1 10 Tf 0 0 0 rg (Of course, there are tons of other libraries to parse the command line. For instance ) Tj 0 0 .501961 rg (Clap ) Tj 0 0 0 rg (by Matthew) Tj T* 0 Tw 1.211567 Tw (Frazier which appeared on PyPI just the day before ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (; ) Tj 0 0 .501961 rg (Clap ) Tj 0 0 0 rg (is fine but it is certainly not easier than) Tj T* 0 Tw 0 0 .501961 rg (plac) Tj 0 0 0 rg (.) Tj T* ET
+Q
+Q
+q
1 0 0 1 56.69291 56.69291 cm
q
0 0 0 rg
@@ -5057,10 +5127,10 @@ Q
endstream
endobj
-% 'R186': class PDFStream
-186 0 obj
+% 'R190': class PDFStream
+190 0 obj
% page stream
-<< /Length 4762 >>
+<< /Length 4763 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
@@ -5072,7 +5142,7 @@ Q
q
1 0 0 1 62.69291 666.0236 cm
q
-BT 1 0 0 1 0 64.82 Tm .444431 Tw 12 TL /F1 10 Tf 0 0 0 rg (Currently plac is below 100 lines of code, not counting blanks, comments and docstrings. I do not plan to) Tj T* 0 Tw .035444 Tw (extend it much in the future. The idea is to keep the module short: it is and it should remain a little wrapper) Tj T* 0 Tw 1.903318 Tw (over ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (. Actually I have thought about contributing the code back to ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (if ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (becomes) Tj T* 0 Tw 4.105697 Tw (successfull and gains a reasonable number of users. For the moment it should be considered) Tj T* 0 Tw 1.092339 Tw (experimental: after all I wrote the first version of it in three days, including the tests, the documentation) Tj T* 0 Tw (and the time to learn ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
+BT 1 0 0 1 0 64.82 Tm .166098 Tw 12 TL /F1 10 Tf 0 0 0 rg (Currently plac is around 140 lines of code, not counting blanks, comments and docstrings. I do not plan to) Tj T* 0 Tw .035444 Tw (extend it much in the future. The idea is to keep the module short: it is and it should remain a little wrapper) Tj T* 0 Tw 1.903318 Tw (over ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (. Actually I have thought about contributing the code back to ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (if ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (becomes) Tj T* 0 Tw 4.105697 Tw (successfull and gains a reasonable number of users. For the moment it should be considered) Tj T* 0 Tw 1.092339 Tw (experimental: after all I wrote the first version of it in three days, including the tests, the documentation) Tj T* 0 Tw (and the time to learn ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
Q
Q
q
@@ -5183,124 +5253,124 @@ Q
endstream
endobj
-% 'R187': class PDFPageLabels
-187 0 obj
+% 'R191': class PDFPageLabels
+191 0 obj
% Document Root
<< /Nums [ 0
- 188 0 R
+ 192 0 R
1
- 189 0 R
+ 193 0 R
2
- 190 0 R
+ 194 0 R
3
- 191 0 R
+ 195 0 R
4
- 192 0 R
+ 196 0 R
5
- 193 0 R
+ 197 0 R
6
- 194 0 R
+ 198 0 R
7
- 195 0 R
+ 199 0 R
8
- 196 0 R
+ 200 0 R
9
- 197 0 R
+ 201 0 R
10
- 198 0 R
+ 202 0 R
11
- 199 0 R
+ 203 0 R
12
- 200 0 R
+ 204 0 R
13
- 201 0 R ] >>
+ 205 0 R ] >>
endobj
-% 'R188': class PDFPageLabel
-188 0 obj
+% 'R192': class PDFPageLabel
+192 0 obj
% None
<< /S /D
/St 1 >>
endobj
-% 'R189': class PDFPageLabel
-189 0 obj
+% 'R193': class PDFPageLabel
+193 0 obj
% None
<< /S /D
/St 2 >>
endobj
-% 'R190': class PDFPageLabel
-190 0 obj
+% 'R194': class PDFPageLabel
+194 0 obj
% None
<< /S /D
/St 3 >>
endobj
-% 'R191': class PDFPageLabel
-191 0 obj
+% 'R195': class PDFPageLabel
+195 0 obj
% None
<< /S /D
/St 4 >>
endobj
-% 'R192': class PDFPageLabel
-192 0 obj
+% 'R196': class PDFPageLabel
+196 0 obj
% None
<< /S /D
/St 5 >>
endobj
-% 'R193': class PDFPageLabel
-193 0 obj
+% 'R197': class PDFPageLabel
+197 0 obj
% None
<< /S /D
/St 6 >>
endobj
-% 'R194': class PDFPageLabel
-194 0 obj
+% 'R198': class PDFPageLabel
+198 0 obj
% None
<< /S /D
/St 7 >>
endobj
-% 'R195': class PDFPageLabel
-195 0 obj
+% 'R199': class PDFPageLabel
+199 0 obj
% None
<< /S /D
/St 8 >>
endobj
-% 'R196': class PDFPageLabel
-196 0 obj
+% 'R200': class PDFPageLabel
+200 0 obj
% None
<< /S /D
/St 9 >>
endobj
-% 'R197': class PDFPageLabel
-197 0 obj
+% 'R201': class PDFPageLabel
+201 0 obj
% None
<< /S /D
/St 10 >>
endobj
-% 'R198': class PDFPageLabel
-198 0 obj
+% 'R202': class PDFPageLabel
+202 0 obj
% None
<< /S /D
/St 11 >>
endobj
-% 'R199': class PDFPageLabel
-199 0 obj
+% 'R203': class PDFPageLabel
+203 0 obj
% None
<< /S /D
/St 12 >>
endobj
-% 'R200': class PDFPageLabel
-200 0 obj
+% 'R204': class PDFPageLabel
+204 0 obj
% None
<< /S /D
/St 13 >>
endobj
-% 'R201': class PDFPageLabel
-201 0 obj
+% 'R205': class PDFPageLabel
+205 0 obj
% None
<< /S /D
/St 14 >>
endobj
xref
-0 202
+0 206
0000000000 65535 f
0000000113 00000 n
0000000258 00000 n
@@ -5439,78 +5509,82 @@ xref
0000034787 00000 n
0000035044 00000 n
0000035296 00000 n
-0000035535 00000 n
-0000036136 00000 n
-0000036388 00000 n
-0000036639 00000 n
-0000036893 00000 n
-0000037145 00000 n
-0000037399 00000 n
-0000037686 00000 n
-0000037940 00000 n
-0000038251 00000 n
-0000038503 00000 n
-0000038755 00000 n
-0000039044 00000 n
-0000039296 00000 n
-0000039548 00000 n
-0000039791 00000 n
-0000040228 00000 n
-0000040392 00000 n
-0000040666 00000 n
-0000040795 00000 n
-0000040989 00000 n
-0000041200 00000 n
-0000041410 00000 n
-0000041610 00000 n
-0000041808 00000 n
-0000042013 00000 n
-0000042206 00000 n
-0000042403 00000 n
-0000042602 00000 n
-0000042798 00000 n
-0000043005 00000 n
-0000043203 00000 n
-0000043414 00000 n
-0000043606 00000 n
-0000043789 00000 n
-0000044021 00000 n
-0000052813 00000 n
-0000058265 00000 n
-0000062301 00000 n
-0000066681 00000 n
-0000071687 00000 n
-0000076863 00000 n
-0000081708 00000 n
-0000087559 00000 n
-0000091265 00000 n
-0000095507 00000 n
-0000101555 00000 n
-0000105885 00000 n
-0000115319 00000 n
-0000120188 00000 n
-0000120470 00000 n
-0000120549 00000 n
-0000120628 00000 n
-0000120707 00000 n
-0000120786 00000 n
-0000120865 00000 n
-0000120944 00000 n
-0000121023 00000 n
-0000121102 00000 n
-0000121181 00000 n
-0000121261 00000 n
-0000121341 00000 n
-0000121421 00000 n
-0000121501 00000 n
+0000035550 00000 n
+0000035808 00000 n
+0000036060 00000 n
+0000036318 00000 n
+0000036557 00000 n
+0000037198 00000 n
+0000037450 00000 n
+0000037701 00000 n
+0000037955 00000 n
+0000038207 00000 n
+0000038461 00000 n
+0000038748 00000 n
+0000039002 00000 n
+0000039313 00000 n
+0000039565 00000 n
+0000039817 00000 n
+0000040106 00000 n
+0000040358 00000 n
+0000040610 00000 n
+0000040853 00000 n
+0000041290 00000 n
+0000041454 00000 n
+0000041728 00000 n
+0000041857 00000 n
+0000042051 00000 n
+0000042262 00000 n
+0000042472 00000 n
+0000042672 00000 n
+0000042870 00000 n
+0000043075 00000 n
+0000043268 00000 n
+0000043465 00000 n
+0000043664 00000 n
+0000043860 00000 n
+0000044067 00000 n
+0000044265 00000 n
+0000044476 00000 n
+0000044668 00000 n
+0000044851 00000 n
+0000045083 00000 n
+0000053875 00000 n
+0000059327 00000 n
+0000063363 00000 n
+0000067743 00000 n
+0000072749 00000 n
+0000077925 00000 n
+0000082770 00000 n
+0000088621 00000 n
+0000092327 00000 n
+0000096569 00000 n
+0000102617 00000 n
+0000106947 00000 n
+0000116883 00000 n
+0000121753 00000 n
+0000122035 00000 n
+0000122114 00000 n
+0000122193 00000 n
+0000122272 00000 n
+0000122351 00000 n
+0000122430 00000 n
+0000122509 00000 n
+0000122588 00000 n
+0000122667 00000 n
+0000122746 00000 n
+0000122826 00000 n
+0000122906 00000 n
+0000122986 00000 n
+0000123066 00000 n
trailer
<< /ID
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
- [(\004\3357bm\360\021\276[\204N}h[\215K) (\004\3357bm\360\021\276[\204N}h[\215K)]
+ [(m\265o\026\216:\\\226;\037\223\273\220>\243\351) (m\265o\026\216:\\\226;\037\223\273\220>\243\351)]
- /Info 155 0 R
- /Root 154 0 R
- /Size 202 >>
+ /Info 159 0 R
+ /Root 158 0 R
+ /Size 206 >>
startxref
-121550
+123115
%%EOF
diff --git a/plac/doc/plac.txt b/plac/doc/plac.txt
index dc631d9..9c3b1d9 100644
--- a/plac/doc/plac.txt
+++ b/plac/doc/plac.txt
@@ -589,10 +589,15 @@ Luckily for me none of such projects had the idea of using
function annotations and argparse_; as a consequence, they are
no match for the capabilities of plac_.
+Of course, there are tons of other libraries to parse the command
+line. For instance Clap_ by Matthew Frazier which appeared on PyPI
+just the day before plac_; Clap_ is fine but it is certainly not
+easier than plac_.
+
The future
-------------------------------
-Currently plac is below 100 lines of code, not counting blanks,
+Currently plac is around 140 lines of code, not counting blanks,
comments and docstrings. I do not plan to extend it much in the
future. The idea is to keep the module short: it is and it should
remain a little wrapper over argparse_. Actually I have thought about
diff --git a/plac/test_plac.py b/plac/test_plac.py
index 350900d..739fe15 100644
--- a/plac/test_plac.py
+++ b/plac/test_plac.py
@@ -21,14 +21,14 @@ def parser_from(f, **kw):
f.__annotations__ = kw
return plac.parser_from(f)
-def compare_help(name):
+def check_help(name):
sys.argv[0] = name + '.py'
dic = {}
try:
execfile(os.path.join('doc', name + '.py'), dic)
except NameError: # Python 3
exec(open(os.path.join('doc', name + '.py')).read(), dic)
- except SyntaxError: # running Python 2 with some tests
+ except SyntaxError: # raised by some tests when using Python 2
return
p = plac.parser_from(dic['main'])
expected = open(os.path.join('doc', name + '.help')).read().strip()
@@ -113,13 +113,18 @@ def test_kwargs():
def test_expected_help():
for fname in os.listdir('doc'):
if fname.endswith('.help'):
- compare_help(fname[:-5])
+ yield check_help, fname[:-5]
if __name__ == '__main__':
n = 0
for name, test in sorted(globals().items()):
if name.startswith('test_'):
print('Running ' + name)
- test()
- n +=1
+ maybegen = test()
+ if hasattr(maybegen, '__iter__'):
+ for func, arg in maybegen:
+ func(arg)
+ n += 1
+ else:
+ n +=1
print('Executed %d tests OK' % n)