summaryrefslogtreecommitdiff
path: root/doxygen/xml/namespacecmd2.xml
blob: 68be1b085da9e453314479709a9fe0b801916669 (plain)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.7.5.1">
  <compounddef id="namespacecmd2" kind="namespace">
    <compoundname>cmd2</compoundname>
    <innerclass refid="classcmd2_1_1Borg" prot="public">cmd2::Borg</innerclass>
    <innerclass refid="classcmd2_1_1Cmd" prot="public">cmd2::Cmd</innerclass>
    <innerclass refid="classcmd2_1_1Cmd2TestCase" prot="public">cmd2::Cmd2TestCase</innerclass>
    <innerclass refid="classcmd2_1_1EmbeddedConsoleExit" prot="public">cmd2::EmbeddedConsoleExit</innerclass>
    <innerclass refid="classcmd2_1_1EmptyStatement" prot="public">cmd2::EmptyStatement</innerclass>
    <innerclass refid="classcmd2_1_1History" prot="public">cmd2::History</innerclass>
    <innerclass refid="classcmd2_1_1HistoryItem" prot="public">cmd2::HistoryItem</innerclass>
    <innerclass refid="classcmd2_1_1NotSettableError" prot="public">cmd2::NotSettableError</innerclass>
    <innerclass refid="classcmd2_1_1OptionParser" prot="public">cmd2::OptionParser</innerclass>
    <innerclass refid="classcmd2_1_1OutputTrap" prot="public">cmd2::OutputTrap</innerclass>
    <innerclass refid="classcmd2_1_1ParsedString" prot="public">cmd2::ParsedString</innerclass>
    <innerclass refid="classcmd2_1_1PasteBufferError" prot="public">cmd2::PasteBufferError</innerclass>
    <innerclass refid="classcmd2_1_1Statekeeper" prot="public">cmd2::Statekeeper</innerclass>
    <innerclass refid="classcmd2_1_1StubbornDict" prot="public">cmd2::StubbornDict</innerclass>
      <sectiondef kind="var">
      <memberdef kind="variable" id="namespacecmd2_1a05ce8a1645f64208f969036f8621ddd2" prot="public" static="no" mutable="no">
        <type>string</type>
        <definition>string cmd2::__version__</definition>
        <argsstring></argsstring>
        <name>__version__</name>
        <initializer>&apos;0.6.4&apos;</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="45" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="45" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1a3f2a6eb75c58ca830028f18cf2851958" prot="public" static="no" mutable="no">
        <type></type>
        <definition>cmd2::can_clip</definition>
        <argsstring></argsstring>
        <name>can_clip</name>
        <initializer>False</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="202" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="202" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1afd483925db6ff208624b8e5c0ae09271" prot="public" static="no" mutable="no">
        <type>list</type>
        <definition>list cmd2::options_defined</definition>
        <argsstring></argsstring>
        <name>options_defined</name>
        <initializer>[]</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="110" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="110" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1abb901de4eb2987589c68b4d895acd8c3" prot="public" static="no" mutable="no">
        <type>string</type>
        <definition>string cmd2::pastebufferr</definition>
        <argsstring></argsstring>
        <name>pastebufferr</name>
        <initializer>&quot;&quot;&quot;Redirecting to or from paste buffer requires %s
