-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
186 lines (164 loc) · 8.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<HTML>
<head>
<title>Argparse builder</title>
<link rel="stylesheet" type="text/css" href="resources/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="brython_dist.js"></script>
<script type="text/python3" src="Lib/site-packages/builder.py"></script>
</head>
<body onload="brython(1)">
<h1><code>argparse</code> builder</h1>
<p class="perex">
Python 2.7 <code><a href="https://docs.python.org/2.7/library/argparse.html">argparse</a></code> builder (see <a href="https://github.com/Bystroushaak/argparse_builder">github for sources</a>).
This webpage helps you to quickly create complex <code>argparse</code> interfaces.
Active <a href="./scripts/builder.py">parts</a> of this tool are written in <a href="http://brython.info">brython</a> (python dialect for the web browsers).
</p>
<h2>ArgumentParser object</h2>
<span id="argument_parser">
<fieldset>
<legend><a href="https://docs.python.org/2.7/library/argparse.html#prog">prog</a></legend>
<input type="text" id="ArgumentParser_prog" title="The name of the program. Default sys.argv[0]." _non_str="" _non_key="" _default="">
</fieldset>
<fieldset>
<legend><a href="https://docs.python.org/2.7/library/argparse.html#usage">usage</a></legend>
<input type="text" id="ArgumentParser_usage" title="The string describing the program usage (default: generated from arguments added to parser)." _non_str="" _non_key="" _default="">
</fieldset>
<fieldset>
<legend><a href="https://docs.python.org/2.7/library/argparse.html#description">description</a></legend>
<textarea id="ArgumentParser_description" title="Text to display before the argument help (default: None). It shouldn't be too long - don't mistake this with man page." _non_str="" _non_key="" _default=""></textarea>
</fieldset>
<fieldset>
<legend><a href="https://docs.python.org/2.7/library/argparse.html#epilog">epilog</a></legend>
<textarea id="ArgumentParser_epilog" title="Text to display after the argument help (default: None)." _non_str="" _non_key="" _default=""></textarea>
</fieldset>
<fieldset>
<legend><a href="https://docs.python.org/2.7/library/argparse.html#add-help">add_help</a></legend>
<p>
<input type="checkbox" checked="true" id="ArgumentParser_add_help" _non_str="true" _non_key="" _default="True">
Add a <code>-h</code>/<code>–help</code> option to the parser.
</p>
</fieldset>
</span>
<h2>Arguments</h2>
<span id="arguments">
<table class="argument_table" id="argument_template">
<tr>
<td class="buttons" id="$ID_argument_buttons">
<input id="$ID_argument_button_up" title="Move argument up" type="button" value="↑"><br />
<input id="$ID_argument_button_add" title="Add new argument" type="button" value="+"><br />
<input id="$ID_argument_button_down" title="Move argument down" type="button" value="↓" /><br />
<hr class="remove_button" />
<input id="$ID_argument_button_rm" title="Remove argument" type="button" value="✖">
</td>
<td class="argument">
<table>
<tr>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#name-or-flags">flag</a>:
</span>
<q><input id="$ID_argument_flag" title="Short flag like -h." type="text" _non_str="" _non_key="true" _default=""></q>
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#name-or-flags">name</a>:
</span>
<q><input id="$ID_argument_name" title="Long flag like --help." type="text" _non_str="" _non_key="true" _default=""></q>
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#action">action</a>:
</span>
<select name="action" id="$ID_argument_action" _non_str="" _non_key="" _default="store">
<option value="store" selected="selected">store</option>
<option value="store_const">store_const</option>
<option value="store_true">store_true</option>
<option value="store_false">store_false</option>
<option value="append_const">append_const</option>
<option value="count">count</option>
<option value="help">help</option>
<option value="version">version</option>
</select>
</td>
</tr>
<tr>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#nargs">nargs</a>:
</span>
<input id="$ID_argument_nargs" title="N/?/*/+/argparse.REMAINDER" type="text" _non_str="true" _non_key="" _default="">
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#const">const</a>:
</span>
<input id="$ID_argument_const" title="Constant value for action." type="text" _non_str="true" _non_key="" _default="">
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#default">default</a>:
</span>
<input id="$ID_argument_default" title="Default value. Use quotes for string." type="text" _non_str="true" _non_key="" _default="">
</td>
</tr>
<tr>
<td><span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#type">type</a>:
</span>
<select name="type" id="$ID_argument_type" _non_str="true" _non_key="" _default="str">
<option value="int">int</option>
<option value="float">float</option>
<option value="long">long</option>
<option value="str" selected="selected">str</option>
<option value="custom">Custom</option>
</select>
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#choices">choices</a>:
</span>
<input id="$ID_argument_choices" title="A container of the allowable values for the argument." type="text" _non_str="true" _non_key="" _default="">
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#required">required</a>:
</span>
<input id="$ID_argument_required" type="checkbox" _non_str="true" _non_key="" _default="False">
</td>
</tr>
<tr>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#metavar">metavar</a>:
</span>
<q><input id="$ID_argument_metavar" title="Specify alternative data example in help." type="text" _non_str="" _non_key="" _default=""></q>
</td>
<td>
<span class="descr">
<a href="https://docs.python.org/2.7/library/argparse.html#dest">dest</a>:
</span>
<q><input id="$ID_argument_dest" title="Name of variable in parsed object." type="text" _non_str="" _non_key="" _default=""></q>
</td>
<td></td>
</tr>
</table>
<textarea id="$ID_argument_help" title="Help (a brief description of what the argument does)." _non_str="" _non_key="" _default=""></textarea>
</td>
</tr>
</table>
</span>
<h2>Output</h2>
<p>
<input type="checkbox" checked="true" id="output_use_spaces">
Use spaces for indentation.
</p>
<textarea id="output" title="Click here to get the output." href="https://docs.python.org/2.7/library/argparse.html#metavar">Click here to get output.</textarea>
<div id="black_overlay"></div>
<span id="help_placeholder"></span>
<div id="loading_gears_background">
<div id="loading_gears_foreground">
<img src="resources/gears.gif" />
</div>
</div>
</body>
</HTML>