summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2010-06-01 16:52:28 +0200
committerMichele Simionato <michele.simionato@gmail.com>2010-06-01 16:52:28 +0200
commit3eb311c1ed5f7e1bc55477e271ac3bd94f3d1b32 (patch)
tree6c6a1766c33f6f23d86f70d5da2879f9da3c33b7
parent63c69137892d6ece5df8ad83cd3b427895835141 (diff)
downloadmicheles-3eb311c1ed5f7e1bc55477e271ac3bd94f3d1b32.tar.gz
Small fixes and added page numbers to the PDF documentation
-rw-r--r--plac/Makefile3
-rw-r--r--plac/doc/dbcli.py6
-rw-r--r--plac/doc/example0.py6
-rw-r--r--plac/doc/plac.pdf2208
-rw-r--r--plac/doc/plac.txt132
5 files changed, 1245 insertions, 1110 deletions
diff --git a/plac/Makefile b/plac/Makefile
index 3e270b1..8c8e1d1 100644
--- a/plac/Makefile
+++ b/plac/Makefile
@@ -1,4 +1,5 @@
doc/plac.pdf: doc/plac.txt
- cd doc; rst2pdf plac.txt; rst2html --stylesheet=~/gcode/df.css plac.txt plac.html
+ cd doc; rst2pdf --footer=###Page### plac.txt; \
+ rst2html --stylesheet=~/gcode/df.css plac.txt plac.html
upload:
python setup.py register sdist upload
diff --git a/plac/doc/dbcli.py b/plac/doc/dbcli.py
index 04ea44b..7f0cec6 100644
--- a/plac/doc/dbcli.py
+++ b/plac/doc/dbcli.py
@@ -1,8 +1,8 @@
# dbcli.py
-import clap
+import plac
from sqlalchemy.ext.sqlsoup import SqlSoup
-@clap.annotations(
+@plac.annotations(
db=("Connection string", 'positional', None, SqlSoup),
header=("Header", 'flag', 'H'),
sqlcmd=("SQL command", 'option', 'c', str, None, "SQL"),
@@ -23,4 +23,4 @@ def main(db, header, sqlcmd, delimiter="|", *scripts):
db.bind.execute(file(script).read())
if __name__ == '__main__':
- clap.call(main)
+ plac.call(main)
diff --git a/plac/doc/example0.py b/plac/doc/example0.py
new file mode 100644
index 0000000..af345c3
--- /dev/null
+++ b/plac/doc/example0.py
@@ -0,0 +1,6 @@
+def main(arg: "required argument"):
+ "do something with arg"
+ print('Got %s' % arg)
+
+if __name__ == '__main__':
+ import plac; plac.call(main) # passes sys.argv[1:] to main
diff --git a/plac/doc/plac.pdf b/plac/doc/plac.pdf
index 45cc4f1..a5c28eb 100644
--- a/plac/doc/plac.pdf
+++ b/plac/doc/plac.pdf
@@ -81,14 +81,14 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 41 0 R
+ /Dest [ 44 0 R
/XYZ
62.69291
338.0236
0 ]
/Rect [ 62.69291
554.5936
- 121.0229
+ 215.5029
566.5936 ]
/Subtype /Link
/Type /Annot >>
@@ -99,7 +99,7 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 41 0 R
+ /Dest [ 44 0 R
/XYZ
62.69291
338.0236
@@ -120,11 +120,11 @@ endobj
/Dest [ 49 0 R
/XYZ
62.69291
- 729.0236
+ 681.0236
0 ]
/Rect [ 62.69291
536.5936
- 215.5029
+ 207.1729
548.5936 ]
/Subtype /Link
/Type /Annot >>
@@ -138,7 +138,7 @@ endobj
/Dest [ 49 0 R
/XYZ
62.69291
- 729.0236
+ 681.0236
0 ]
/Rect [ 527.0227
536.5936
@@ -189,10 +189,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 64 0 R
+ /Dest [ 65 0 R
/XYZ
62.69291
- 269.4236
+ 257.4236
0 ]
/Rect [ 62.69291
500.5936
@@ -207,10 +207,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 64 0 R
+ /Dest [ 65 0 R
/XYZ
62.69291
- 269.4236
+ 257.4236
0 ]
/Rect [ 527.0227
500.5936
@@ -225,10 +225,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 71 0 R
+ /Dest [ 79 0 R
/XYZ
62.69291
- 201.0236
+ 765.0236
0 ]
/Rect [ 62.69291
482.5936
@@ -243,10 +243,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 71 0 R
+ /Dest [ 79 0 R
/XYZ
62.69291
- 201.0236
+ 765.0236
0 ]
/Rect [ 527.0227
482.5936
@@ -261,10 +261,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 78 0 R
+ /Dest [ 79 0 R
/XYZ
62.69291
- 490.6236
+ 374.4236
0 ]
/Rect [ 62.69291
464.5936
@@ -279,10 +279,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 78 0 R
+ /Dest [ 79 0 R
/XYZ
62.69291
- 490.6236
+ 374.4236
0 ]
/Rect [ 527.0227
464.5936
@@ -297,14 +297,14 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 82 0 R
+ /Dest [ 83 0 R
/XYZ
62.69291
- 395.2849
+ 279.1952
0 ]
/Rect [ 62.69291
446.5936
- 180.5229
+ 204.9729
458.5936 ]
/Subtype /Link
/Type /Annot >>
@@ -315,10 +315,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 82 0 R
+ /Dest [ 83 0 R
/XYZ
62.69291
- 395.2849
+ 279.1952
0 ]
/Rect [ 527.0227
446.5936
@@ -336,7 +336,7 @@ endobj
/Dest [ 88 0 R
/XYZ
62.69291
- 448.6236
+ 316.6236
0 ]
/Rect [ 62.69291
428.5936
@@ -354,7 +354,7 @@ endobj
/Dest [ 88 0 R
/XYZ
62.69291
- 448.6236
+ 316.6236
0 ]
/Rect [ 527.0227
428.5936
@@ -369,10 +369,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 95 0 R
+ /Dest [ 96 0 R
/XYZ
62.69291
- 525.8236
+ 400.6236
0 ]
/Rect [ 62.69291
410.5936
@@ -387,10 +387,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 95 0 R
+ /Dest [ 96 0 R
/XYZ
62.69291
- 525.8236
+ 400.6236
0 ]
/Rect [ 521.4627
410.5936
@@ -405,10 +405,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 121 0 R
+ /Dest [ 114 0 R
/XYZ
62.69291
- 587.8236
+ 452.6236
0 ]
/Rect [ 62.69291
392.5936
@@ -423,10 +423,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 121 0 R
+ /Dest [ 114 0 R
/XYZ
62.69291
- 587.8236
+ 452.6236
0 ]
/Rect [ 521.4627
392.5936
@@ -441,10 +441,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 121 0 R
+ /Dest [ 133 0 R
/XYZ
62.69291
- 188.8236
+ 705.0236
0 ]
/Rect [ 62.69291
374.5936
@@ -459,10 +459,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 121 0 R
+ /Dest [ 133 0 R
/XYZ
62.69291
- 188.8236
+ 705.0236
0 ]
/Rect [ 521.4627
374.5936
@@ -477,10 +477,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 132 0 R
+ /Dest [ 133 0 R
/XYZ
62.69291
- 765.0236
+ 594.0236
0 ]
/Rect [ 62.69291
356.5936
@@ -495,10 +495,10 @@ endobj
0
0 ]
/Contents ()
- /Dest [ 132 0 R
+ /Dest [ 133 0 R
/XYZ
62.69291
- 765.0236
+ 594.0236
0 ]
/Rect [ 521.4627
356.5936
@@ -515,9 +515,9 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 403.6414
+ /Rect [ 214.8914
290.5936
- 435.6067
+ 246.5585
302.5936 ]
/Subtype /Link
/Type /Annot >>
@@ -530,10 +530,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 62.69291
- 278.5936
- 104.8841
- 290.5936 ]
+ /Rect [ 346.507
+ 290.5936
+ 389.2842
+ 302.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -545,10 +545,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 206.3791
- 278.5936
- 249.1203
- 290.5936 ]
+ /Rect [ 493.1227
+ 290.5936
+ 531.4956
+ 302.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -560,10 +560,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 62.69291
- 266.5936
- 105.1329
- 278.5936 ]
+ /Rect [ 346.384
+ 278.5936
+ 388.8477
+ 290.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -571,14 +571,14 @@ endobj
36 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://pypi.python.org/pypi/plac) >>
+ /URI (http://www.welton.it/articles/scalable_systems) >>
/Border [ 0
0
0 ]
- /Rect [ 95.71512
- 236.5936
- 114.0551
- 248.5936 ]
+ /Rect [ 471.0489
+ 248.5936
+ 529.8027
+ 260.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -590,10 +590,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 120.9573
- 236.5936
- 143.4195
- 248.5936 ]
+ /Rect [ 417.0552
+ 212.5936
+ 440.5171
+ 224.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -601,14 +601,14 @@ endobj
38 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://pypi.python.org/pypi/plac) >>
+ /URI (http://argparse.googlecode.com) >>
/Border [ 0
0
0 ]
- /Rect [ 337.6822
- 224.5936
- 359.0965
- 236.5936 ]
+ /Rect [ 317.2529
+ 188.5936
+ 356.7129
+ 200.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -616,14 +616,14 @@ endobj
39 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://argparse.googlecode.com) >>
+ /URI (http://pypi.python.org/pypi/plac) >>
/Border [ 0
0
0 ]
- /Rect [ 490.3427
- 224.5936
- 529.8027
- 236.5936 ]
+ /Rect [ 115.8141
+ 170.5936
+ 137.2654
+ 182.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -631,19 +631,64 @@ endobj
40 0 obj
<< /A << /S /URI
/Type /Action
+ /URI (http://argparse.googlecode.com) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 268.7328
+ 170.5936
+ 308.1928
+ 182.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER36': class PDFDictionary
+41 0 obj
+<< /A << /S /URI
+ /Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
/Border [ 0
0
0 ]
- /Rect [ 346.3284
- 212.5936
- 367.4652
- 224.5936 ]
+ /Rect [ 127.6609
+ 158.5936
+ 151.5402
+ 170.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER37': class PDFDictionary
+42 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://argparse.googlecode.com) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 112.3616
+ 146.5936
+ 151.8216
+ 158.5936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER38': class PDFDictionary
+43 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://pypi.python.org/pypi/plac) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 222.2329
+ 122.5936
+ 243.3529
+ 134.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page1': class PDFPage
-41 0 obj
+44 0 obj
% Page dictionary
<< /Annots [ 5 0 R
6 0 R
@@ -679,13 +724,16 @@ endobj
37 0 R
38 0 R
39 0 R
- 40 0 R ]
- /Contents 149 0 R
+ 40 0 R
+ 41 0 R
+ 42 0 R
+ 43 0 R ]
+ /Contents 150 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -696,51 +744,6 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER36': class PDFDictionary
-42 0 obj
-<< /A << /S /URI
- /Type /Action
- /URI (http://www.welton.it/articles/scalable_systems) >>
- /Border [ 0
- 0
- 0 ]
- /Rect [ 471.4139
- 693.5936
- 529.8027
- 705.5936 ]
- /Subtype /Link
- /Type /Annot >>
-endobj
-% 'Annot.NUMBER37': class PDFDictionary
-43 0 obj
-<< /A << /S /URI
- /Type /Action
- /URI (http://pypi.python.org/pypi/plac) >>
- /Border [ 0
- 0
- 0 ]
- /Rect [ 105.7485
- 645.5936
- 127.684
- 657.5936 ]
- /Subtype /Link
- /Type /Annot >>
-endobj
-% 'Annot.NUMBER38': class PDFDictionary
-44 0 obj
-<< /A << /S /URI
- /Type /Action
- /URI (http://argparse.googlecode.com) >>
- /Border [ 0
- 0
- 0 ]
- /Rect [ 466.7629
- 633.5936
- 506.2229
- 645.5936 ]
- /Subtype /Link
- /Type /Annot >>
-endobj
% 'F5': class PDFType1Font
45 0 obj
% Font Helvetica-Oblique
@@ -758,10 +761,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 504.7827
- 302.3936
- 532.1006
- 314.3936 ]
+ /Rect [ 484.2853
+ 332.3936
+ 515.9027
+ 344.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -773,10 +776,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 82.40665
- 290.3936
- 124.3504
- 302.3936 ]
+ /Rect [ 62.69291
+ 320.3936
+ 105.9509
+ 332.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -789,27 +792,24 @@ endobj
0
0 ]
/Rect [ 62.69291
- 278.3936
+ 308.3936
104.9329
- 290.3936 ]
+ 320.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page2': class PDFPage
49 0 obj
% Page dictionary
-<< /Annots [ 42 0 R
- 43 0 R
- 44 0 R
- 46 0 R
+<< /Annots [ 46 0 R
47 0 R
48 0 R ]
- /Contents 150 0 R
+ /Contents 151 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -919,12 +919,12 @@ endobj
53 0 R
54 0 R
55 0 R ]
- /Contents 151 0 R
+ /Contents 152 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -944,9 +944,9 @@ endobj
0
0 ]
/Rect [ 62.69291
- 663.3936
+ 651.3936
84.20915
- 675.3936 ]
+ 663.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -959,9 +959,9 @@ endobj
0
0 ]
/Rect [ 91.59679
- 458.1936
+ 446.1936
109.9368
- 470.1936 ]
+ 458.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -974,9 +974,9 @@ endobj
0
0 ]
/Rect [ 446.6187
- 296.9936
+ 284.9936
464.9587
- 308.9936 ]
+ 296.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -989,9 +989,9 @@ endobj
0
0 ]
/Rect [ 446.8103
- 185.9936
+ 173.9936
502.5727
- 197.9936 ]
+ 185.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1004,9 +1004,9 @@ endobj
0
0 ]
/Rect [ 260.18
- 173.9936
+ 161.9936
312.43
- 185.9936 ]
+ 173.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1014,19 +1014,34 @@ endobj
62 0 obj
<< /A << /S /URI
/Type /Action
+ /URI (http://docs.python.org/library/optparse.html?highlight=optionparser#optparse.OptionParser) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 376.1829
+ 149.9936
+ 435.0929
+ 161.9936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER54': class PDFDictionary
+63 0 obj
+<< /A << /S /URI
+ /Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
/Border [ 0
0
0 ]
/Rect [ 62.69291
- 143.9936
+ 131.9936
84.28901
- 155.9936 ]
+ 143.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER54': class PDFDictionary
-63 0 obj
+% 'Annot.NUMBER55': class PDFDictionary
+64 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://code.activestate.com/recipes/278844-parsing-the-command-line/) >>
@@ -1034,14 +1049,14 @@ endobj
0
0 ]
/Rect [ 161.7834
- 143.9936
+ 131.9936
217.2895
- 155.9936 ]
+ 143.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page4': class PDFPage
-64 0 obj
+65 0 obj
% Page dictionary
<< /Annots [ 57 0 R
58 0 R
@@ -1049,13 +1064,14 @@ endobj
60 0 R
61 0 R
62 0 R
- 63 0 R ]
- /Contents 152 0 R
+ 63 0 R
+ 64 0 R ]
+ /Contents 153 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1066,8 +1082,8 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER55': class PDFDictionary
-65 0 obj
+% 'Annot.NUMBER56': class PDFDictionary
+66 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1075,22 +1091,22 @@ endobj
0
0 ]
/Rect [ 133.1479
- 617.3936
+ 587.3936
154.4129
- 629.3936 ]
+ 599.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page5': class PDFPage
-66 0 obj
+67 0 obj
% Page dictionary
-<< /Annots [ 65 0 R ]
- /Contents 153 0 R
+<< /Annots [ 66 0 R ]
+ /Contents 154 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1101,21 +1117,6 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER56': class PDFDictionary
-67 0 obj
-<< /A << /S /URI
- /Type /Action
- /URI (http://pypi.python.org/pypi/plac) >>
- /Border [ 0
- 0
- 0 ]
- /Rect [ 185.8554
- 744.5936
- 207.616
- 756.5936 ]
- /Subtype /Link
- /Type /Annot >>
-endobj
% 'Annot.NUMBER57': class PDFDictionary
68 0 obj
<< /A << /S /URI
@@ -1124,10 +1125,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 162.7329
- 590.1936
- 181.0729
- 602.1936 ]
+ /Rect [ 183.7423
+ 687.3936
+ 204.9746
+ 699.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1139,10 +1140,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 62.69291
- 512.9936
- 84.57878
- 524.9936 ]
+ /Rect [ 162.7329
+ 532.9936
+ 181.0729
+ 544.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1154,26 +1155,25 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 153.3575
- 141.5936
- 175.3449
- 153.5936 ]
+ /Rect [ 62.69291
+ 455.7936
+ 84.57878
+ 467.7936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page6': class PDFPage
71 0 obj
% Page dictionary
-<< /Annots [ 67 0 R
- 68 0 R
+<< /Annots [ 68 0 R
69 0 R
70 0 R ]
- /Contents 154 0 R
+ /Contents 155 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1192,10 +1192,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 371.2728
- 518.1936
- 393.9678
- 530.1936 ]
+ /Rect [ 153.3575
+ 705.5936
+ 175.3449
+ 717.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1203,19 +1203,34 @@ endobj
73 0 obj
<< /A << /S /URI
/Type /Action
+ /URI (http://pypi.python.org/pypi/plac) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 371.2728
+ 401.9936
+ 393.9678
+ 413.9936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER62': class PDFDictionary
+74 0 obj
+<< /A << /S /URI
+ /Type /Action
/URI (http://argparse.googlecode.com) >>
/Border [ 0
0
0 ]
/Rect [ 62.69291
- 443.1936
+ 326.9936
102.1529
- 455.1936 ]
+ 338.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER62': class PDFDictionary
-74 0 obj
+% 'Annot.NUMBER63': class PDFDictionary
+75 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1223,14 +1238,14 @@ endobj
0
0 ]
/Rect [ 375.4489
- 443.1936
+ 326.9936
414.9089
- 455.1936 ]
+ 338.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER63': class PDFDictionary
-75 0 obj
+% 'Annot.NUMBER64': class PDFDictionary
+76 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1238,14 +1253,14 @@ endobj
0
0 ]
/Rect [ 493.1227
- 443.1936
+ 326.9936
532.1699
- 455.1936 ]
+ 338.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER64': class PDFDictionary
-76 0 obj
+% 'Annot.NUMBER65': class PDFDictionary
+77 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1253,14 +1268,14 @@ endobj
0
0 ]
/Rect [ 140.8079
- 431.1936
+ 314.9936
159.1479
- 443.1936 ]
+ 326.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER65': class PDFDictionary
-77 0 obj
+% 'Annot.NUMBER66': class PDFDictionary
+78 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1268,27 +1283,28 @@ endobj
0
0 ]
/Rect [ 415.0529
- 239.1936
+ 122.9936
457.2929
- 251.1936 ]
+ 134.9936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page7': class PDFPage
-78 0 obj
+79 0 obj
% Page dictionary
<< /Annots [ 72 0 R
73 0 R
74 0 R
75 0 R
76 0 R
- 77 0 R ]
- /Contents 155 0 R
+ 77 0 R
+ 78 0 R ]
+ /Contents 156 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1299,8 +1315,8 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER66': class PDFDictionary
-79 0 obj
+% 'Annot.NUMBER67': class PDFDictionary
+80 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1308,14 +1324,14 @@ endobj
0
0 ]
/Rect [ 338.1568
- 359.8549
+ 243.7652
360.5113
- 371.8549 ]
+ 255.7652 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER67': class PDFDictionary
-80 0 obj
+% 'Annot.NUMBER68': class PDFDictionary
+81 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://www.sqlalchemy.org/) >>
@@ -1323,14 +1339,14 @@ endobj
0
0 ]
/Rect [ 110.6843
- 347.8549
+ 231.7652
169.0343
- 359.8549 ]
+ 243.7652 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER68': class PDFDictionary
-81 0 obj
+% 'Annot.NUMBER69': class PDFDictionary
+82 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://www.sqlalchemy.org/docs/reference/ext/sqlsoup.html) >>
@@ -1338,24 +1354,24 @@ endobj
0
0 ]
/Rect [ 168.3029
- 335.8549
+ 219.7652
208.8829
- 347.8549 ]
+ 231.7652 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page8': class PDFPage
-82 0 obj
+83 0 obj
% Page dictionary
-<< /Annots [ 79 0 R
- 80 0 R
- 81 0 R ]
- /Contents 156 0 R
+<< /Annots [ 80 0 R
+ 81 0 R
+ 82 0 R ]
+ /Contents 157 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1366,8 +1382,8 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER69': class PDFDictionary
-83 0 obj
+% 'Annot.NUMBER70': class PDFDictionary
+84 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1375,14 +1391,14 @@ endobj
0
0 ]
/Rect [ 62.69291
- 413.1936
+ 281.1936
83.9079
- 425.1936 ]
+ 293.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER70': class PDFDictionary
-84 0 obj
+% 'Annot.NUMBER71': class PDFDictionary
+85 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1390,14 +1406,14 @@ endobj
0
0 ]
/Rect [ 133.1029
- 413.1936
+ 281.1936
175.4379
- 425.1936 ]
+ 293.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER71': class PDFDictionary
-85 0 obj
+% 'Annot.NUMBER72': class PDFDictionary
+86 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1405,24 +1421,9 @@ endobj
0
0 ]
/Rect [ 454.1177
- 413.1936
+ 281.1936
496.4527
- 425.1936 ]
- /Subtype /Link
- /Type /Annot >>
-endobj
-% 'Annot.NUMBER72': class PDFDictionary
-86 0 obj
-<< /A << /S /URI
- /Type /Action
- /URI (http://argparse.googlecode.com/svn/tags/r11/doc/other-utilities.html?highlight=filetype#FileType) >>
- /Border [ 0
- 0
- 0 ]
- /Rect [ 62.69291
- 359.1936
- 146.0529
- 371.1936 ]
+ 293.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1430,31 +1431,30 @@ endobj
87 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://pypi.python.org/pypi/plac) >>
+ /URI (http://argparse.googlecode.com/svn/tags/r11/doc/other-utilities.html?highlight=filetype#FileType) >>
/Border [ 0
0
0 ]
- /Rect [ 127.9872
- 203.9936
- 149.3819
- 215.9936 ]
+ /Rect [ 455.2227
+ 239.1936
+ 534.3667
+ 251.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page9': class PDFPage
88 0 obj
% Page dictionary
-<< /Annots [ 83 0 R
- 84 0 R
+<< /Annots [ 84 0 R
85 0 R
86 0 R
87 0 R ]
- /Contents 157 0 R
+ /Contents 158 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1473,10 +1473,10 @@ endobj
/Border [ 0
0
0 ]
- /Rect [ 326.9971
- 756.5936
- 351.8113
- 768.5936 ]
+ /Rect [ 127.99
+ 744.5936
+ 149.3857
+ 756.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
@@ -1484,19 +1484,34 @@ endobj
90 0 obj
<< /A << /S /URI
/Type /Action
+ /URI (http://pypi.python.org/pypi/plac) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 326.9971
+ 631.3936
+ 351.8113
+ 643.3936 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER76': class PDFDictionary
+91 0 obj
+<< /A << /S /URI
+ /Type /Action
/URI (http://argparse.googlecode.com) >>
/Border [ 0
0
0 ]
/Rect [ 407.706
- 744.5936
+ 619.3936
452.2944
- 756.5936 ]
+ 631.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER76': class PDFDictionary
-91 0 obj
+% 'Annot.NUMBER77': class PDFDictionary
+92 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1504,14 +1519,14 @@ endobj
0
0 ]
/Rect [ 259.0928
- 732.5936
+ 607.3936
302.7528
- 744.5936 ]
+ 619.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER77': class PDFDictionary
-92 0 obj
+% 'Annot.NUMBER78': class PDFDictionary
+93 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1519,14 +1534,14 @@ endobj
0
0 ]
/Rect [ 258.3129
- 708.5936
+ 583.3936
279.4329
- 720.5936 ]
+ 595.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER78': class PDFDictionary
-93 0 obj
+% 'Annot.NUMBER79': class PDFDictionary
+94 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com/svn/tags/r11/doc/ArgumentParser.html) >>
@@ -1534,14 +1549,14 @@ endobj
0
0 ]
/Rect [ 327.2261
- 690.5936
+ 565.3936
410.5152
- 702.5936 ]
+ 577.3936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER79': class PDFDictionary
-94 0 obj
+% 'Annot.NUMBER80': class PDFDictionary
+95 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1549,27 +1564,28 @@ endobj
0
0 ]
/Rect [ 106.6216
- 490.3936
+ 365.1936
128.3202
- 502.3936 ]
+ 377.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page10': class PDFPage
-95 0 obj
+96 0 obj
% Page dictionary
<< /Annots [ 89 0 R
90 0 R
91 0 R
92 0 R
93 0 R
- 94 0 R ]
- /Contents 158 0 R
+ 94 0 R
+ 95 0 R ]
+ /Contents 159 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -1580,8 +1596,8 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'Annot.NUMBER80': class PDFDictionary
-96 0 obj
+% 'Annot.NUMBER81': class PDFDictionary
+97 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1589,14 +1605,14 @@ endobj
0
0 ]
/Rect [ 62.69291
- 552.3936
+ 417.1936
85.4908
- 564.3936 ]
+ 429.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER81': class PDFDictionary
-97 0 obj
+% 'Annot.NUMBER82': class PDFDictionary
+98 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1604,14 +1620,14 @@ endobj
0
0 ]
/Rect [ 477.5448
- 552.3936
+ 417.1936
517.0048
- 564.3936 ]
+ 429.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER82': class PDFDictionary
-98 0 obj
+% 'Annot.NUMBER83': class PDFDictionary
+99 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1619,14 +1635,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 519.3936
+ 384.1936
107.7029
- 531.3936 ]
+ 396.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER83': class PDFDictionary
-99 0 obj
+% 'Annot.NUMBER84': class PDFDictionary
+100 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://docs.python.org/library/optparse.html) >>
@@ -1634,14 +1650,14 @@ endobj
0
0 ]
/Rect [ 447.7627
- 519.3936
+ 384.1936
486.6727
- 531.3936 ]
+ 396.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER84': class PDFDictionary
-100 0 obj
+% 'Annot.NUMBER85': class PDFDictionary
+101 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1649,14 +1665,14 @@ endobj
0
0 ]
/Rect [ 493.1227
- 519.3936
+ 384.1936
531.6927
- 531.3936 ]
+ 396.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER85': class PDFDictionary
-101 0 obj
+% 'Annot.NUMBER86': class PDFDictionary
+102 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://docs.python.org/library/optparse.html) >>
@@ -1664,14 +1680,14 @@ endobj
0
0 ]
/Rect [ 232.9652
- 495.3936
+ 360.1936
271.8752
- 507.3936 ]
+ 372.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER86': class PDFDictionary
-102 0 obj
+% 'Annot.NUMBER87': class PDFDictionary
+103 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1679,14 +1695,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 465.3936
+ 330.1936
107.9337
- 477.3936 ]
+ 342.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER87': class PDFDictionary
-103 0 obj
+% 'Annot.NUMBER88': class PDFDictionary
+104 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1694,14 +1710,14 @@ endobj
0
0 ]
/Rect [ 308.5389
- 465.3936
+ 330.1936
351.8997
- 477.3936 ]
+ 342.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER88': class PDFDictionary
-104 0 obj
+% 'Annot.NUMBER89': class PDFDictionary
+105 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1709,14 +1725,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 423.3936
+ 288.1936
108.3529
- 435.3936 ]
+ 300.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER89': class PDFDictionary
-105 0 obj
+% 'Annot.NUMBER90': class PDFDictionary
+106 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1724,14 +1740,14 @@ endobj
0
0 ]
/Rect [ 277.2428
- 423.3936
+ 288.1936
321.0228
- 435.3936 ]
+ 300.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER90': class PDFDictionary
-106 0 obj
+% 'Annot.NUMBER91': class PDFDictionary
+107 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1739,14 +1755,14 @@ endobj
0
0 ]
/Rect [ 404.5839
- 411.3936
+ 276.1936
426.0657
- 423.3936 ]
+ 288.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER91': class PDFDictionary
-107 0 obj
+% 'Annot.NUMBER92': class PDFDictionary
+108 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1754,14 +1770,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 357.3936
+ 222.1936
108.61
- 369.3936 ]
+ 234.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER92': class PDFDictionary
-108 0 obj
+% 'Annot.NUMBER93': class PDFDictionary
+109 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1769,14 +1785,14 @@ endobj
0
0 ]
/Rect [ 459.2622
- 345.3936
+ 210.1936
481.289
- 357.3936 ]
+ 222.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER93': class PDFDictionary
-109 0 obj
+% 'Annot.NUMBER94': class PDFDictionary
+110 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1784,14 +1800,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 315.3936
+ 180.1936
107.0573
- 327.3936 ]
+ 192.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER94': class PDFDictionary
-110 0 obj
+% 'Annot.NUMBER95': class PDFDictionary
+111 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1799,14 +1815,14 @@ endobj
0
0 ]
/Rect [ 140.1729
- 303.3936
+ 168.1936
158.5129
- 315.3936 ]
+ 180.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER95': class PDFDictionary
-111 0 obj
+% 'Annot.NUMBER96': class PDFDictionary
+112 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1814,14 +1830,14 @@ endobj
0
0 ]
/Rect [ 85.69291
- 285.3936
+ 150.1936
107.9247
- 297.3936 ]
+ 162.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER96': class PDFDictionary
-112 0 obj
+% 'Annot.NUMBER97': class PDFDictionary
+113 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1829,14 +1845,50 @@ endobj
0
0 ]
/Rect [ 85.69291
- 273.3936
+ 138.1936
104.0329
- 285.3936 ]
+ 150.1936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER97': class PDFDictionary
-113 0 obj
+% 'Page11': class PDFPage
+114 0 obj
+% Page dictionary
+<< /Annots [ 97 0 R
+ 98 0 R
+ 99 0 R
+ 100 0 R
+ 101 0 R
+ 102 0 R
+ 103 0 R
+ 104 0 R
+ 105 0 R
+ 106 0 R
+ 107 0 R
+ 108 0 R
+ 109 0 R
+ 110 0 R
+ 111 0 R
+ 112 0 R
+ 113 0 R ]
+ /Contents 160 0 R
+ /MediaBox [ 0
+ 0
+ 595.2756
+ 841.8898 ]
+ /Parent 149 0 R
+ /Resources << /Font 1 0 R
+ /ProcSet [ /PDF
+ /Text
+ /ImageB
+ /ImageC
+ /ImageI ] >>
+ /Rotate 0
+ /Trans << >>
+ /Type /Page >>
+endobj
+% 'Annot.NUMBER98': class PDFDictionary
+115 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1844,14 +1896,14 @@ endobj
0
0 ]
/Rect [ 340.7317
- 240.3936
+ 756.5936
385.1185
- 252.3936 ]
+ 768.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER98': class PDFDictionary
-114 0 obj
+% 'Annot.NUMBER99': class PDFDictionary
+116 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1859,14 +1911,14 @@ endobj
0
0 ]
/Rect [ 451.1022
- 240.3936
+ 756.5936
474.369
- 252.3936 ]
+ 768.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER99': class PDFDictionary
-115 0 obj
+% 'Annot.NUMBER100': class PDFDictionary
+117 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com/svn/tags/r11/doc/ArgumentParser.html) >>
@@ -1874,14 +1926,14 @@ endobj
0
0 ]
/Rect [ 321.0443
- 228.3936
+ 744.5936
399.3474
- 240.3936 ]
+ 756.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER100': class PDFDictionary
-116 0 obj
+% 'Annot.NUMBER101': class PDFDictionary
+118 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1889,14 +1941,14 @@ endobj
0
0 ]
/Rect [ 62.69291
- 216.3936
+ 732.5936
107.3744
- 228.3936 ]
+ 744.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER101': class PDFDictionary
-117 0 obj
+% 'Annot.NUMBER102': class PDFDictionary
+119 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1904,14 +1956,14 @@ endobj
0
0 ]
/Rect [ 86.82623
- 129.3936
+ 645.5936
126.2862
- 141.3936 ]
+ 657.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER102': class PDFDictionary
-118 0 obj
+% 'Annot.NUMBER103': class PDFDictionary
+120 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1919,14 +1971,14 @@ endobj
0
0 ]
/Rect [ 415.1627
- 129.3936
+ 645.5936
459.306
- 141.3936 ]
+ 657.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER103': class PDFDictionary
-119 0 obj
+% 'Annot.NUMBER104': class PDFDictionary
+121 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -1934,14 +1986,14 @@ endobj
0
0 ]
/Rect [ 468.9894
- 129.3936
+ 645.5936
492.0127
- 141.3936 ]
+ 657.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER104': class PDFDictionary
-120 0 obj
+% 'Annot.NUMBER105': class PDFDictionary
+122 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -1949,58 +2001,14 @@ endobj
0
0 ]
/Rect [ 62.69291
- 93.39362
+ 609.5936
102.1529
- 105.3936 ]
+ 621.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Page11': class PDFPage
-121 0 obj
-% Page dictionary
-<< /Annots [ 96 0 R
- 97 0 R
- 98 0 R
- 99 0 R
- 100 0 R
- 101 0 R
- 102 0 R
- 103 0 R
- 104 0 R
- 105 0 R
- 106 0 R
- 107 0 R
- 108 0 R
- 109 0 R
- 110 0 R
- 111 0 R
- 112 0 R
- 113 0 R
- 114 0 R
- 115 0 R
- 116 0 R
- 117 0 R
- 118 0 R
- 119 0 R
- 120 0 R ]
- /Contents 159 0 R
- /MediaBox [ 0
- 0
- 595.2756
- 841.8898 ]
- /Parent 148 0 R
- /Resources << /Font 1 0 R
- /ProcSet [ /PDF
- /Text
- /ImageB
- /ImageC
- /ImageI ] >>
- /Rotate 0
- /Trans << >>
- /Type /Page >>
-endobj
-% 'Annot.NUMBER105': class PDFDictionary
-122 0 obj
+% 'Annot.NUMBER106': class PDFDictionary
+123 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -2008,14 +2016,14 @@ endobj
0
0 ]
/Rect [ 83.64556
- 729.5936
+ 558.5936
105.7082
- 741.5936 ]
+ 570.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER106': class PDFDictionary
-123 0 obj
+% 'Annot.NUMBER107': class PDFDictionary
+124 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://code.activestate.com/recipes/278844-parsing-the-command-line/) >>
@@ -2023,14 +2031,14 @@ endobj
0
0 ]
/Rect [ 446.6
- 729.5936
+ 558.5936
502.5727
- 741.5936 ]
+ 570.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER107': class PDFDictionary
-124 0 obj
+% 'Annot.NUMBER108': class PDFDictionary
+125 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/plac) >>
@@ -2038,14 +2046,14 @@ endobj
0
0 ]
/Rect [ 275.6828
- 717.5936
+ 546.5936
297.3688
- 729.5936 ]
+ 558.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER108': class PDFDictionary
-125 0 obj
+% 'Annot.NUMBER109': class PDFDictionary
+126 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://docs.python.org/library/optparse.html?highlight=optionparser#optparse.OptionParser) >>
@@ -2053,14 +2061,14 @@ endobj
0
0 ]
/Rect [ 77.19665
- 705.5936
+ 534.5936
139.4904
- 717.5936 ]
+ 546.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER109': class PDFDictionary
-126 0 obj
+% 'Annot.NUMBER110': class PDFDictionary
+127 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2068,14 +2076,14 @@ endobj
0
0 ]
/Rect [ 96.54131
- 693.5936
+ 522.5936
139.0255
- 705.5936 ]
+ 534.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER110': class PDFDictionary
-127 0 obj
+% 'Annot.NUMBER111': class PDFDictionary
+128 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2083,14 +2091,14 @@ endobj
0
0 ]
/Rect [ 203.5016
- 660.5936
+ 489.5936
245.8453
- 672.5936 ]
+ 501.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER111': class PDFDictionary
-128 0 obj
+% 'Annot.NUMBER112': class PDFDictionary
+129 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com/svn/tags/r11/doc/ArgumentParser.html) >>
@@ -2098,14 +2106,14 @@ endobj
0
0 ]
/Rect [ 62.69291
- 585.5936
+ 414.5936
138.7898
- 597.5936 ]
+ 426.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER112': class PDFDictionary
-129 0 obj
+% 'Annot.NUMBER113': class PDFDictionary
+130 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2113,14 +2121,14 @@ endobj
0
0 ]
/Rect [ 89.49556
- 573.5936
+ 402.5936
128.9556
- 585.5936 ]
+ 414.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER113': class PDFDictionary
-130 0 obj
+% 'Annot.NUMBER114': class PDFDictionary
+131 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://argparse.googlecode.com) >>
@@ -2128,14 +2136,14 @@ endobj
0
0 ]
/Rect [ 141.0629
- 561.5936
+ 390.5936
183.3029
- 573.5936 ]
+ 402.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
-% 'Annot.NUMBER114': class PDFDictionary
-131 0 obj
+% 'Annot.NUMBER115': class PDFDictionary
+132 0 obj
<< /A << /S /URI
/Type /Action
/URI (http://pypi.python.org/pypi/Clap/0.7) >>
@@ -2143,16 +2151,23 @@ endobj
0
0 ]
/Rect [ 263.3429
- 531.5936
+ 360.5936
286.6829
- 543.5936 ]
+ 372.5936 ]
/Subtype /Link
/Type /Annot >>
endobj
% 'Page12': class PDFPage
-132 0 obj
+133 0 obj
% Page dictionary
-<< /Annots [ 122 0 R
+<< /Annots [ 115 0 R
+ 116 0 R
+ 117 0 R
+ 118 0 R
+ 119 0 R
+ 120 0 R
+ 121 0 R
+ 122 0 R
123 0 R
124 0 R
125 0 R
@@ -2161,13 +2176,14 @@ endobj
128 0 R
129 0 R
130 0 R
- 131 0 R ]
- /Contents 160 0 R
+ 131 0 R
+ 132 0 R ]
+ /Contents 161 0 R
/MediaBox [ 0
0
595.2756
841.8898 ]
- /Parent 148 0 R
+ /Parent 149 0 R
/Resources << /Font 1 0 R
/ProcSet [ /PDF
/Text
@@ -2178,195 +2194,195 @@ endobj
/Trans << >>
/Type /Page >>
endobj
-% 'R133': class PDFCatalog
-133 0 obj
+% 'R134': class PDFCatalog
+134 0 obj
% Document Root
-<< /Outlines 135 0 R
- /PageLabels 161 0 R
+<< /Outlines 136 0 R
+ /PageLabels 162 0 R
/PageMode /UseNone
- /Pages 148 0 R
+ /Pages 149 0 R
/Type /Catalog >>
endobj
-% 'R134': class PDFInfo
-134 0 obj
+% 'R135': class PDFInfo
+135 0 obj
<< /Author (Michele Simionato)
- /CreationDate (D:20100601145350-01'00')
+ /CreationDate (D:20100601163823-01'00')
/Keywords ()
/Producer (ReportLab http://www.reportlab.com)
/Subject (\(unspecified\))
/Title (Plac, the Easiest Command Line Arguments Parser in the World) >>
endobj
-% 'R135': class PDFOutlines
-135 0 obj
+% 'R136': class PDFOutlines
+136 0 obj
<< /Count 12
- /First 136 0 R
- /Last 147 0 R
+ /First 137 0 R
+ /Last 148 0 R
/Type /Outlines >>
endobj
% 'Outline.0': class OutlineEntryObject
-136 0 obj
-<< /Dest [ 41 0 R
- /XYZ
- 62.69291
- 338.0236
- 0 ]
- /Next 137 0 R
- /Parent 135 0 R
- /Title (Introduction) >>
-endobj
-% 'Outline.1': class OutlineEntryObject
137 0 obj
-<< /Dest [ 49 0 R
+<< /Dest [ 44 0 R
/XYZ
62.69291
- 729.0236
+ 338.0236
0 ]
/Next 138 0 R
- /Parent 135 0 R
- /Prev 136 0 R
+ /Parent 136 0 R
/Title (The importance of scaling down) >>
endobj
-% 'Outline.2': class OutlineEntryObject
+% 'Outline.1': class OutlineEntryObject
138 0 obj
-<< /Dest [ 56 0 R
+<< /Dest [ 49 0 R
/XYZ
62.69291
- 458.6236
+ 681.0236
0 ]
/Next 139 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 137 0 R
- /Title (Positional default arguments) >>
+ /Title (Positional required arguments) >>
endobj
-% 'Outline.3': class OutlineEntryObject
+% 'Outline.2': class OutlineEntryObject
139 0 obj
-<< /Dest [ 64 0 R
+<< /Dest [ 56 0 R
/XYZ
62.69291
- 269.4236
+ 458.6236
0 ]
/Next 140 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 138 0 R
- /Title (Options and flags) >>
+ /Title (Positional default arguments) >>
endobj
-% 'Outline.4': class OutlineEntryObject
+% 'Outline.3': class OutlineEntryObject
140 0 obj
-<< /Dest [ 71 0 R
+<< /Dest [ 65 0 R
/XYZ
62.69291
- 201.0236
+ 257.4236
0 ]
/Next 141 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 139 0 R
- /Title (plac for Python 2.X users) >>
+ /Title (Options and flags) >>
endobj
-% 'Outline.5': class OutlineEntryObject
+% 'Outline.4': class OutlineEntryObject
141 0 obj
-<< /Dest [ 78 0 R
+<< /Dest [ 79 0 R
/XYZ
62.69291
- 490.6236
+ 765.0236
0 ]
/Next 142 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 140 0 R
- /Title (More features) >>
+ /Title (plac for Python 2.X users) >>
endobj
-% 'Outline.6': class OutlineEntryObject
+% 'Outline.5': class OutlineEntryObject
142 0 obj
-<< /Dest [ 82 0 R
+<< /Dest [ 79 0 R
/XYZ
62.69291
- 395.2849
+ 374.4236
0 ]
/Next 143 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 141 0 R
- /Title (A more realistic example) >>
+ /Title (More features) >>
endobj
-% 'Outline.7': class OutlineEntryObject
+% 'Outline.6': class OutlineEntryObject
143 0 obj
-<< /Dest [ 88 0 R
+<< /Dest [ 83 0 R
/XYZ
62.69291
- 448.6236
+ 279.1952
0 ]
/Next 144 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 142 0 R
- /Title (A few notes on the underlying implementation) >>
+ /Title (A somewhat realistic example) >>
endobj
-% 'Outline.8': class OutlineEntryObject
+% 'Outline.7': class OutlineEntryObject
144 0 obj
-<< /Dest [ 95 0 R
+<< /Dest [ 88 0 R
/XYZ
62.69291
- 525.8236
+ 316.6236
0 ]
/Next 145 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 143 0 R
- /Title (Custom annotation objects) >>
+ /Title (A few notes on the underlying implementation) >>
endobj
-% 'Outline.9': class OutlineEntryObject
+% 'Outline.8': class OutlineEntryObject
145 0 obj
-<< /Dest [ 121 0 R
+<< /Dest [ 96 0 R
/XYZ
62.69291
- 587.8236
+ 400.6236
0 ]
/Next 146 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 144 0 R
- /Title (plac vs argparse) >>
+ /Title (Custom annotation objects) >>
endobj
-% 'Outline.10': class OutlineEntryObject
+% 'Outline.9': class OutlineEntryObject
146 0 obj
-<< /Dest [ 121 0 R
+<< /Dest [ 114 0 R
/XYZ
62.69291
- 188.8236
+ 452.6236
0 ]
/Next 147 0 R
- /Parent 135 0 R
+ /Parent 136 0 R
/Prev 145 0 R
- /Title (The future) >>
+ /Title (plac vs argparse) >>
endobj
-% 'Outline.11': class OutlineEntryObject
+% 'Outline.10': class OutlineEntryObject
147 0 obj
-<< /Dest [ 132 0 R
+<< /Dest [ 133 0 R
/XYZ
62.69291
- 765.0236
+ 705.0236
0 ]
- /Parent 135 0 R
+ /Next 148 0 R
+ /Parent 136 0 R
/Prev 146 0 R
- /Title (Trivia: the story behind the name) >>
+ /Title (The future) >>
endobj
-% 'R148': class PDFPages
+% 'Outline.11': class OutlineEntryObject
148 0 obj
+<< /Dest [ 133 0 R
+ /XYZ
+ 62.69291
+ 594.0236
+ 0 ]
+ /Parent 136 0 R
+ /Prev 147 0 R
+ /Title (Trivia: the story behind the name) >>
+endobj
+% 'R149': class PDFPages
+149 0 obj
% page tree
<< /Count 12
- /Kids [ 41 0 R
+ /Kids [ 44 0 R
49 0 R
56 0 R
- 64 0 R
- 66 0 R
+ 65 0 R
+ 67 0 R
71 0 R
- 78 0 R
- 82 0 R
+ 79 0 R
+ 83 0 R
88 0 R
- 95 0 R
- 121 0 R
- 132 0 R ]
+ 96 0 R
+ 114 0 R
+ 133 0 R ]
/Type /Pages >>
endobj
-% 'R149': class PDFStream
-149 0 obj
+% 'R150': class PDFStream
+150 0 obj
% page stream
-<< /Length 8404 >>
+<< /Length 8661 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
@@ -2516,7 +2532,7 @@ BT /F3 10 Tf 12 TL ET
q
1 0 0 1 0 201 cm
q
-BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (Introduction) Tj T* ET
+BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (The importance of scaling down) Tj T* ET
Q
Q
q
@@ -2530,7 +2546,7 @@ Q
q
1 0 0 1 0 183 cm
q
-BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (The importance of scaling down) Tj T* ET
+BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (Positional required arguments) Tj T* ET
Q
Q
q
@@ -2580,7 +2596,7 @@ q
q
0 0 .501961 rg
0 0 .501961 RG
-BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 66.44 0 Td (6) Tj T* -66.44 0 Td ET
+BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 66.44 0 Td (7) Tj T* -66.44 0 Td ET
Q
Q
q
@@ -2600,7 +2616,7 @@ Q
q
1 0 0 1 0 93 cm
q
-BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (A more realistic example) Tj T* ET
+BT 1 0 0 1 0 4.82 Tm 12 TL /F2 10 Tf 0 0 .501961 rg (A somewhat realistic example) Tj T* ET
Q
Q
q
@@ -2664,7 +2680,7 @@ q
q
0 0 .501961 rg
0 0 .501961 RG
-BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 60.88 0 Td (11) Tj T* -60.88 0 Td ET
+BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 60.88 0 Td (12) Tj T* -60.88 0 Td ET
Q
Q
q
@@ -2687,66 +2703,73 @@ Q
q
1 0 0 1 62.69291 317.0236 cm
q
-BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (Introduction) Tj T* ET
+BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (The importance of scaling down) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 251.0236 cm
+1 0 0 1 62.69291 263.0236 cm
q
-BT 1 0 0 1 0 52.82 Tm 1.50936 Tw 12 TL /F1 10 Tf 0 0 0 rg (There is no want of command line arguments parsers in the Python world. The standard library alone) Tj T* 0 Tw 1.385318 Tw (contains three different modules for the parsing of command line options: ) Tj 0 0 .501961 rg (getopt ) Tj 0 0 0 rg (\(from the stone age\),) Tj T* 0 Tw .501235 Tw 0 0 .501961 rg (optparse ) Tj 0 0 0 rg (\(from Python 2.3\) and ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (\(from Python 2.7\). All of them are quite powerful and especially) Tj T* 0 Tw .199984 Tw 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (is an industrial strength solution; unfortunately, all of them feature a non-zero learning curve and) Tj T* 0 Tw (a certain verbosity.) Tj T* ET
+BT 1 0 0 1 0 40.82 Tm 1.50936 Tw 12 TL /F1 10 Tf 0 0 0 rg (There is no want of command line arguments parsers in the Python world. The standard library alone) Tj T* 0 Tw 1.087126 Tw (contains three different modules: ) Tj 0 0 .501961 rg (getopt ) Tj 0 0 0 rg (\(from the stone age\), ) Tj 0 0 .501961 rg (optparse ) Tj 0 0 0 rg (\(from Python 2.3\) and ) Tj 0 0 .501961 rg (argparse) Tj T* 0 Tw .223735 Tw 0 0 0 rg (\(from Python 2.7\). All of them are quite powerful and especially ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (is an industrial strength solution;) Tj T* 0 Tw (unfortunately, all of them feature a non-zero learning curve and a certain verbosity.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 161.0236 cm
+1 0 0 1 62.69291 185.0236 cm
q
-BT 1 0 0 1 0 76.82 Tm 1.342209 Tw 12 TL /F1 10 Tf 0 0 0 rg (Enters ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (. ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is designed to be downwardly scalable, i.e. to be trivially simple to use for trivial use) Tj T* 0 Tw .29436 Tw (cases, and to have a next-to-zero learning curve. Technically ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is just a simple wrapper over ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (,) Tj T* 0 Tw .01686 Tw (hiding most of the complexity while retaining most of the power. ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is surprisingly scalable upwards even) Tj T* 0 Tw .569398 Tw (for non-trivial use cases, but it is not intended to be an industrial strength command line parsing module.) Tj T* 0 Tw .07104 Tw (Its capabilities are limited by design. If you need more power, by all means use the parsing modules in the) Tj T* 0 Tw .51237 Tw (standard library. Still, I have been using Python for 8 years and never once I had to use the full power of) Tj T* 0 Tw (the standard library modules.) Tj T* ET
+BT 1 0 0 1 0 64.82 Tm .953735 Tw 12 TL /F1 10 Tf 0 0 0 rg (An ex-coworker of mine, David Welton, once wrote a nice article about the importance of ) Tj 0 0 .501961 rg (scaling down) Tj 0 0 0 rg (:) Tj T* 0 Tw 1.026457 Tw (most people are concerned with the possibility of scaling up, but we should also be concerned with the) Tj T* 0 Tw .388651 Tw (issue of scaling down. In other words, programs should address the common cases simply, simple things) Tj T* 0 Tw 2.34186 Tw (should be kept simple, while at the same keeping difficult things possible. ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (adhere as much as) Tj T* 0 Tw .90832 Tw (possible to this philosophy and it is designed to handle well the trivial case, while retaining the ability to) Tj T* 0 Tw (handle complex cases relying on the underlying power of ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 83.02362 cm
+1 0 0 1 62.69291 119.0236 cm
q
-BT 1 0 0 1 0 64.82 Tm .536457 Tw 12 TL /F1 10 Tf 0 0 0 rg (Actually I am pretty much convinced that features provided by ) Tj /F4 10 Tf (plac ) Tj /F1 10 Tf (are more than enough for 99.9% of ) Tj T* 0 Tw 2.315318 Tw (the typical use cases of a scripter. I am targetting here programmers, sys-admins, scientists and in ) Tj T* 0 Tw 2.200751 Tw (general people writing throw-away scripts for themselves, choosing to use a command line interface ) Tj T* 0 Tw .510488 Tw (because it is the quick and simple. Such users are not interested in features, they just want to be able to ) Tj T* 0 Tw .231098 Tw (write a simple command line tool from a simple specification, not to build a command line parser by hand. ) Tj T* 0 Tw 2.02936 Tw (Unfortunately, the current modules in the standard library forces them to go the hard way. They are) Tj T* 0 Tw ET
+BT 1 0 0 1 0 52.82 Tm .331235 Tw 12 TL /F1 10 Tf 0 0 0 rg (Technically ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is just a simple wrapper over ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (, hiding most of its complexity while retaining most) Tj T* 0 Tw 2.759318 Tw (of its power. ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is surprisingly scalable upwards to non-trivial use cases, even without using the) Tj T* 0 Tw .758651 Tw (underlying ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (, which however can always be accessed if you really need more power. However, I) Tj T* 0 Tw .067488 Tw (have been using Python for 8 years and in my experience it is extremely unlikely that you will ever need to) Tj T* 0 Tw (go beyond the features provided by ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (directly.) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 89.02362 cm
+q
+BT 1 0 0 1 0 16.82 Tm 1.778221 Tw 12 TL /F1 10 Tf 0 0 0 rg (I am pretty much convinced that features provided by ) Tj /F4 10 Tf (plac ) Tj /F1 10 Tf (are more than enough for 99.9% of the ) Tj T* 0 Tw .416412 Tw (typical use cases. I am targetting here programmers, sys-admins, scientists and in general people writing) Tj T* 0 Tw ET
+Q
+Q
+q
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (1) Tj T* -238.1649 0 Td ET
Q
Q
endstream
endobj
-% 'R150': class PDFStream
-150 0 obj
+% 'R151': class PDFStream
+151 0 obj
% page stream
-<< /Length 5477 >>
+<< /Length 5144 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 741.0236 cm
+1 0 0 1 62.69291 693.0236 cm
q
-BT 1 0 0 1 0 16.82 Tm 2.004269 Tw 12 TL /F1 10 Tf 0 0 0 rg (designed to implement power user tools for programmers or system administrators, and they have a) Tj T* 0 Tw (non-trivial learning curve.) Tj T* ET
+BT 1 0 0 1 0 64.82 Tm .53686 Tw 12 TL /F1 10 Tf 0 0 0 rg (throw-away scripts for themselves, choosing to use a command line interface because it is the quick and) Tj T* 0 Tw .79881 Tw (simple. Such users are not interested in features, they are interested in a small learning curve: they just) Tj T* 0 Tw .686303 Tw (want to be able to write a simple command line tool from a simple specification, not to build a command) Tj T* 0 Tw 1.059398 Tw (line parser by hand. Unfortunately, the modules in the standard library forces them to go the hard way.) Tj T* 0 Tw 1.329983 Tw (They are designed to implement power user tools for programmers or system administrators, and they) Tj T* 0 Tw (have a non-trivial learning curve.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 708.0236 cm
+1 0 0 1 62.69291 660.0236 cm
q
-BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (The importance of scaling down) Tj T* ET
+BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (Positional required arguments) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 630.0236 cm
+1 0 0 1 62.69291 594.0236 cm
q
-BT 1 0 0 1 0 64.82 Tm .588735 Tw 12 TL /F1 10 Tf 0 0 0 rg (An ex-coworker of mine, David Welton, once wrote a nice article about the import) Tj (<) Tj (ance of ) Tj 0 0 .501961 rg (scaling down) Tj 0 0 0 rg (:) Tj T* 0 Tw 1.026457 Tw (most people are concerned with the possibility of scaling up, but we should also be concerned with the) Tj T* 0 Tw .15436 Tw (issue of scaling down. In other worlds, simple things should be kept simple, and programs should address) Tj T* 0 Tw .50061 Tw (the common cases in an easy way, hopefully without loosing too much power and keeping difficult things) Tj T* 0 Tw .815542 Tw (possible. ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (adhere as much as possible to this philosophy and it is designed to handle well the trivial) Tj T* 0 Tw (case, while retaining the ability to handle complex cases relying on the underlying power of ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
+BT 1 0 0 1 0 52.82 Tm .352209 Tw 12 TL /F1 10 Tf 0 0 0 rg (Let me start with the simplest possible thing: a script that takes a single argument and does something to) Tj T* 0 Tw 3.17686 Tw (it. It cannot get more trivial than that \(discarding the possibility of a script without command line) Tj T* 0 Tw .79881 Tw (arguments, where there is nothing to parse\), nevertheless it is a use case ) Tj /F5 10 Tf (extremely common) Tj /F1 10 Tf (: I need to) Tj T* 0 Tw .956988 Tw (write scripts like that nearly every day, I wrote hundreds of them in the last few years and I have never) Tj T* 0 Tw (been happy. Here is a typical example of code I have been writing by hand for years:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 564.0236 cm
-q
-BT 1 0 0 1 0 52.82 Tm 1.217209 Tw 12 TL /F1 10 Tf 0 0 0 rg (To be concrete, let me start with the simplest possible thing: a script that takes a single argument and) Tj T* 0 Tw 1.844692 Tw (does something to it. It cannot get more trivial than that \(discarding the possibility of a script without) Tj T* 0 Tw 2.277318 Tw (command line arguments, where there is nothing to parse\), nevertheless it is a use case ) Tj /F5 10 Tf (extremely) Tj T* 0 Tw .540488 Tw (common) Tj /F1 10 Tf (: I need to write scripts like that nearly every day, I wrote hundreds of them in the last few years) Tj T* 0 Tw (and I have never been happy. Here is a typical example of code I have been writing by hand for years:) Tj T* ET
-Q
+1 0 0 1 62.69291 588.0236 cm
Q
q
-1 0 0 1 62.69291 558.0236 cm
-Q
-q
-1 0 0 1 62.69291 376.8236 cm
+1 0 0 1 62.69291 406.8236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -2761,7 +2784,7 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 448.6898 180 re B*
+n -6 -6 442.6898 180 re B*
Q
q
0 0 0 rg
@@ -2775,19 +2798,19 @@ q
Q
Q
q
-1 0 0 1 62.69291 376.8236 cm
+1 0 0 1 62.69291 406.8236 cm
Q
q
-1 0 0 1 62.69291 274.8236 cm
+1 0 0 1 62.69291 304.8236 cm
q
-BT 1 0 0 1 0 88.82 Tm .880651 Tw 12 TL /F1 10 Tf 0 0 0 rg (As you see the whole ) Tj /F4 10 Tf (if __name__ == '__main__' ) Tj /F1 10 Tf (block \(nine lines\) is essentially boilerplate that) Tj T* 0 Tw 1.125318 Tw (should not exists. Actually I think the Python language should recognize the main function and perform) Tj T* 0 Tw 1.385984 Tw (trivial arguments parsing behind the scenes; unfortunaly this is unlikely to happen. I have been writing) Tj T* 0 Tw 1.767356 Tw (boilerplate like this in hundreds of scripts for years, and every time I ) Tj /F5 10 Tf (hate ) Tj /F1 10 Tf (it. The purpose of using a) Tj T* 0 Tw 1.47229 Tw (scripting language is convenience and trivial things should be trivial. Unfortunately the standard library) Tj T* 0 Tw .482093 Tw (modules do not help for this use case, which may be trivial, but it is still incredibly common. Using ) Tj 0 0 .501961 rg (getopt) Tj T* 0 Tw .253735 Tw 0 0 0 rg (and ) Tj 0 0 .501961 rg (optparse ) Tj 0 0 0 rg (does not help, since they are intended to manage options and not positional arguments; the) Tj T* 0 Tw 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (module helps a bit and it is able to reduce the boilerplate from nine lines to six lines:) Tj T* ET
+BT 1 0 0 1 0 88.82 Tm .880651 Tw 12 TL /F1 10 Tf 0 0 0 rg (As you see the whole ) Tj /F4 10 Tf (if __name__ == '__main__' ) Tj /F1 10 Tf (block \(nine lines\) is essentially boilerplate that) Tj T* 0 Tw .66528 Tw (should not exists. Actually I think the Python language should recognize the main function and pass to it) Tj T* 0 Tw .04811 Tw (the command line arguments behind the scenes; unfortunaly this is unlikely to happen. I have been writing) Tj T* 0 Tw 1.767356 Tw (boilerplate like this in hundreds of scripts for years, and every time I ) Tj /F5 10 Tf (hate ) Tj /F1 10 Tf (it. The purpose of using a) Tj T* 0 Tw 1.47229 Tw (scripting language is convenience and trivial things should be trivial. Unfortunately the standard library) Tj T* 0 Tw 1.037356 Tw (does not help for this use case, which may be trivial, but it is still incredibly common. Using ) Tj 0 0 .501961 rg (getopt ) Tj 0 0 0 rg (and) Tj T* 0 Tw 1.567984 Tw 0 0 .501961 rg (optparse ) Tj 0 0 0 rg (does not help, since they are intended to manage options and not positional arguments; the) Tj T* 0 Tw 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (module helps a bit and it is able to reduce the boilerplate from nine lines to six lines:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 268.8236 cm
+1 0 0 1 62.69291 298.8236 cm
Q
q
-1 0 0 1 62.69291 123.6236 cm
+1 0 0 1 62.69291 153.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -2816,23 +2839,30 @@ q
Q
Q
q
-1 0 0 1 62.69291 123.6236 cm
+1 0 0 1 62.69291 153.6236 cm
Q
q
-1 0 0 1 62.69291 81.62362 cm
+1 0 0 1 62.69291 111.6236 cm
q
0 0 0 rg
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL 1.644269 Tw (However saving three lines does not justify introducing the external dependency: most people will not) Tj T* 0 Tw .276303 Tw (switch Python 2.7, which at the time of this writing is just about to be released, for many years. Moreover,) Tj T* 0 Tw (it just feels too complex to instantiate a class and to define a parser by hand for such a trivial task.) Tj T* ET
Q
Q
+q
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (2) Tj T* -238.1649 0 Td ET
+Q
+Q
endstream
endobj
-% 'R151': class PDFStream
-151 0 obj
+% 'R152': class PDFStream
+152 0 obj
% page stream
-<< /Length 4343 >>
+<< /Length 4445 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
@@ -2991,7 +3021,7 @@ BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (In other words, six lines of boilerplate h
Q
Q
q
-1 0 0 1 62.69291 80.02362 cm
+1 0 0 1 62.69291 92.02362 cm
q
q
1 0 0 1 0 0 cm
@@ -3001,28 +3031,35 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 468.6898 48 re B*
+n -6 -6 468.6898 36 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 29.71 Tm /F4 10 Tf 12 TL (usage: example4_.py [-h] dsn [table] [today]) Tj T* T* (positional arguments:) Tj T* ET
+BT 1 0 0 1 0 17.71 Tm /F4 10 Tf 12 TL (usage: example4_.py [-h] dsn [table] [today]) Tj T* T* ET
+Q
Q
Q
Q
Q
+q
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (3) Tj T* -238.1649 0 Td ET
+Q
Q
endstream
endobj
-% 'R152': class PDFStream
-152 0 obj
+% 'R153': class PDFStream
+153 0 obj
% page stream
-<< /Length 4886 >>
+<< /Length 4757 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 679.8236 cm
+1 0 0 1 62.69291 667.8236 cm
q
q
1 0 0 1 0 0 cm
@@ -3032,27 +3069,27 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 468.6898 84 re B*
+n -6 -6 468.6898 96 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 65.71 Tm /F4 10 Tf 12 TL ( dsn) Tj T* ( table) Tj T* ( today) Tj T* T* (optional arguments:) Tj T* ( -h, --help show this help message and exit) Tj T* ET
+BT 1 0 0 1 0 77.71 Tm /F4 10 Tf 12 TL (positional arguments:) Tj T* ( dsn) Tj T* ( table) Tj T* ( today) Tj T* T* (optional arguments:) Tj T* ( -h, --help show this help message and exit) Tj T* ET
Q
Q
Q
Q
Q
q
-1 0 0 1 62.69291 647.8236 cm
+1 0 0 1 62.69291 635.8236 cm
q
BT 1 0 0 1 0 16.82 Tm .396235 Tw 12 TL /F1 10 Tf 0 0 .501961 rg (plac ) Tj 0 0 0 rg (manages transparently even the case when you want to pass a variable number of arguments. Here) Tj T* 0 Tw (is an example, a script running on a database a series of SQL scripts:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 641.8236 cm
+1 0 0 1 62.69291 629.8236 cm
Q
q
-1 0 0 1 62.69291 472.6236 cm
+1 0 0 1 62.69291 460.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3080,16 +3117,16 @@ q
Q
Q
q
-1 0 0 1 62.69291 472.6236 cm
+1 0 0 1 62.69291 460.6236 cm
Q
q
-1 0 0 1 62.69291 442.6236 cm
+1 0 0 1 62.69291 430.6236 cm
q
BT 1 0 0 1 0 16.82 Tm .563876 Tw 12 TL /F1 10 Tf 0 0 0 rg (Using ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (, you can just replace the ) Tj /F4 10 Tf (__main__ ) Tj /F1 10 Tf (block with the usual two lines \(I have defined an Emacs) Tj T* 0 Tw (keybinding for them\) and you get the following usage message:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 325.4236 cm
+1 0 0 1 62.69291 313.4236 cm
q
q
1 0 0 1 0 0 cm
@@ -3110,50 +3147,57 @@ Q
Q
Q
q
-1 0 0 1 62.69291 281.4236 cm
+1 0 0 1 62.69291 269.4236 cm
q
BT 1 0 0 1 0 28.82 Tm .92881 Tw 12 TL /F1 10 Tf 0 0 0 rg (The examples here should have made clear that ) Tj /F5 10 Tf (plac is able to figure out the command line arguments) Tj T* 0 Tw .928488 Tw (parser to use from the signature of the main function) Tj /F1 10 Tf (. This is the whole idea behind ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (: if my intent is) Tj T* 0 Tw (clear, let's the machine take care of the details.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 248.4236 cm
+1 0 0 1 62.69291 236.4236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (Options and flags) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 158.4236 cm
+1 0 0 1 62.69291 146.4236 cm
q
-BT 1 0 0 1 0 76.82 Tm .046098 Tw 12 TL /F1 10 Tf 0 0 0 rg (It is surprising how few command line scripts with options I have written over the years \(probably less than) Tj T* 0 Tw 1.165984 Tw (a hundred\), compared to the number of scripts with positional arguments \(I certainly have written more) Tj T* 0 Tw 1.221163 Tw (than a thousand of them\). Still, this use case is quite common and cannot be neglected. The standard) Tj T* 0 Tw .446098 Tw (library modules \(all of them\) are quite verbose when it comes to specifying the options and frankly I have) Tj T* 0 Tw .732339 Tw (never used them directly. Instead, I have always relied on an old recipe of mine, the ) Tj 0 0 .501961 rg (optionparse ) Tj 0 0 0 rg (recipe,) Tj T* 0 Tw 1.32784 Tw (which provides a convenient wrapper over ) Tj 0 0 .501961 rg (optionparse) Tj 0 0 0 rg (. Alternatively, in the simplest cases, I have just) Tj T* 0 Tw (performed the parsing by hand, instead of manually building a suitable OptionParser.) Tj T* ET
+BT 1 0 0 1 0 76.82 Tm .046098 Tw 12 TL /F1 10 Tf 0 0 0 rg (It is surprising how few command line scripts with options I have written over the years \(probably less than) Tj T* 0 Tw 1.165984 Tw (a hundred\), compared to the number of scripts with positional arguments I have written \(certainly more) Tj T* 0 Tw 1.221163 Tw (than a thousand of them\). Still, this use case is quite common and cannot be neglected. The standard) Tj T* 0 Tw .446098 Tw (library modules \(all of them\) are quite verbose when it comes to specifying the options and frankly I have) Tj T* 0 Tw .732339 Tw (never used them directly. Instead, I have always relied on an old recipe of mine, the ) Tj 0 0 .501961 rg (optionparse ) Tj 0 0 0 rg (recipe,) Tj T* 0 Tw 1.32784 Tw (which provides a convenient wrapper over ) Tj 0 0 .501961 rg (optionparse) Tj 0 0 0 rg (. Alternatively, in the simplest cases, I have just) Tj T* 0 Tw (performed the parsing by hand, instead of manually building a suitable ) Tj 0 0 .501961 rg (OptionParser) Tj 0 0 0 rg (.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 116.4236 cm
+1 0 0 1 62.69291 104.4236 cm
q
BT 1 0 0 1 0 28.82 Tm .476098 Tw 12 TL /F1 10 Tf 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is inspired to the ) Tj 0 0 .501961 rg (optionparse ) Tj 0 0 0 rg (recipe, in the sense that it delivers the programmer from the burden of) Tj T* 0 Tw .011488 Tw (writing the parser, but is less of a hack: instead of extracting the parser from the docstring of the module, it) Tj T* 0 Tw (extracts it from the signature of the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 86.42362 cm
+1 0 0 1 56.69291 56.69291 cm
q
-BT 1 0 0 1 0 16.82 Tm .319987 Tw 12 TL /F1 10 Tf 0 0 0 rg (The idea comes from the ) Tj /F5 10 Tf (function annotations ) Tj /F1 10 Tf (concept, a new feature of Python 3. An example is worth a) Tj T* 0 Tw (thousand words, so here it is:) Tj T* ET
-Q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (4) Tj T* -238.1649 0 Td ET
Q
-q
-1 0 0 1 62.69291 80.42362 cm
Q
endstream
endobj
-% 'R153': class PDFStream
-153 0 obj
+% 'R154': class PDFStream
+154 0 obj
% page stream
-<< /Length 4772 >>
+<< /Length 4826 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 655.8236 cm
+1 0 0 1 62.69291 741.0236 cm
+q
+BT 1 0 0 1 0 16.82 Tm .319987 Tw 12 TL /F1 10 Tf 0 0 0 rg (The idea comes from the ) Tj /F5 10 Tf (function annotations ) Tj /F1 10 Tf (concept, a new feature of Python 3. An example is worth a) Tj T* 0 Tw (thousand words, so here it is:) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 735.0236 cm
+Q
+q
+1 0 0 1 62.69291 625.8236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3168,7 +3212,7 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 442.6898 108 re B*
+n -6 -6 448.6898 108 re B*
Q
q
0 0 0 rg
@@ -3182,16 +3226,16 @@ q
Q
Q
q
-1 0 0 1 62.69291 655.8236 cm
+1 0 0 1 62.69291 625.8236 cm
Q
q
-1 0 0 1 62.69291 589.8236 cm
+1 0 0 1 62.69291 559.8236 cm
q
-BT 1 0 0 1 0 52.82 Tm .789983 Tw 12 TL /F1 10 Tf 0 0 0 rg (As you see, the argument ) Tj /F4 10 Tf (command ) Tj /F1 10 Tf (has been annotated with the tuple ) Tj /F4 10 Tf (\("SQL query", 'option',) Tj T* 0 Tw .593876 Tw ('c'\)) Tj /F1 10 Tf (: the first string is the help string which will appear in the usage message, whereas the second and) Tj T* 0 Tw .144988 Tw (third strings tell ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (that ) Tj /F4 10 Tf (command ) Tj /F1 10 Tf (is an option and that it can be abbreviated with the letter ) Tj /F4 10 Tf (c) Tj /F1 10 Tf (. Of course,) Tj T* 0 Tw 1.543735 Tw (it also possible to use the long option format, by prefixing the option with ) Tj /F4 10 Tf (--command=) Tj /F1 10 Tf (. The resulting) Tj T* 0 Tw (usage message is the following:) Tj T* ET
+BT 1 0 0 1 0 52.82 Tm .789983 Tw 12 TL /F1 10 Tf 0 0 0 rg (As you see, the argument ) Tj /F4 10 Tf (command ) Tj /F1 10 Tf (has been annotated with the tuple ) Tj /F4 10 Tf (\("SQL query", 'option',) Tj T* 0 Tw .593876 Tw ('c'\)) Tj /F1 10 Tf (: the first string is the help string which will appear in the usage message, whereas the second and) Tj T* 0 Tw .144988 Tw (third strings tell ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (that ) Tj /F4 10 Tf (command ) Tj /F1 10 Tf (is an option and that it can be abbreviated with the letter ) Tj /F4 10 Tf (c) Tj /F1 10 Tf (. Of course,) Tj T* 0 Tw .89284 Tw (the long option format \() Tj /F4 10 Tf (--command=) Tj /F1 10 Tf (\) comes from the argument name. The resulting usage message is) Tj T* 0 Tw (the following:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 448.6236 cm
+1 0 0 1 62.69291 418.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -3212,14 +3256,14 @@ Q
Q
Q
q
-1 0 0 1 62.69291 428.6236 cm
+1 0 0 1 62.69291 398.6236 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Here are two examples of usage:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 347.4236 cm
+1 0 0 1 62.69291 317.4236 cm
q
q
1 0 0 1 0 0 cm
@@ -3240,16 +3284,16 @@ Q
Q
Q
q
-1 0 0 1 62.69291 315.4236 cm
+1 0 0 1 62.69291 285.4236 cm
q
BT 1 0 0 1 0 16.82 Tm 1.34104 Tw 12 TL /F1 10 Tf 0 0 0 rg (Notice that if the option is not passed, the variable ) Tj /F4 10 Tf (command ) Tj /F1 10 Tf (will get the value ) Tj /F4 10 Tf (None) Tj /F1 10 Tf (. It is possible to) Tj T* 0 Tw (specify a non-trivial default for an option. Here is an example:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 309.4236 cm
+1 0 0 1 62.69291 279.4236 cm
Q
q
-1 0 0 1 62.6378 226.6719 cm
+1 0 0 1 62.6378 196.6719 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3278,16 +3322,16 @@ q
Q
Q
q
-1 0 0 1 62.69291 226.6719 cm
+1 0 0 1 62.69291 196.6719 cm
Q
q
-1 0 0 1 62.69291 208.6719 cm
+1 0 0 1 62.69291 178.6719 cm
q
BT 1 0 0 1 0 4.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (Now if you do not pass the ) Tj /F4 10 Tf (command option) Tj /F1 10 Tf (, the default query will be executed:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 163.4719 cm
+1 0 0 1 62.69291 133.4719 cm
q
q
1 0 0 1 0 0 cm
@@ -3308,14 +3352,31 @@ Q
Q
Q
q
-1 0 0 1 62.69291 143.4719 cm
+1 0 0 1 62.69291 113.4719 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Positional argument can be annotated too:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 86.27188 cm
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (5) Tj T* -238.1649 0 Td ET
+Q
+Q
+
+endstream
+
+endobj
+% 'R155': class PDFStream
+155 0 obj
+% page stream
+<< /Length 5056 >>
+stream
+1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
+q
+1 0 0 1 62.69291 715.8236 cm
q
q
1 0 0 1 0 0 cm
@@ -3335,24 +3396,14 @@ Q
Q
Q
Q
-
-endstream
-
-endobj
-% 'R154': class PDFStream
-154 0 obj
-% page stream
-<< /Length 5617 >>
-stream
-1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 729.0236 cm
+1 0 0 1 62.69291 671.8236 cm
q
-BT 1 0 0 1 0 28.82 Tm 3.203318 Tw 12 TL /F1 10 Tf 0 0 0 rg (Of course explicit is better than implicit, an no special cases are special enough, but sometimes) Tj T* 0 Tw .64061 Tw (practicality beats purity, so ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is smart enough to convert help messages into tuples internally; in other) Tj T* 0 Tw (words, you can just write "Database dsn" instead of ) Tj /F4 10 Tf (\("Database dsn", 'positional', None\)) Tj /F1 10 Tf (:) Tj T* ET
+BT 1 0 0 1 0 28.82 Tm 3.203318 Tw 12 TL /F1 10 Tf 0 0 0 rg (Of course explicit is better than implicit, an no special cases are special enough, but sometimes) Tj T* 0 Tw .112339 Tw (practicality beats purity, so ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is smart enough to convert help messages into tuples; in other words, you) Tj T* 0 Tw (can just write "Database dsn" instead of ) Tj /F4 10 Tf (\("Database dsn", 'positional', None\)) Tj /F1 10 Tf (:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 683.8236 cm
+1 0 0 1 62.69291 626.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -3373,13 +3424,13 @@ Q
Q
Q
q
-1 0 0 1 62.69291 651.8236 cm
+1 0 0 1 62.69291 594.6236 cm
q
BT 1 0 0 1 0 16.82 Tm .171988 Tw 12 TL /F1 10 Tf 0 0 0 rg (In both cases the usage message will show a nice help string on the right hand side of the ) Tj /F4 10 Tf (dsn ) Tj /F1 10 Tf (positional) Tj T* 0 Tw (argument. varargs \(starred-arguments\) can also be annotated:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 606.6236 cm
+1 0 0 1 62.69291 549.4236 cm
q
q
1 0 0 1 0 0 cm
@@ -3400,13 +3451,13 @@ Q
Q
Q
q
-1 0 0 1 62.69291 586.6236 cm
+1 0 0 1 62.69291 529.4236 cm
q
BT 1 0 0 1 0 4.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (is a valid signature for ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (, which will recognize the help strings for both ) Tj /F4 10 Tf (dsn ) Tj /F1 10 Tf (and ) Tj /F4 10 Tf (scripts) Tj /F1 10 Tf (:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 529.4236 cm
+1 0 0 1 62.69291 472.2236 cm
q
q
1 0 0 1 0 0 cm
@@ -3427,13 +3478,13 @@ Q
Q
Q
q
-1 0 0 1 62.69291 497.4236 cm
+1 0 0 1 62.69291 440.2236 cm
q
BT 1 0 0 1 0 16.82 Tm .765868 Tw 12 TL /F1 10 Tf 0 0 .501961 rg (plac ) Tj 0 0 0 rg (also recognizes flags, i.e. boolean options which are ) Tj /F4 10 Tf (True ) Tj /F1 10 Tf (if they are passed to the command line) Tj T* 0 Tw (and ) Tj /F4 10 Tf (False ) Tj /F1 10 Tf (if they are absent. Here is an example:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 452.2236 cm
+1 0 0 1 62.69291 395.0236 cm
q
q
1 0 0 1 0 0 cm
@@ -3454,7 +3505,7 @@ Q
Q
Q
q
-1 0 0 1 62.69291 323.0236 cm
+1 0 0 1 62.69291 265.8236 cm
q
q
1 0 0 1 0 0 cm
@@ -3475,31 +3526,48 @@ Q
Q
Q
q
-1 0 0 1 62.69291 279.0236 cm
+1 0 0 1 62.69291 221.8236 cm
q
BT 1 0 0 1 0 28.82 Tm .31408 Tw 12 TL /F1 10 Tf 0 0 0 rg (Notice that it is an error trying to specify a default for flags: the default value for a flag is always ) Tj /F4 10 Tf (False) Tj /F1 10 Tf (. If) Tj T* 0 Tw 2.652485 Tw (you feel the need to implement non-boolean flags, you should use an option with two choices, as) Tj T* 0 Tw (explained in the "more features" section.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 213.0236 cm
+1 0 0 1 62.69291 155.8236 cm
q
BT 1 0 0 1 0 52.82 Tm 5.832651 Tw 12 TL /F1 10 Tf 0 0 0 rg (For consistency with the way the usage message is printed, I suggest you to follow the) Tj T* 0 Tw 1.895433 Tw (Flag-Option-Required-Default \(FORD\) convention: in the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function write first the flag arguments,) Tj T* 0 Tw .881235 Tw (then the option arguments, then the required arguments and finally the default arguments. This is just a) Tj T* 0 Tw .110574 Tw (convention and you are not forced to use it, except for the default arguments \(including the varargs\) which) Tj T* 0 Tw (must stay at the end since it is required by the Python syntax.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 180.0236 cm
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (6) Tj T* -238.1649 0 Td ET
+Q
+Q
+
+endstream
+
+endobj
+% 'R156': class PDFStream
+156 0 obj
+% page stream
+<< /Length 5963 >>
+stream
+1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
+q
+1 0 0 1 62.69291 744.0236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (plac for Python 2.X users) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 126.0236 cm
+1 0 0 1 62.69291 690.0236 cm
q
BT 1 0 0 1 0 40.82 Tm .211807 Tw 12 TL /F1 10 Tf 0 0 0 rg (I do not use Python 3. At work we are just starting to think about migrating to Python 2.6. It will take years) Tj T* 0 Tw 1.269988 Tw (before we even think to migrate to Python 3. I am pretty much sure most Pythonistas are in the same) Tj T* 0 Tw .867318 Tw (situation. Therefore ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (provides a way to work with function annotations even in Python 2.X \(including) Tj T* 0 Tw (Python 2.3\). There is no magic involved; you just need to add the annotations by hand. For instance) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 92.82362 cm
+1 0 0 1 62.69291 656.8236 cm
q
q
1 0 0 1 0 0 cm
@@ -3519,25 +3587,15 @@ Q
Q
Q
Q
-
-endstream
-
-endobj
-% 'R155': class PDFStream
-155 0 obj
-% page stream
-<< /Length 5578 >>
-stream
-1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 753.0236 cm
+1 0 0 1 62.69291 636.8236 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (becomes:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 671.8236 cm
+1 0 0 1 62.69291 555.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -3558,13 +3616,13 @@ Q
Q
Q
q
-1 0 0 1 62.69291 627.8236 cm
+1 0 0 1 62.69291 511.6236 cm
q
BT 1 0 0 1 0 28.82 Tm .412765 Tw 12 TL /F1 10 Tf 0 0 0 rg (One should be careful to much the keys of the annotations dictionary with the names of the arguments in) Tj T* 0 Tw 3.347485 Tw (the annotated function; for lazy people with Python 2.4 available the simplest way is to use the) Tj T* 0 Tw /F4 10 Tf (plac.annotations ) Tj /F1 10 Tf (decorator that performs the check for you.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 546.6236 cm
+1 0 0 1 62.69291 430.4236 cm
q
q
1 0 0 1 0 0 cm
@@ -3585,28 +3643,28 @@ Q
Q
Q
q
-1 0 0 1 62.69291 502.6236 cm
+1 0 0 1 62.69291 386.4236 cm
q
BT 1 0 0 1 0 28.82 Tm 1.422164 Tw 12 TL /F1 10 Tf 0 0 0 rg (In the rest of this article I will assume that you are using Python 2.X with ) Tj /F4 10 Tf (X >) Tj (= 4 ) Tj /F1 10 Tf (and I will use the) Tj T* 0 Tw 1.574983 Tw /F4 10 Tf (plac.annotations ) Tj /F1 10 Tf (decorator. Notice however that the tests for ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (are supposed to run even with) Tj T* 0 Tw (Python 2.3.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 469.6236 cm
+1 0 0 1 62.69291 353.4236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (More features) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 415.6236 cm
+1 0 0 1 62.69291 299.4236 cm
q
BT 1 0 0 1 0 40.82 Tm .115703 Tw 12 TL /F1 10 Tf 0 0 0 rg (One of the goals of plac is to have a learning curve of ) Tj /F5 10 Tf (minutes) Tj /F1 10 Tf (, compared to the learning curve of ) Tj /F5 10 Tf (hours ) Tj /F1 10 Tf (of) Tj T* 0 Tw .412765 Tw 0 0 .501961 rg (argparse) Tj 0 0 0 rg (. That does not mean that I have removed all the features of ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (. Actually a lot of ) Tj 0 0 .501961 rg (argparse) Tj T* 0 Tw .104987 Tw 0 0 0 rg (power persists in ) Tj 0 0 .501961 rg (plac) Tj 0 0 0 rg (. Until now, I have only showed simple annotations, but in general an annotation is a) Tj T* 0 Tw (5-tuple of the form) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 409.6236 cm
+1 0 0 1 62.69291 293.4236 cm
Q
q
-1 0 0 1 62.69291 397.6236 cm
+1 0 0 1 62.69291 281.4236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3621,82 +3679,60 @@ q
Q
Q
q
-1 0 0 1 62.69291 397.6236 cm
+1 0 0 1 62.69291 281.4236 cm
Q
q
-1 0 0 1 62.69291 355.6236 cm
+1 0 0 1 62.69291 239.4236 cm
q
BT 1 0 0 1 0 28.82 Tm 3.38811 Tw 12 TL /F1 10 Tf 0 0 0 rg (where ) Tj /F4 10 Tf (help ) Tj /F1 10 Tf (is the help message, ) Tj /F4 10 Tf (kind ) Tj /F1 10 Tf (is one of {"flag", "option ", "positional"}, ) Tj /F4 10 Tf (abbrev ) Tj /F1 10 Tf (is a) Tj T* 0 Tw 2.203735 Tw (one-character string, ) Tj /F4 10 Tf (type ) Tj /F1 10 Tf (is callable taking a string in input, choices is a sequence of values and) Tj T* 0 Tw /F4 10 Tf (metavar ) Tj /F1 10 Tf (is a string.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 325.6236 cm
+1 0 0 1 62.69291 209.4236 cm
q
BT 1 0 0 1 0 16.82 Tm .006654 Tw 12 TL /F4 10 Tf 0 0 0 rg (type ) Tj /F1 10 Tf (is used to automagically convert the arguments from string to any Python type; by default there is no) Tj T* 0 Tw (convertion i.e. ) Tj /F4 10 Tf (type=None) Tj /F1 10 Tf (.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 295.6236 cm
+1 0 0 1 62.69291 179.4236 cm
q
BT 1 0 0 1 0 16.82 Tm 2.904692 Tw 12 TL /F4 10 Tf 0 0 0 rg (choices ) Tj /F1 10 Tf (is used to restrict the number of the valid options; by default there is no restriction i.e.) Tj T* 0 Tw /F4 10 Tf (choices=None) Tj /F1 10 Tf (.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 253.6236 cm
+1 0 0 1 62.69291 137.4236 cm
q
BT 1 0 0 1 0 28.82 Tm 1.071751 Tw 12 TL /F4 10 Tf 0 0 0 rg (metavar ) Tj /F1 10 Tf (is used to change the argument name in the usage message \(and only there\); by default the) Tj T* 0 Tw .787988 Tw (metavar is equal to the name of the argument, unless the argument has a default and in such a case is) Tj T* 0 Tw (equal to the stringified form of the default.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 235.6236 cm
+1 0 0 1 62.69291 119.4236 cm
q
BT 1 0 0 1 0 4.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (Here is an example showing many of the features \(shamelessly stolen from the ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (documentation\):) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 229.6236 cm
+1 0 0 1 62.69291 113.4236 cm
Q
q
-1 0 0 1 62.69291 76.86614 cm
-0 0 0 rg
-BT /F3 10 Tf 12 TL ET
-BT 1 0 0 1 0 2 Tm T* ET
-q
-1 0 0 1 20 0 cm
-q
-q
-.922464 0 0 .922464 0 0 cm
-q
-1 0 0 1 6.6 7.154749 cm
-q
-.662745 .662745 .662745 RG
-.5 w
-.960784 .960784 .862745 rg
-n -6 -6 480 144 re B*
-Q
+1 0 0 1 56.69291 56.69291 cm
q
0 0 0 rg
-BT 1 0 0 1 0 125.71 Tm /F4 10 Tf 12 TL (# example10.py) Tj T* (import plac) Tj T* T* (@plac.annotations\() Tj T* (operator=\("The name of an operator", 'positional', None, str, ['add', 'mul']\),) Tj T* (numbers=\("A number", 'positional', None, float, None, "n"\)\)) Tj T* (def main\(operator, *numbers\):) Tj T* ( "A script to add and multiply numbers") Tj T* ( op = getattr\(float, '__%s__' % operator\)) Tj T* ( result = dict\(add=0.0, mul=1.0\)[operator]) Tj T* ( for n in numbers:) Tj T* ET
-Q
-Q
-Q
-Q
-Q
-q
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (7) Tj T* -238.1649 0 Td ET
Q
Q
endstream
endobj
-% 'R156': class PDFStream
-156 0 obj
+% 'R157': class PDFStream
+157 0 obj
% page stream
-<< /Length 3966 >>
+<< /Length 4046 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 691.8236 cm
+1 0 0 1 53.6378 575.734 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3704,18 +3740,18 @@ q
1 0 0 1 20 0 cm
q
q
-1 0 0 1 0 0 cm
+.922464 0 0 .922464 0 0 cm
q
-1 0 0 1 6.6 6.6 cm
+1 0 0 1 6.6 7.154749 cm
q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 442.6898 72 re B*
+n -6 -6 480 204 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 53.71 Tm /F4 10 Tf 12 TL ( result = op\(result, n\)) Tj T* ( print\(result\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( plac.call\(main\)) Tj T* ET
+BT 1 0 0 1 0 185.71 Tm /F4 10 Tf 12 TL (# example10.py) Tj T* (import plac) Tj T* T* (@plac.annotations\() Tj T* (operator=\("The name of an operator", 'positional', None, str, ['add', 'mul']\),) Tj T* (numbers=\("A number", 'positional', None, float, None, "n"\)\)) Tj T* (def main\(operator, *numbers\):) Tj T* ( "A script to add and multiply numbers") Tj T* ( op = getattr\(float, '__%s__' % operator\)) Tj T* ( result = dict\(add=0.0, mul=1.0\)[operator]) Tj T* ( for n in numbers:) Tj T* ( result = op\(result, n\)) Tj T* ( print\(result\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( plac.call\(main\)) Tj T* ET
Q
Q
Q
@@ -3725,17 +3761,17 @@ q
Q
Q
q
-1 0 0 1 62.69291 691.8236 cm
+1 0 0 1 62.69291 575.734 cm
Q
q
-1 0 0 1 62.69291 673.8236 cm
+1 0 0 1 62.69291 557.734 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Here is the usage for the script:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 532.6236 cm
+1 0 0 1 62.69291 416.534 cm
q
q
1 0 0 1 0 0 cm
@@ -3756,13 +3792,13 @@ Q
Q
Q
q
-1 0 0 1 62.69291 500.6236 cm
+1 0 0 1 62.69291 384.534 cm
q
BT 1 0 0 1 0 16.82 Tm .15186 Tw 12 TL /F1 10 Tf 0 0 0 rg (Notice that the docstring of the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function has been automatically added to the usage message. Here) Tj T* 0 Tw (are a couple of examples of use:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 407.2849 cm
+1 0 0 1 62.69291 291.1952 cm
q
q
.87797 0 0 .87797 0 0 cm
@@ -3783,22 +3819,22 @@ Q
Q
Q
q
-1 0 0 1 62.69291 374.2849 cm
+1 0 0 1 62.69291 258.1952 cm
q
-BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (A more realistic example) Tj T* ET
+BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (A somewhat realistic example) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 332.2849 cm
+1 0 0 1 62.69291 216.1952 cm
q
BT 1 0 0 1 0 28.82 Tm 1.234488 Tw 12 TL /F1 10 Tf 0 0 0 rg (Here is a more realistic script using most of the features of ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (to run SQL queries on a database by) Tj T* 0 Tw .930697 Tw (relying on ) Tj 0 0 .501961 rg (SQLAlchemy) Tj 0 0 0 rg (. Notice the usage of the ) Tj /F4 10 Tf (type ) Tj /F1 10 Tf (feature to automagically convert a SQLAlchemy) Tj T* 0 Tw (connection string into a ) Tj 0 0 .501961 rg (SqlSoup ) Tj 0 0 0 rg (object:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 326.2849 cm
+1 0 0 1 62.69291 210.1952 cm
Q
q
-1 0 0 1 62.69291 76.86614 cm
+1 0 0 1 62.69291 88.86614 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3813,11 +3849,11 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 442.6898 240 re B*
+n -6 -6 442.6898 108 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 221.71 Tm /F4 10 Tf 12 TL (# dbcli.py) Tj T* (import clap) Tj T* (from sqlalchemy.ext.sqlsoup import SqlSoup) Tj T* T* (@clap.annotations\() Tj T* ( db=\("Connection string", 'positional', None, SqlSoup\),) Tj T* ( header=\("Header", 'flag', 'H'\),) Tj T* ( sqlcmd=\("SQL command", 'option', 'c', str, None, "SQL"\),) Tj T* ( delimiter=\("Column separator", 'option', 'd'\),) Tj T* ( scripts="SQL scripts",) Tj T* ( \)) Tj T* (def main\(db, header, sqlcmd, delimiter="|", *scripts\):) Tj T* ( "A script to run queries and SQL scripts on a database") Tj T* ( print\('Working on %s' % db.bind.url\)) Tj T* ( if sqlcmd:) Tj T* ( result = db.bind.execute\(sqlcmd\)) Tj T* ( if header: # print the header) Tj T* ( print\(delimiter.join\(result.keys\(\)\)\)) Tj T* ( for row in result: # print the rows) Tj T* ET
+BT 1 0 0 1 0 89.71 Tm /F4 10 Tf 12 TL (# dbcli.py) Tj T* (import plac) Tj T* (from sqlalchemy.ext.sqlsoup import SqlSoup) Tj T* T* (@plac.annotations\() Tj T* ( db=\("Connection string", 'positional', None, SqlSoup\),) Tj T* ( header=\("Header", 'flag', 'H'\),) Tj T* ( sqlcmd=\("SQL command", 'option', 'c', str, None, "SQL"\),) Tj T* ET
Q
Q
Q
@@ -3826,18 +3862,25 @@ Q
q
Q
Q
+q
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (8) Tj T* -238.1649 0 Td ET
+Q
+Q
endstream
endobj
-% 'R157': class PDFStream
-157 0 obj
+% 'R158': class PDFStream
+158 0 obj
% page stream
-<< /Length 4959 >>
+<< /Length 4397 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 667.8236 cm
+1 0 0 1 62.69291 535.8236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -3852,11 +3895,11 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 442.6898 96 re B*
+n -6 -6 442.6898 228 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 77.71 Tm /F4 10 Tf 12 TL ( print\(delimiter.join\(map\(str, row\)\)\)) Tj T* T* ( for script in scripts:) Tj T* ( db.bind.execute\(file\(script\).read\(\)\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( clap.call\(main\)) Tj T* ET
+BT 1 0 0 1 0 209.71 Tm /F4 10 Tf 12 TL ( delimiter=\("Column separator", 'option', 'd'\),) Tj T* ( scripts="SQL scripts",) Tj T* ( \)) Tj T* (def main\(db, header, sqlcmd, delimiter="|", *scripts\):) Tj T* ( "A script to run queries and SQL scripts on a database") Tj T* ( print\('Working on %s' % db.bind.url\)) Tj T* ( if sqlcmd:) Tj T* ( result = db.bind.execute\(sqlcmd\)) Tj T* ( if header: # print the header) Tj T* ( print\(delimiter.join\(result.keys\(\)\)\)) Tj T* ( for row in result: # print the rows) Tj T* ( print\(delimiter.join\(map\(str, row\)\)\)) Tj T* T* ( for script in scripts:) Tj T* ( db.bind.execute\(file\(script\).read\(\)\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( plac.call\(main\)) Tj T* ET
Q
Q
Q
@@ -3866,17 +3909,17 @@ q
Q
Q
q
-1 0 0 1 62.69291 667.8236 cm
+1 0 0 1 62.69291 535.8236 cm
Q
q
-1 0 0 1 62.69291 649.8236 cm
+1 0 0 1 62.69291 517.8236 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Here is the usage message:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 460.6236 cm
+1 0 0 1 62.69291 328.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -3897,31 +3940,31 @@ Q
Q
Q
q
-1 0 0 1 62.69291 427.6236 cm
+1 0 0 1 62.69291 295.6236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (A few notes on the underlying implementation) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 397.6236 cm
+1 0 0 1 62.69291 265.6236 cm
q
BT 1 0 0 1 0 16.82 Tm .094988 Tw 12 TL /F1 10 Tf 0 0 .501961 rg (plac ) Tj 0 0 0 rg (relies on a ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (for all of the heavy lifting work and it is possible to leverage on ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (features) Tj T* 0 Tw (directly or indirectly.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 355.6236 cm
+1 0 0 1 62.69291 223.6236 cm
q
-BT 1 0 0 1 0 28.82 Tm 5.575697 Tw 12 TL /F1 10 Tf 0 0 0 rg (For instance, you can make invisible an argument in the usage message simply by using) Tj T* 0 Tw 4.107752 Tw /F4 10 Tf ('==SUPPRESS==`'` as help string \(or ``argparse.SUPPRESS) Tj /F1 10 Tf (\). Similarly, you can use) Tj T* 0 Tw 0 0 .501961 rg (argparse.FileType ) Tj 0 0 0 rg (directly.) Tj T* ET
+BT 1 0 0 1 0 28.82 Tm 5.575697 Tw 12 TL /F1 10 Tf 0 0 0 rg (For instance, you can make invisible an argument in the usage message simply by using) Tj T* 0 Tw 1.435976 Tw /F4 10 Tf ('==SUPPRESS==' ) Tj /F1 10 Tf (as help string \(or ) Tj /F4 10 Tf (argparse.SUPPRESS) Tj /F1 10 Tf (\). Similarly, you can use ) Tj 0 0 .501961 rg (argparse.FileType) Tj T* 0 Tw 0 0 0 rg (directly.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 301.6236 cm
+1 0 0 1 62.69291 169.6236 cm
q
BT 1 0 0 1 0 40.82 Tm 1.639213 Tw 12 TL /F1 10 Tf 0 0 0 rg (It is also possible to pass options to the underlying ) Tj /F4 10 Tf (argparse.ArgumentParser ) Tj /F1 10 Tf (object \(currently it) Tj T* 0 Tw .285529 Tw (accepts the default arguments ) Tj /F4 10 Tf (description) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (epilog) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (prog) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (usage) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (add_help) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (argument_default) Tj /F1 10 Tf (,) Tj T* 0 Tw 1.439953 Tw /F4 10 Tf (parents) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (prefix_chars) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (fromfile_prefix_chars) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (conflict_handler) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (formatter_class) Tj /F1 10 Tf (\). It) Tj T* 0 Tw (is enough to set such attributes on the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function. For instance) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 232.4236 cm
+1 0 0 1 62.69291 100.4236 cm
q
q
1 0 0 1 0 0 cm
@@ -3942,13 +3985,30 @@ Q
Q
Q
q
-1 0 0 1 62.69291 152.4236 cm
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 238.1649 0 Td (9) Tj T* -238.1649 0 Td ET
+Q
+Q
+
+endstream
+
+endobj
+% 'R159': class PDFStream
+159 0 obj
+% page stream
+<< /Length 5808 >>
+stream
+1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
+q
+1 0 0 1 62.69291 693.0236 cm
q
-BT 1 0 0 1 0 64.82 Tm 1.256457 Tw 12 TL /F1 10 Tf 0 0 0 rg (disable the recognition of the help flag ) Tj /F4 10 Tf (-h, --help) Tj /F1 10 Tf (. This is not particularly elegant, but I assume the) Tj T* 0 Tw .274751 Tw (typical user of ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (will be happy with the default message and would not want to go at this level of detail;) Tj T* 0 Tw .230514 Tw (still it is possible if she wants to. For instance, by setting the ) Tj /F4 10 Tf (description ) Tj /F1 10 Tf (attribute, it is possible to add) Tj T* 0 Tw .04332 Tw (a comment to the usage message \(by default the docstring of the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function is used as description\). It) Tj T* 0 Tw .877765 Tw (is also possible to change the option prefix; for instance if your script must run under Windows and you) Tj T* 0 Tw (want to use "/" as option prefix you can add the lines:) Tj T* ET
+BT 1 0 0 1 0 64.82 Tm 1.256457 Tw 12 TL /F1 10 Tf 0 0 0 rg (disable the recognition of the help flag ) Tj /F4 10 Tf (-h, --help) Tj /F1 10 Tf (. This is not particularly elegant, but I assume the) Tj T* 0 Tw .275703 Tw (typical user of ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (will be happy with the defaults and would not want to change them; still it is possible if) Tj T* 0 Tw .365542 Tw (she wants to. For instance, by setting the ) Tj /F4 10 Tf (description ) Tj /F1 10 Tf (attribute, it is possible to add a comment to the) Tj T* 0 Tw .602339 Tw (usage message \(by default the docstring of the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function is used as description\). It is also possible) Tj T* 0 Tw .322988 Tw (to change the option prefix; for instance if your script must run under Windows and you want to use "/" as) Tj T* 0 Tw (option prefix you can add the lines:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 107.2236 cm
+1 0 0 1 62.69291 647.8236 cm
q
q
1 0 0 1 0 0 cm
@@ -3968,30 +4028,20 @@ Q
Q
Q
Q
-
-endstream
-
-endobj
-% 'R158': class PDFStream
-158 0 obj
-% page stream
-<< /Length 4919 >>
-stream
-1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 705.0236 cm
+1 0 0 1 62.69291 579.8236 cm
q
BT 1 0 0 1 0 52.82 Tm 3.694269 Tw 12 TL /F1 10 Tf 0 0 0 rg (The recognition of the ) Tj /F4 10 Tf (short_prefix ) Tj /F1 10 Tf (attribute is a ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (extension; there is also a companion) Tj T* 0 Tw 2.348314 Tw /F4 10 Tf (long_prefix ) Tj /F1 10 Tf (attribute with default value of ) Tj /F4 10 Tf (--) Tj /F1 10 Tf (. ) Tj /F4 10 Tf (prefix_chars ) Tj /F1 10 Tf (is an ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (feature. Interested) Tj T* 0 Tw 1.419984 Tw (readers should read the documentation of ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (to understand the meaning of the other options. If) Tj T* 0 Tw .098935 Tw (there is a set of options that you use very often, you may consider writing a decorator adding such options) Tj T* 0 Tw (to the ) Tj /F4 10 Tf (main ) Tj /F1 10 Tf (function for you. For simplicity, ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (does not perform any magic of that kind.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 675.0236 cm
+1 0 0 1 62.69291 549.8236 cm
q
BT 1 0 0 1 0 16.82 Tm 7.709147 Tw 12 TL /F1 10 Tf 0 0 0 rg (It is possible to access directly the underlying ) Tj 0 0 .501961 rg (ArgumentParser ) Tj 0 0 0 rg (object, by invoking the) Tj T* 0 Tw /F4 10 Tf (plac.parser_from ) Tj /F1 10 Tf (utility function:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 557.8236 cm
+1 0 0 1 62.69291 432.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -4011,35 +4061,35 @@ Q
Q
Q
q
-1 0 0 1 62.69291 537.8236 cm
+1 0 0 1 62.69291 412.6236 cm
q
BT 1 0 0 1 0 4.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (I use ) Tj /F4 10 Tf (plac.parser_from ) Tj /F1 10 Tf (in the unit tests of the module, but regular users should never need to use it.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 504.8236 cm
+1 0 0 1 62.69291 379.6236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (Custom annotation objects) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 474.8236 cm
+1 0 0 1 62.69291 349.6236 cm
q
BT 1 0 0 1 0 16.82 Tm .578651 Tw 12 TL /F1 10 Tf 0 0 0 rg (Internally ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (uses an ) Tj /F4 10 Tf (Annotation ) Tj /F1 10 Tf (class to convert the tuples in the function signature into annotation) Tj T* 0 Tw (objects, i.e. objects with six attributes ) Tj /F4 10 Tf (help, kind, short, type, choices, metavar) Tj /F1 10 Tf (.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 444.8236 cm
+1 0 0 1 62.69291 319.6236 cm
q
0 0 0 rg
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL .083735 Tw (Advanced users can implement their own annotation objects. For instance, here is an example of how you) Tj T* 0 Tw (could implement annotations for positional arguments:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 438.8236 cm
+1 0 0 1 62.69291 313.6236 cm
Q
q
-1 0 0 1 62.69291 317.6236 cm
+1 0 0 1 62.69291 192.4236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -4068,20 +4118,20 @@ q
Q
Q
q
-1 0 0 1 62.69291 317.6236 cm
+1 0 0 1 62.69291 192.4236 cm
Q
q
-1 0 0 1 62.69291 299.6236 cm
+1 0 0 1 62.69291 174.4236 cm
q
0 0 0 rg
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (You can use such annotations objects as follows:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 293.6236 cm
+1 0 0 1 62.69291 168.4236 cm
Q
q
-1 0 0 1 62.69291 124.4236 cm
+1 0 0 1 62.69291 88.86614 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
BT 1 0 0 1 0 2 Tm T* ET
@@ -4096,11 +4146,11 @@ q
.662745 .662745 .662745 RG
.5 w
.960784 .960784 .862745 rg
-n -6 -6 448.6898 168 re B*
+n -6 -6 442.6898 72 re B*
Q
q
0 0 0 rg
-BT 1 0 0 1 0 149.71 Tm /F4 10 Tf 12 TL (# example11.py) Tj T* (import plac) Tj T* (from annotations import Positional) Tj T* T* (@plac.annotations\() Tj T* ( i=Positional\("This is an int", int\),) Tj T* ( n=Positional\("This is a float", float\),) Tj T* ( rest=Positional\("Other arguments"\)\)) Tj T* (def main\(i, n, *rest\):) Tj T* ( print\(i, n, rest\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( import plac; plac.call\(main\)) Tj T* ET
+BT 1 0 0 1 0 53.71 Tm /F4 10 Tf 12 TL (# example11.py) Tj T* (import plac) Tj T* (from annotations import Positional) Tj T* T* (@plac.annotations\() Tj T* ET
Q
Q
Q
@@ -4110,27 +4160,63 @@ q
Q
Q
q
-1 0 0 1 62.69291 124.4236 cm
-Q
-q
-1 0 0 1 62.69291 106.4236 cm
+1 0 0 1 56.69291 56.69291 cm
q
0 0 0 rg
-BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Here is the usage message you get:) Tj T* ET
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 235.3849 0 Td (10) Tj T* -235.3849 0 Td ET
Q
Q
endstream
endobj
-% 'R159': class PDFStream
-159 0 obj
+% 'R160': class PDFStream
+160 0 obj
% page stream
-<< /Length 8190 >>
+<< /Length 7811 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 643.8236 cm
+1 0 0 1 62.69291 655.8236 cm
+0 0 0 rg
+BT /F3 10 Tf 12 TL ET
+BT 1 0 0 1 0 2 Tm T* ET
+q
+1 0 0 1 20 0 cm
+q
+q
+1 0 0 1 0 0 cm
+q
+1 0 0 1 6.6 6.6 cm
+q
+.662745 .662745 .662745 RG
+.5 w
+.960784 .960784 .862745 rg
+n -6 -6 442.6898 108 re B*
+Q
+q
+0 0 0 rg
+BT 1 0 0 1 0 89.71 Tm /F4 10 Tf 12 TL ( i=Positional\("This is an int", int\),) Tj T* ( n=Positional\("This is a float", float\),) Tj T* ( rest=Positional\("Other arguments"\)\)) Tj T* (def main\(i, n, *rest\):) Tj T* ( print\(i, n, rest\)) Tj T* T* (if __name__ == '__main__':) Tj T* ( import plac; plac.call\(main\)) Tj T* ET
+Q
+Q
+Q
+Q
+Q
+q
+Q
+Q
+q
+1 0 0 1 62.69291 655.8236 cm
+Q
+q
+1 0 0 1 62.69291 637.8236 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Here is the usage message you get:) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 508.6236 cm
q
q
1 0 0 1 0 0 cm
@@ -4151,31 +4237,31 @@ Q
Q
Q
q
-1 0 0 1 62.69291 599.8236 cm
+1 0 0 1 62.69291 464.6236 cm
q
BT 1 0 0 1 0 28.82 Tm .713516 Tw 12 TL /F1 10 Tf 0 0 0 rg (You can go on and define ) Tj /F4 10 Tf (Option ) Tj /F1 10 Tf (and ) Tj /F4 10 Tf (Flag ) Tj /F1 10 Tf (classes, if you like. Using custom annotation objects you) Tj T* 0 Tw .17528 Tw (could do advanced things like extracting the annotations from a configuration file or from a database, but I) Tj T* 0 Tw (expect such use cases to be quite rare: the default mechanism should work pretty well for most users.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 566.8236 cm
+1 0 0 1 62.69291 431.6236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (plac vs argparse) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 536.8236 cm
+1 0 0 1 62.69291 401.6236 cm
q
BT 1 0 0 1 0 16.82 Tm 1.677882 Tw 12 TL /F1 10 Tf 0 0 .501961 rg (plac ) Tj 0 0 0 rg (is opinionated and by design it does not try to make available all of the features of ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (. In) Tj T* 0 Tw (particular you should be aware of the following limitations/differences.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 530.8236 cm
+1 0 0 1 62.69291 395.6236 cm
Q
q
-1 0 0 1 62.69291 530.8236 cm
+1 0 0 1 62.69291 395.6236 cm
Q
q
-1 0 0 1 62.69291 476.8236 cm
+1 0 0 1 62.69291 341.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4195,13 +4281,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 476.8236 cm
+1 0 0 1 62.69291 341.6236 cm
Q
q
-1 0 0 1 62.69291 476.8236 cm
+1 0 0 1 62.69291 341.6236 cm
Q
q
-1 0 0 1 62.69291 434.8236 cm
+1 0 0 1 62.69291 299.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4221,13 +4307,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 434.8236 cm
+1 0 0 1 62.69291 299.6236 cm
Q
q
-1 0 0 1 62.69291 434.8236 cm
+1 0 0 1 62.69291 299.6236 cm
Q
q
-1 0 0 1 62.69291 368.8236 cm
+1 0 0 1 62.69291 233.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4247,13 +4333,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 368.8236 cm
+1 0 0 1 62.69291 233.6236 cm
Q
q
-1 0 0 1 62.69291 368.8236 cm
+1 0 0 1 62.69291 233.6236 cm
Q
q
-1 0 0 1 62.69291 326.8236 cm
+1 0 0 1 62.69291 191.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4273,13 +4359,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 326.8236 cm
+1 0 0 1 62.69291 191.6236 cm
Q
q
-1 0 0 1 62.69291 326.8236 cm
+1 0 0 1 62.69291 191.6236 cm
Q
q
-1 0 0 1 62.69291 296.8236 cm
+1 0 0 1 62.69291 161.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4299,13 +4385,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 296.8236 cm
+1 0 0 1 62.69291 161.6236 cm
Q
q
-1 0 0 1 62.69291 296.8236 cm
+1 0 0 1 62.69291 161.6236 cm
Q
q
-1 0 0 1 62.69291 254.8236 cm
+1 0 0 1 62.69291 119.6236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4325,59 +4411,93 @@ q
Q
Q
q
-1 0 0 1 62.69291 254.8236 cm
+1 0 0 1 62.69291 119.6236 cm
Q
q
-1 0 0 1 62.69291 254.8236 cm
+1 0 0 1 62.69291 119.6236 cm
Q
q
-1 0 0 1 62.69291 200.8236 cm
+1 0 0 1 62.69291 89.62362 cm
+0 0 0 rg
+BT /F3 10 Tf 12 TL ET
q
-BT 1 0 0 1 0 40.82 Tm 2.14683 Tw 12 TL /F1 10 Tf 0 0 0 rg (I should stress again that if you want to access all of the ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (features from ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (you can use) Tj T* 0 Tw 2.723059 Tw /F4 10 Tf (plac.parser_from ) Tj /F1 10 Tf (and you will get the underlying ) Tj 0 0 .501961 rg (ArgumentParser ) Tj 0 0 0 rg (object. The the full power of) Tj T* 0 Tw 2.44152 Tw 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (is then available to you: you can use ) Tj /F4 10 Tf (add_argument) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (add_subparsers\(\)) Tj /F1 10 Tf (, etc. In other) Tj T* 0 Tw (words, while some features are not supported directly, ) Tj /F5 10 Tf (all ) Tj /F1 10 Tf (features are supported indirectly.) Tj T* ET
+1 0 0 1 6 15 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
Q
Q
q
-1 0 0 1 62.69291 167.8236 cm
+1 0 0 1 23 3 cm
q
-BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (The future) Tj T* ET
+0 0 0 rg
+BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL 1.745697 Tw (plac does not support the destination concept. In other words, the destination coincides with the) Tj T* 0 Tw (name of the argument, always.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 89.82362 cm
+Q
+Q
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 .351654 Tw (experimental: after all I wrote it in three days, including the tests, the documentation and the time to learn) Tj T* 0 Tw 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
+1 0 0 1 62.69291 89.62362 cm
+Q
+q
+1 0 0 1 62.69291 89.62362 cm
+Q
+q
+1 0 0 1 56.69291 56.69291 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 235.3849 0 Td (11) Tj T* -235.3849 0 Td ET
Q
Q
endstream
endobj
-% 'R160': class PDFStream
-160 0 obj
+% 'R161': class PDFStream
+161 0 obj
% page stream
-<< /Length 3431 >>
+<< /Length 5389 >>
stream
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
q
-1 0 0 1 62.69291 744.0236 cm
+1 0 0 1 62.69291 717.0236 cm
+q
+BT 1 0 0 1 0 40.82 Tm 2.14683 Tw 12 TL /F1 10 Tf 0 0 0 rg (I should stress again that if you want to access all of the ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (features from ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (you can use) Tj T* 0 Tw 2.723059 Tw /F4 10 Tf (plac.parser_from ) Tj /F1 10 Tf (and you will get the underlying ) Tj 0 0 .501961 rg (ArgumentParser ) Tj 0 0 0 rg (object. The the full power of) Tj T* 0 Tw 2.44152 Tw 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (is then available to you: you can use ) Tj /F4 10 Tf (add_argument) Tj /F1 10 Tf (, ) Tj /F4 10 Tf (add_subparsers\(\)) Tj /F1 10 Tf (, etc. In other) Tj T* 0 Tw (words, while some features are not supported directly, ) Tj /F5 10 Tf (all ) Tj /F1 10 Tf (features are supported indirectly.) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 684.0236 cm
+q
+BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (The future) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 606.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 .351654 Tw (experimental: after all I wrote it in three days, including the tests, the documentation and the time to learn) Tj T* 0 Tw 0 0 .501961 rg (argparse) Tj 0 0 0 rg (.) Tj T* ET
+Q
+Q
+q
+1 0 0 1 62.69291 573.0236 cm
q
BT 1 0 0 1 0 8.435 Tm 21 TL /F2 17.5 Tf 0 0 0 rg (Trivia: the story behind the name) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 678.0236 cm
+1 0 0 1 62.69291 507.0236 cm
q
BT 1 0 0 1 0 52.82 Tm .942651 Tw 12 TL /F1 10 Tf 0 0 0 rg (The ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (project started very humble: I just wanted to make easy_installable my old ) Tj 0 0 .501961 rg (optionparse ) Tj 0 0 0 rg (recipe,) Tj T* 0 Tw .565988 Tw (and to publish it on PyPI. The original name of ) Tj 0 0 .501961 rg (plac ) Tj 0 0 0 rg (was optionparser and the idea behind it was to build) Tj T* 0 Tw .603735 Tw (an ) Tj 0 0 .501961 rg (OptionParser ) Tj 0 0 0 rg (object from the docstring of the module. However, before doing that, I decided to check) Tj T* 0 Tw .244198 Tw (out the ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (module, since I knew it was going into Python 2.7 and Python 2.7 was coming out. Soon) Tj T* 0 Tw (enough I realized two things:) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 672.0236 cm
+1 0 0 1 62.69291 501.0236 cm
Q
q
-1 0 0 1 62.69291 672.0236 cm
+1 0 0 1 62.69291 501.0236 cm
Q
q
-1 0 0 1 62.69291 642.0236 cm
+1 0 0 1 62.69291 471.0236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4397,13 +4517,13 @@ q
Q
Q
q
-1 0 0 1 62.69291 642.0236 cm
+1 0 0 1 62.69291 471.0236 cm
Q
q
-1 0 0 1 62.69291 642.0236 cm
+1 0 0 1 62.69291 471.0236 cm
Q
q
-1 0 0 1 62.69291 612.0236 cm
+1 0 0 1 62.69291 441.0236 cm
0 0 0 rg
BT /F3 10 Tf 12 TL ET
q
@@ -4424,136 +4544,143 @@ q
Q
Q
q
-1 0 0 1 62.69291 612.0236 cm
+1 0 0 1 62.69291 441.0236 cm
Q
q
-1 0 0 1 62.69291 612.0236 cm
+1 0 0 1 62.69291 441.0236 cm
Q
q
-1 0 0 1 62.69291 558.0236 cm
+1 0 0 1 62.69291 387.0236 cm
q
BT 1 0 0 1 0 40.82 Tm .600574 Tw 12 TL /F1 10 Tf 0 0 0 rg (Putting together these two observations with the original idea of inferring the parser I decided to build an) Tj T* 0 Tw .516905 Tw 0 0 .501961 rg (ArgumentParser ) Tj 0 0 0 rg (object from function annotations. The ) Tj /F4 10 Tf (optionparser ) Tj /F1 10 Tf (name was ruled out, since I was) Tj T* 0 Tw .122651 Tw (using ) Tj 0 0 .501961 rg (argparse) Tj 0 0 0 rg (; a name like ) Tj /F4 10 Tf (argparse_plus ) Tj /F1 10 Tf (was also ruled out, since the typical usage was completely) Tj T* 0 Tw (different from the ) Tj 0 0 .501961 rg (argparse ) Tj 0 0 0 rg (usage.) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 528.0236 cm
+1 0 0 1 62.69291 357.0236 cm
q
BT 1 0 0 1 0 16.82 Tm 1.093876 Tw 12 TL /F1 10 Tf 0 0 0 rg (I made a research on PyPI and the name clap \(Command Line Arguments Parser\) was not taken, so I) Tj T* 0 Tw (renamed everything to clap. After two days a ) Tj 0 0 .501961 rg (Clap ) Tj 0 0 0 rg (module appeared on PyPI! <) Tj (expletives deleted) Tj (>) Tj T* ET
Q
Q
q
-1 0 0 1 62.69291 498.0236 cm
+1 0 0 1 62.69291 327.0236 cm
+q
+0 0 0 rg
+BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL .128935 Tw (Having little imagination, I decided to rename everything again to plac, as an anagram of clap: since it is a) Tj T* 0 Tw (non-existing English name, I hope nobody will steal it from me!) Tj T* ET
+Q
+Q
+q
+1 0 0 1 56.69291 56.69291 cm
q
0 0 0 rg
-BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL 1.123145 Tw (Having little fantasy, I decided to rename everything again to plac, as an anagram of clap: since it is a) Tj T* 0 Tw (non-existing English name, I hope nobody will steal it from me!) Tj T* ET
+BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 235.3849 0 Td (12) Tj T* -235.3849 0 Td ET
Q
Q
endstream
endobj
-% 'R161': class PDFPageLabels
-161 0 obj
+% 'R162': class PDFPageLabels
+162 0 obj
% Document Root
<< /Nums [ 0
- 162 0 R
- 1
163 0 R
- 2
+ 1
164 0 R
- 3
+ 2
165 0 R
- 4
+ 3
166 0 R
- 5
+ 4
167 0 R
- 6
+ 5
168 0 R
- 7
+ 6
169 0 R
- 8
+ 7
170 0 R
- 9
+ 8
171 0 R
- 10
+ 9
172 0 R
+ 10
+ 173 0 R
11
- 173 0 R ] >>
-endobj
-% 'R162': class PDFPageLabel
-162 0 obj
-% None
-<< /S /D
- /St 1 >>
+ 174 0 R ] >>
endobj
% 'R163': class PDFPageLabel
163 0 obj
% None
<< /S /D
- /St 2 >>
+ /St 1 >>
endobj
% 'R164': class PDFPageLabel
164 0 obj
% None
<< /S /D
- /St 3 >>
+ /St 2 >>
endobj
% 'R165': class PDFPageLabel
165 0 obj
% None
<< /S /D
- /St 4 >>
+ /St 3 >>
endobj
% 'R166': class PDFPageLabel
166 0 obj
% None
<< /S /D
- /St 5 >>
+ /St 4 >>
endobj
% 'R167': class PDFPageLabel
167 0 obj
% None
<< /S /D
- /St 6 >>
+ /St 5 >>
endobj
% 'R168': class PDFPageLabel
168 0 obj
% None
<< /S /D
- /St 7 >>
+ /St 6 >>
endobj
% 'R169': class PDFPageLabel
169 0 obj
% None
<< /S /D
- /St 8 >>
+ /St 7 >>
endobj
% 'R170': class PDFPageLabel
170 0 obj
% None
<< /S /D
- /St 9 >>
+ /St 8 >>
endobj
% 'R171': class PDFPageLabel
171 0 obj
% None
<< /S /D
- /St 10 >>
+ /St 9 >>
endobj
% 'R172': class PDFPageLabel
172 0 obj
% None
<< /S /D
- /St 11 >>
+ /St 10 >>
endobj
% 'R173': class PDFPageLabel
173 0 obj
% None
<< /S /D
+ /St 11 >>
+endobj
+% 'R174': class PDFPageLabel
+174 0 obj
+% None
+<< /S /D
/St 12 >>
endobj
xref
-0 174
+0 175
0000000000 65535 f
0000000113 00000 n
0000000258 00000 n
@@ -4588,154 +4715,155 @@ xref
0000007029 00000 n
0000007272 00000 n
0000007534 00000 n
-0000007798 00000 n
-0000008048 00000 n
-0000008298 00000 n
-0000008550 00000 n
-0000008802 00000 n
-0000009054 00000 n
-0000009304 00000 n
-0000009541 00000 n
-0000010161 00000 n
-0000010427 00000 n
-0000010678 00000 n
-0000010915 00000 n
-0000011110 00000 n
-0000011372 00000 n
-0000011636 00000 n
-0000011871 00000 n
-0000012234 00000 n
-0000012486 00000 n
-0000012738 00000 n
-0000012989 00000 n
-0000013239 00000 n
-0000013491 00000 n
-0000013728 00000 n
-0000014091 00000 n
-0000014343 00000 n
-0000014595 00000 n
-0000014847 00000 n
-0000015135 00000 n
-0000015419 00000 n
-0000015671 00000 n
-0000015944 00000 n
-0000016316 00000 n
-0000016553 00000 n
-0000016871 00000 n
-0000017122 00000 n
-0000017374 00000 n
-0000017626 00000 n
-0000017863 00000 n
-0000018208 00000 n
-0000018460 00000 n
-0000018710 00000 n
-0000018960 00000 n
-0000019210 00000 n
-0000019462 00000 n
-0000019697 00000 n
-0000020060 00000 n
-0000020312 00000 n
-0000020558 00000 n
-0000020820 00000 n
-0000021156 00000 n
-0000021407 00000 n
-0000021657 00000 n
-0000021907 00000 n
+0000007797 00000 n
+0000008047 00000 n
+0000008296 00000 n
+0000008562 00000 n
+0000008814 00000 n
+0000009064 00000 n
+0000009316 00000 n
+0000009566 00000 n
+0000009818 00000 n
+0000010068 00000 n
+0000010305 00000 n
+0000010939 00000 n
+0000011134 00000 n
+0000011396 00000 n
+0000011660 00000 n
+0000011895 00000 n
+0000012231 00000 n
+0000012483 00000 n
+0000012735 00000 n
+0000012986 00000 n
+0000013236 00000 n
+0000013488 00000 n
+0000013725 00000 n
+0000014088 00000 n
+0000014340 00000 n
+0000014592 00000 n
+0000014844 00000 n
+0000015132 00000 n
+0000015416 00000 n
+0000015725 00000 n
+0000015977 00000 n
+0000016250 00000 n
+0000016631 00000 n
+0000016868 00000 n
+0000017186 00000 n
+0000017438 00000 n
+0000017690 00000 n
+0000017927 00000 n
+0000018263 00000 n
+0000018515 00000 n
+0000018767 00000 n
+0000019017 00000 n
+0000019267 00000 n
+0000019517 00000 n
+0000019769 00000 n
+0000020004 00000 n
+0000020376 00000 n
+0000020628 00000 n
+0000020874 00000 n
+0000021136 00000 n
+0000021472 00000 n
+0000021723 00000 n
+0000021973 00000 n
0000022223 00000 n
-0000022460 00000 n
-0000022814 00000 n
-0000023066 00000 n
-0000023315 00000 n
-0000023565 00000 n
-0000023817 00000 n
-0000024104 00000 n
-0000024342 00000 n
-0000024705 00000 n
-0000024956 00000 n
-0000025206 00000 n
-0000025458 00000 n
-0000025722 00000 n
-0000025973 00000 n
-0000026238 00000 n
-0000026491 00000 n
-0000026742 00000 n
-0000026995 00000 n
-0000027246 00000 n
-0000027499 00000 n
-0000027750 00000 n
-0000028002 00000 n
-0000028255 00000 n
-0000028508 00000 n
-0000028761 00000 n
-0000029014 00000 n
-0000029265 00000 n
-0000029517 00000 n
-0000029806 00000 n
-0000030058 00000 n
-0000030310 00000 n
-0000030561 00000 n
-0000030815 00000 n
-0000031052 00000 n
-0000031609 00000 n
-0000031863 00000 n
-0000032150 00000 n
-0000032404 00000 n
-0000032715 00000 n
-0000032967 00000 n
-0000033219 00000 n
-0000033508 00000 n
-0000033760 00000 n
-0000034012 00000 n
-0000034255 00000 n
-0000034652 00000 n
-0000034816 00000 n
-0000035107 00000 n
-0000035236 00000 n
-0000035412 00000 n
-0000035622 00000 n
-0000035830 00000 n
-0000036027 00000 n
-0000036232 00000 n
-0000036425 00000 n
-0000036629 00000 n
-0000036853 00000 n
-0000037058 00000 n
-0000037256 00000 n
-0000037448 00000 n
-0000037631 00000 n
-0000037843 00000 n
-0000046350 00000 n
-0000051930 00000 n
-0000056376 00000 n
-0000061365 00000 n
-0000066240 00000 n
-0000071960 00000 n
-0000077641 00000 n
-0000081710 00000 n
-0000086772 00000 n
-0000091794 00000 n
-0000100087 00000 n
-0000103625 00000 n
-0000103877 00000 n
-0000103956 00000 n
-0000104035 00000 n
-0000104114 00000 n
-0000104193 00000 n
-0000104272 00000 n
-0000104351 00000 n
-0000104430 00000 n
-0000104509 00000 n
-0000104588 00000 n
-0000104668 00000 n
-0000104748 00000 n
+0000022524 00000 n
+0000022869 00000 n
+0000023119 00000 n
+0000023371 00000 n
+0000023620 00000 n
+0000023870 00000 n
+0000024122 00000 n
+0000024409 00000 n
+0000024647 00000 n
+0000025019 00000 n
+0000025270 00000 n
+0000025520 00000 n
+0000025772 00000 n
+0000026037 00000 n
+0000026288 00000 n
+0000026553 00000 n
+0000026806 00000 n
+0000027057 00000 n
+0000027310 00000 n
+0000027561 00000 n
+0000027814 00000 n
+0000028065 00000 n
+0000028317 00000 n
+0000028570 00000 n
+0000028823 00000 n
+0000029076 00000 n
+0000029315 00000 n
+0000029792 00000 n
+0000030043 00000 n
+0000030296 00000 n
+0000030585 00000 n
+0000030837 00000 n
+0000031089 00000 n
+0000031340 00000 n
+0000031594 00000 n
+0000031846 00000 n
+0000032100 00000 n
+0000032387 00000 n
+0000032641 00000 n
+0000032952 00000 n
+0000033204 00000 n
+0000033456 00000 n
+0000033745 00000 n
+0000033997 00000 n
+0000034249 00000 n
+0000034492 00000 n
+0000034969 00000 n
+0000035133 00000 n
+0000035424 00000 n
+0000035553 00000 n
+0000035747 00000 n
+0000035956 00000 n
+0000036164 00000 n
+0000036361 00000 n
+0000036566 00000 n
+0000036759 00000 n
+0000036967 00000 n
+0000037191 00000 n
+0000037396 00000 n
+0000037594 00000 n
+0000037786 00000 n
+0000037969 00000 n
+0000038181 00000 n
+0000046945 00000 n
+0000052192 00000 n
+0000056740 00000 n
+0000061600 00000 n
+0000066529 00000 n
+0000071688 00000 n
+0000077754 00000 n
+0000081903 00000 n
+0000086403 00000 n
+0000092314 00000 n
+0000100228 00000 n
+0000105724 00000 n
+0000105976 00000 n
+0000106055 00000 n
+0000106134 00000 n
+0000106213 00000 n
+0000106292 00000 n
+0000106371 00000 n
+0000106450 00000 n
+0000106529 00000 n
+0000106608 00000 n
+0000106687 00000 n
+0000106767 00000 n
+0000106847 00000 n
trailer
<< /ID
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
- [(\235G:\345\242\327\277\256\202.\210\323e\200\340K) (\235G:\345\242\327\277\256\202.\210\323e\200\340K)]
+ [(hZF\252g\273!\337p\355\225\354w\274\)\242) (hZF\252g\273!\337p\355\225\354w\274\)\242)]
- /Info 134 0 R
- /Root 133 0 R
- /Size 174 >>
+ /Info 135 0 R
+ /Root 134 0 R
+ /Size 175 >>
startxref
-104797
+106896
%%EOF
diff --git a/plac/doc/plac.txt b/plac/doc/plac.txt
index 3432f1d..dcf9c50 100644
--- a/plac/doc/plac.txt
+++ b/plac/doc/plac.txt
@@ -10,75 +10,71 @@ Plac, the Easiest Command Line Arguments Parser in the World
.. contents::
-Introduction
+The importance of scaling down
------------------------------------------------
There is no want of command line arguments parsers in the Python
-world. The standard library alone contains three different modules for
-the parsing of command line options: getopt_ (from the stone age),
+world. The standard library alone contains three different modules:
+getopt_ (from the stone age),
optparse_ (from Python 2.3) and argparse_ (from Python 2.7). All of
them are quite powerful and especially argparse_ is an industrial
strength solution; unfortunately, all of them feature a non-zero learning
curve and a certain verbosity.
-Enters plac_. plac_ is designed to be downwardly scalable, i.e. to
-be trivially simple to use for trivial use cases, and to have a
-next-to-zero learning curve. Technically plac_ is just a simple
-wrapper over argparse_, hiding most of the complexity while retaining
-most of the power. plac_ is surprisingly scalable upwards even for
-non-trivial use cases, but it is not intended to be an industrial
-strength command line parsing module. Its capabilities are limited by
-design. If you need more power, by all means use the parsing modules
-in the standard library. Still, I have been using Python for 8 years
-and never once I had to use the full power of the standard library
-modules.
-
-Actually I am pretty much convinced that features provided by ``plac``
-are more than enough for 99.9% of the typical use cases of a scripter.
-I am targetting here programmers, sys-admins, scientists and in
-general people writing throw-away scripts for themselves, choosing to
-use a command line interface because it is the quick and simple. Such
-users are not interested in features, they just want to be able to
-write a simple command line tool from a simple specification, not to
-build a command line parser by hand. Unfortunately, the current
-modules in the standard library forces them to go the hard way. They
-are designed to implement power user tools for programmers or system
-administrators, and they have a non-trivial learning curve.
-
-The importance of scaling down
-------------------------------------
-
An ex-coworker of mine, David Welton, once wrote a nice article about
-the import<ance of `scaling down`_: most people are concerned with the
+the importance of `scaling down`_: most people are concerned with the
possibility of scaling up, but we should also be concerned with the
-issue of scaling down. In other worlds, simple things should be kept
-simple, and programs should address the common cases in an easy way,
-hopefully without loosing too much power and keeping difficult things
-possible. plac_ adhere as much as possible to this philosophy and it
-is designed to handle well the trivial case, while retaining the
-ability to handle complex cases relying on the underlying power of
-argparse_.
-
-To be concrete, let me start with the simplest possible
-thing: a script that takes a single argument and does something to it.
-It cannot get more trivial than that (discarding the possibility of
-a script without command line arguments, where there is nothing to parse),
-nevertheless it is a use case *extremely common*:
-I need to write scripts like that nearly every day, I wrote hundreds
-of them in the last few years and I have never been happy. Here is
-a typical example of code I have been writing by hand for years:
+issue of scaling down. In other words, programs should address the
+common cases simply, simple things should be kept simple, while at the
+same keeping difficult things possible. plac_ adhere as much as
+possible to this philosophy and it is designed to handle well the
+trivial case, while retaining the ability to handle complex cases
+relying on the underlying power of argparse_.
+
+Technically plac_ is just a simple wrapper over argparse_, hiding most
+of its complexity while retaining most of its power. plac_ is
+surprisingly scalable upwards to non-trivial use cases, even without
+using the underlying argparse_, which however can always be accessed
+if you really need more power. However, I have been using Python for
+8 years and in my experience it is extremely unlikely that you will
+ever need to go beyond the features provided by plac_ directly.
+
+I am pretty much convinced that features provided by ``plac``
+are more than enough for 99.9% of the typical use cases. I am
+targetting here programmers, sys-admins, scientists and in general
+people writing throw-away scripts for themselves, choosing to use a
+command line interface because it is the quick and simple. Such users
+are not interested in features, they are interested in a small
+learning curve: they just want to be able to write a simple command
+line tool from a simple specification, not to build a command line
+parser by hand. Unfortunately, the modules in the standard
+library forces them to go the hard way. They are designed to implement
+power user tools for programmers or system administrators, and they
+have a non-trivial learning curve.
+
+Positional required arguments
+---------------------------------------------
+
+Let me start with the simplest possible thing: a script that takes a
+single argument and does something to it. It cannot get more trivial
+than that (discarding the possibility of a script without command line
+arguments, where there is nothing to parse), nevertheless it is a use
+case *extremely common*: I need to write scripts like that nearly
+every day, I wrote hundreds of them in the last few years and I have
+never been happy. Here is a typical example of code I have been
+writing by hand for years:
.. include:: example1.py
:literal:
As you see the whole ``if __name__ == '__main__'`` block (nine lines) is
essentially boilerplate that should not exists. Actually I think the
-Python language should recognize the main function and perform trivial
-arguments parsing behind the scenes; unfortunaly this is unlikely to
+Python language should recognize the main function and pass to it the
+command line arguments behind the scenes; unfortunaly this is unlikely to
happen. I have been writing boilerplate like this in hundreds of
scripts for years, and every time I *hate* it. The purpose of using a
scripting language is convenience and trivial things should be
-trivial. Unfortunately the standard library modules do not help for
+trivial. Unfortunately the standard library does not help for
this use case, which may be trivial, but it is still incredibly
common. Using getopt_ and optparse_ does not help, since they are
intended to manage options and not positional arguments; the argparse_
@@ -171,7 +167,7 @@ Options and flags
It is surprising how few command line scripts with options I have
written over the years (probably less than a hundred), compared to the
-number of scripts with positional arguments (I certainly have written
+number of scripts with positional arguments I have written (certainly
more than a thousand of them). Still, this use case is quite common
and cannot be neglected. The standard library modules (all of them)
are quite verbose when it comes to specifying the options and frankly
@@ -179,7 +175,7 @@ I have never used them directly. Instead, I have always relied on an
old recipe of mine, the optionparse_ recipe, which provides a
convenient wrapper over optionparse_. Alternatively, in the simplest
cases, I have just performed the parsing by hand, instead of manually
-building a suitable OptionParser.
+building a suitable OptionParser_.
plac_ is inspired to the optionparse_ recipe, in the sense that it
delivers the programmer from the burden of writing the parser, but is
@@ -198,9 +194,9 @@ As you see, the argument ``command`` has been annotated with the
tuple ``("SQL query", 'option', 'c')``: the first string is the
help string which will appear in the usage message, whereas the
second and third strings tell plac_ that ``command`` is an option and that
-it can be abbreviated with the letter ``c``. Of course, it also
-possible to use the long option format, by prefixing the option
-with ``--command=``. The resulting usage message is the following::
+it can be abbreviated with the letter ``c``. Of course, the long option
+format (``--command=``) comes from the argument name.
+The resulting usage message is the following::
$ python3 example8.py -h
usage: example8.py [-h] [-c COMMAND] dsn
@@ -242,7 +238,7 @@ Positional argument can be annotated too::
Of course explicit is better than implicit, an no special cases are
special enough, but sometimes practicality beats purity, so plac_ is
-smart enough to convert help messages into tuples internally; in other
+smart enough to convert help messages into tuples; in other
words, you can just write "Database dsn" instead of ``("Database dsn",
'positional', None)``::
@@ -394,7 +390,7 @@ to the usage message. Here are a couple of examples of use::
usage: example10.py [-h] {add,mul} [n [n ...]]
example10.py: error: argument operator: invalid choice: 'ad' (choose from 'add', 'mul')
-A more realistic example
+A somewhat realistic example
---------------------------------------
Here is a more realistic script using most of the features of plac_ to
@@ -429,7 +425,7 @@ plac_ relies on a argparse_ for all of the heavy lifting work and it is
possible to leverage on argparse_ features directly or indirectly.
For instance, you can make invisible an argument in the usage message
-simply by using ``'==SUPPRESS==`'` as help string (or
+simply by using ``'==SUPPRESS=='`` as help string (or
``argparse.SUPPRESS``). Similarly, you can use argparse.FileType_
directly.
@@ -450,13 +446,13 @@ instance
disable the recognition of the help flag ``-h, --help``. This is not
particularly elegant, but I assume the typical user of plac_ will be
-happy with the default message and would not want to go at this level
-of detail; still it is possible if she wants to. For instance, by
-setting the ``description`` attribute, it is possible to add a comment to the
-usage message (by default the docstring of the ``main`` function is
-used as description). It is also possible to change the option prefix;
-for instance if your script must run under Windows and you want to use
-"/" as option prefix you can add the lines::
+happy with the defaults and would not want to change them; still it is
+possible if she wants to. For instance, by setting the ``description``
+attribute, it is possible to add a comment to the usage message (by
+default the docstring of the ``main`` function is used as
+description). It is also possible to change the option prefix; for
+instance if your script must run under Windows and you want to use "/"
+as option prefix you can add the lines::
main.prefix_chars='-/'
main.short_prefix = '/'
@@ -561,6 +557,10 @@ of the following limitations/differences.
that the ability to define your own annotation objects may mitigate the
need for custom actions.
+- plac does not support the destination concept. In other words, the
+ destination coincides with the name of the argument, always.
+
+
I should stress again that if you want to access all of the argparse_ features
from plac_ you can use ``plac.parser_from`` and you will get
the underlying ArgumentParser_ object. The the full power of argparse_
@@ -606,7 +606,7 @@ I made a research on PyPI and the name clap (Command Line Arguments Parser)
was not taken, so I renamed everything to clap. After two days
a Clap_ module appeared on PyPI! <expletives deleted>
-Having little fantasy, I decided to rename everything again to plac, as
+Having little imagination, I decided to rename everything again to plac, as
an anagram of clap: since it is a non-existing English name, I hope nobody
will steal it from me!