to be installed on operating system.
%s&quot;&quot;&quot;</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="177" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="177" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1ab810fc3f05607c1e4311225b04591244" prot="public" static="no" mutable="no">
        <type>string</type>
        <definition>string cmd2::teststring</definition>
        <argsstring></argsstring>
        <name>teststring</name>
        <initializer>&apos;Testing for presence of xclip.&apos;</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="227" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="227" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1a514a20ceb8ab40dd89d2df2dd5ff87a0" prot="public" static="no" mutable="no">
        <type></type>
        <definition>def cmd2::write_to_paste_buffer</definition>
        <argsstring></argsstring>
        <name>write_to_paste_buffer</name>
        <initializer>get_paste_buffer</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="200" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="200" bodyend="-1"/>
        <referencedby refid="classcmd2_1_1Cmd_1a8b44f9a5a3197613178b4a8fb1804ef7" compoundref="cmd2_8py" startline="830" endline="843">cmd2::Cmd::restore_output</referencedby>
        <referencedby refid="namespacecmd2_1a514a20ceb8ab40dd89d2df2dd5ff87a0" compoundref="cmd2_8py" startline="192" endline="196">write_to_paste_buffer</referencedby>
      </memberdef>
      <memberdef kind="variable" id="namespacecmd2_1ae76e61704924b26b7ddb97fce8c384ef" prot="public" static="no" mutable="no">
        <type>tuple</type>
        <definition>tuple cmd2::xclipproc</definition>
        <argsstring></argsstring>
        <name>xclipproc</name>
        <initializer>subprocess.Popen(&apos;xclip -sel clip&apos;, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="228" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="228" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="namespacecmd2_1a93001003cf51a72d1d6adaf5e3e22366" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::_attr_get_</definition>
        <argsstring></argsstring>
        <name>_attr_get_</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para><verbatim>Returns an attribute&apos;s value, or None (no error) if undefined.
   Analagous to .get() for dictionaries.  Useful when checking for
   value of options that may not have been defined on a given
   method.</verbatim> </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="98" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="98" bodyend="109"/>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a0880940558f324b3958aedfc430f592d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::cast</definition>
        <argsstring></argsstring>
        <name>cast</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para><verbatim>Tries to force a new value into the same type as the current.</verbatim> </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="1412" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="1412" bodyend="1435"/>
        <referencedby refid="classcmd2_1_1Cmd_1a1587bec304ebe93070072d273da9bb31" compoundref="cmd2_8py" startline="1000" endline="1030">cmd2::Cmd::do_set</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a9f1495f6c72f7d8c0dbb0f9f22029763" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::get_paste_buffer</definition>
        <argsstring></argsstring>
        <name>get_paste_buffer</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="184" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="184" bodyend="191"/>
        <referencedby refid="namespacecmd2_1a9f1495f6c72f7d8c0dbb0f9f22029763" compoundref="cmd2_8py" startline="198" endline="199">get_paste_buffer</referencedby>
        <referencedby refid="classcmd2_1_1Cmd_1a46d1bc05e01f5eced432f00c9934db88" compoundref="cmd2_8py" startline="809" endline="829">cmd2::Cmd::redirect_output</referencedby>
        <referencedby refid="namespacecmd2_1aa5aa0c16a66d0ec0510ac38f3cc00ad3" compoundref="cmd2_8py" startline="336" endline="345">replace_with_file_contents</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a9f1495f6c72f7d8c0dbb0f9f22029763" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::get_paste_buffer</definition>
        <argsstring></argsstring>
        <name>get_paste_buffer</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="198" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="198" bodyend="199"/>
        <references refid="namespacecmd2_1a9f1495f6c72f7d8c0dbb0f9f22029763" compoundref="cmd2_8py" startline="184" endline="191">get_paste_buffer</references>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1ad4ac87ba068f9549b5a7735054df8065" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::ljust</definition>
        <argsstring></argsstring>
        <name>ljust</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="352" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="352" bodyend="360"/>
        <referencedby refid="classcmd2_1_1Cmd_1a4816ba13212f079e4b1e865d20041983" compoundref="cmd2_8py" startline="982" endline="999">cmd2::Cmd::do_show</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a863be2c5e3b9fdec03710fd550801c22" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::options</definition>
        <argsstring></argsstring>
        <name>options</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para><verbatim>Used as a decorator and passed a list of optparse-style options,
   alters a cmd2 method to populate its ``opts`` argument from its
   raw text argument.

   Example: transform
   def do_something(self, arg):

   into
   @options([make_option(&apos;-q&apos;, &apos;--quick&apos;, action=&quot;store_true&quot;,
             help=&quot;Makes things fast&quot;)],
             &quot;source dest&quot;)
   def do_something(self, arg, opts):
       if opts.quick:
           self.fast_button = True
   </verbatim> </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="112" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="112" bodyend="161"/>
        <references refid="namespacecmd2_1a11d252497d81548f19771cddf0ca68fb" compoundref="cmd2_8py" startline="86" endline="97">remaining_args</references>
        <referencedby refid="classcmd2_1_1Cmd_1a5ccce52c26063115070d56b6f099223b" compoundref="cmd2_8py" startline="1039" endline="1080">cmd2::Cmd::do_py</referencedby>
        <referencedby refid="classpirate8_1_1Pirate_1a50a1a2e07f16110d9b6808881774878e" compoundref="pirate8_8py" startline="42" endline="43">pirate8::Pirate::do_sing</referencedby>
        <referencedby refid="classcmd2_1_1Cmd_1a28cd403d962038aca658344673a5ab38" compoundref="cmd2_8py" startline="946" endline="979">cmd2::Cmd::select</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a11d252497d81548f19771cddf0ca68fb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::remaining_args</definition>
        <argsstring></argsstring>
        <name>remaining_args</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para><verbatim>
Preserves the spacing originally in the argument after
the removal of options.

&gt;&gt;&gt; remaining_args(&apos;-f bar   bar   cow&apos;, [&apos;bar&apos;, &apos;cow&apos;])
&apos;bar   cow&apos;
</verbatim> </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="86" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="86" bodyend="97"/>
        <referencedby refid="namespacecmd2_1a863be2c5e3b9fdec03710fd550801c22" compoundref="cmd2_8py" startline="112" endline="161">options</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1aa5aa0c16a66d0ec0510ac38f3cc00ad3" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::replace_with_file_contents</definition>
        <argsstring></argsstring>
        <name>replace_with_file_contents</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="336" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="336" bodyend="345"/>
        <references refid="namespacecmd2_1a9f1495f6c72f7d8c0dbb0f9f22029763" compoundref="cmd2_8py" startline="184" endline="191">get_paste_buffer</references>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1aae88fcdb31e45b322ecdaf7df9922823" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::stubbornDict</definition>
        <argsstring></argsstring>
        <name>stubbornDict</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para><verbatim>
&gt;&gt;&gt; sorted(stubbornDict(&apos;cow a bovine\\nhorse an equine&apos;).items())
[(&apos;cow&apos;, &apos;a bovine&apos;), (&apos;horse&apos;, &apos;an equine&apos;)]
&gt;&gt;&gt; sorted(stubbornDict([&apos;badger&apos;, &apos;porcupine a poky creature&apos;]).items())
[(&apos;badger&apos;, &apos;&apos;), (&apos;porcupine&apos;, &apos;a poky creature&apos;)]
&gt;&gt;&gt; sorted(stubbornDict(turtle=&apos;has shell&apos;, frog=&apos;jumpy&apos;).items())
[(&apos;frog&apos;, &apos;jumpy&apos;), (&apos;turtle&apos;, &apos;has shell&apos;)]
</verbatim> </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="321" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="321" bodyend="335"/>
        <referencedby refid="classcmd2_1_1StubbornDict_1a219b3f21c078f3b8158de67beae62da2" compoundref="cmd2_8py" startline="291" endline="294">cmd2::StubbornDict::__add__</referencedby>
        <referencedby refid="classcmd2_1_1StubbornDict_1a190b1b2bd8a914bafaab137c5b1276ea" compoundref="cmd2_8py" startline="295" endline="299">cmd2::StubbornDict::__radd__</referencedby>
      </memberdef>
      <memberdef kind="function" id="namespacecmd2_1a514a20ceb8ab40dd89d2df2dd5ff87a0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>def</type>
        <definition>def cmd2::write_to_paste_buffer</definition>
        <argsstring></argsstring>
        <name>write_to_paste_buffer</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="192" bodyfile="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" bodystart="192" bodyend="196"/>
        <references refid="namespacecmd2_1a514a20ceb8ab40dd89d2df2dd5ff87a0" compoundref="cmd2_8py" startline="200">write_to_paste_buffer</references>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<para><verbatim>Variant on standard library&apos;s cmd with extra features.

To use, simply import cmd2.Cmd instead of cmd.Cmd; use precisely as though you
were using the standard library&apos;s cmd, while enjoying the extra features.

Searchable command history (commands: &quot;hi&quot;, &quot;li&quot;, &quot;run&quot;)
Load commands from file, save to file, edit commands in file
Multi-line commands
Case-insensitive commands
Special-character shortcut commands (beyond cmd&apos;s &quot;@&quot; and &quot;!&quot;)
Settable environment parameters
Optional _onchange_{paramname} called when environment parameter changes
Parsing commands with `optparse` options (flags)
Redirection to file with &gt;, &gt;&gt;; input from file with &lt;
Easy transcript-based testing of applications (see example/example.py)
Bash-style ``select`` available

Note that redirection with &gt; and | will only work if `self.stdout.write()`
is used in place of `print`.  The standard library&apos;s `cmd` module is 
written to use `self.stdout.write()`, 

- Catherine Devlin, Jan 03 2008 - catherinedevlin.blogspot.com

mercurial repository at http://www.assembla.com/wiki/show/python-cmd2
</verbatim> </para>    </detaileddescription>
    <location file="/Users/amrogers/Developer/Projects/cmd2/cmd2.py" line="1"/>
  </compounddef>
</doxygen>