2010-03-11 18:53:45 -04:00
|
|
|
#!/usr/bin/env python3
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
"""
|
|
|
|
Test script for the 'cmd' module
|
|
|
|
Original by Michael Schneider
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import cmd
|
|
|
|
import sys
|
2007-12-02 12:50:20 -04:00
|
|
|
import trace
|
|
|
|
import re
|
|
|
|
from io import StringIO
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
class samplecmdclass(cmd.Cmd):
|
|
|
|
"""
|
|
|
|
Instance the sampleclass:
|
|
|
|
>>> mycmd = samplecmdclass()
|
|
|
|
|
|
|
|
Test for the function parseline():
|
|
|
|
>>> mycmd.parseline("")
|
|
|
|
(None, None, '')
|
|
|
|
>>> mycmd.parseline("?")
|
|
|
|
('help', '', 'help ')
|
|
|
|
>>> mycmd.parseline("?help")
|
|
|
|
('help', 'help', 'help help')
|
|
|
|
>>> mycmd.parseline("!")
|
|
|
|
('shell', '', 'shell ')
|
|
|
|
>>> mycmd.parseline("!command")
|
|
|
|
('shell', 'command', 'shell command')
|
|
|
|
>>> mycmd.parseline("func")
|
|
|
|
('func', '', 'func')
|
|
|
|
>>> mycmd.parseline("func arg1")
|
|
|
|
('func', 'arg1', 'func arg1')
|
|
|
|
|
|
|
|
|
|
|
|
Test for the function onecmd():
|
|
|
|
>>> mycmd.onecmd("")
|
|
|
|
>>> mycmd.onecmd("add 4 5")
|
|
|
|
9
|
|
|
|
>>> mycmd.onecmd("")
|
|
|
|
9
|
|
|
|
>>> mycmd.onecmd("test")
|
|
|
|
*** Unknown syntax: test
|
|
|
|
|
|
|
|
Test for the function emptyline():
|
|
|
|
>>> mycmd.emptyline()
|
|
|
|
*** Unknown syntax: test
|
|
|
|
|
|
|
|
Test for the function default():
|
|
|
|
>>> mycmd.default("default")
|
|
|
|
*** Unknown syntax: default
|
|
|
|
|
|
|
|
Test for the function completedefault():
|
|
|
|
>>> mycmd.completedefault()
|
|
|
|
This is the completedefault methode
|
|
|
|
>>> mycmd.completenames("a")
|
|
|
|
['add']
|
|
|
|
|
|
|
|
Test for the function completenames():
|
|
|
|
>>> mycmd.completenames("12")
|
|
|
|
[]
|
|
|
|
>>> mycmd.completenames("help")
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
['help']
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
Test for the function complete_help():
|
|
|
|
>>> mycmd.complete_help("a")
|
|
|
|
['add']
|
|
|
|
>>> mycmd.complete_help("he")
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
['help']
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
>>> mycmd.complete_help("12")
|
|
|
|
[]
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
>>> sorted(mycmd.complete_help(""))
|
|
|
|
['add', 'exit', 'help', 'shell']
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
Test for the function do_help():
|
|
|
|
>>> mycmd.do_help("testet")
|
|
|
|
*** No help on testet
|
|
|
|
>>> mycmd.do_help("add")
|
|
|
|
help text for add
|
|
|
|
>>> mycmd.onecmd("help add")
|
|
|
|
help text for add
|
|
|
|
>>> mycmd.do_help("")
|
|
|
|
<BLANKLINE>
|
|
|
|
Documented commands (type help <topic>):
|
|
|
|
========================================
|
|
|
|
add
|
|
|
|
<BLANKLINE>
|
|
|
|
Undocumented commands:
|
|
|
|
======================
|
|
|
|
exit help shell
|
|
|
|
<BLANKLINE>
|
|
|
|
|
|
|
|
Test for the function print_topics():
|
|
|
|
>>> mycmd.print_topics("header", ["command1", "command2"], 2 ,10)
|
|
|
|
header
|
|
|
|
======
|
|
|
|
command1
|
|
|
|
command2
|
|
|
|
<BLANKLINE>
|
|
|
|
|
|
|
|
Test for the function columnize():
|
2007-12-02 12:50:20 -04:00
|
|
|
>>> mycmd.columnize([str(i) for i in range(20)])
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
2007-12-02 12:50:20 -04:00
|
|
|
>>> mycmd.columnize([str(i) for i in range(20)], 10)
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
0 7 14
|
|
|
|
1 8 15
|
|
|
|
2 9 16
|
|
|
|
3 10 17
|
|
|
|
4 11 18
|
|
|
|
5 12 19
|
|
|
|
6 13
|
|
|
|
|
|
|
|
This is a interactive test, put some commands in the cmdqueue attribute
|
|
|
|
and let it execute
|
|
|
|
This test includes the preloop(), postloop(), default(), emptyline(),
|
|
|
|
parseline(), do_help() functions
|
|
|
|
>>> mycmd.use_rawinput=0
|
|
|
|
>>> mycmd.cmdqueue=["", "add", "add 4 5", "help", "help add","exit"]
|
|
|
|
>>> mycmd.cmdloop()
|
|
|
|
Hello from preloop
|
|
|
|
help text for add
|
|
|
|
*** invalid number of arguments
|
|
|
|
9
|
|
|
|
<BLANKLINE>
|
|
|
|
Documented commands (type help <topic>):
|
|
|
|
========================================
|
|
|
|
add
|
|
|
|
<BLANKLINE>
|
|
|
|
Undocumented commands:
|
|
|
|
======================
|
|
|
|
exit help shell
|
|
|
|
<BLANKLINE>
|
|
|
|
help text for add
|
|
|
|
Hello from postloop
|
|
|
|
"""
|
|
|
|
|
|
|
|
def preloop(self):
|
2007-12-02 12:50:20 -04:00
|
|
|
print("Hello from preloop")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
def postloop(self):
|
2007-12-02 12:50:20 -04:00
|
|
|
print("Hello from postloop")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
def completedefault(self, *ignored):
|
2007-12-02 12:50:20 -04:00
|
|
|
print("This is the completedefault methode")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
def complete_command(self):
|
2007-12-02 12:50:20 -04:00
|
|
|
print("complete command")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
def do_shell(self, s):
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
pass
|
|
|
|
|
|
|
|
def do_add(self, s):
|
|
|
|
l = s.split()
|
|
|
|
if len(l) != 2:
|
2007-12-02 12:50:20 -04:00
|
|
|
print("*** invalid number of arguments")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
return
|
|
|
|
try:
|
|
|
|
l = [int(i) for i in l]
|
|
|
|
except ValueError:
|
2007-12-02 12:50:20 -04:00
|
|
|
print("*** arguments should be numbers")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
return
|
2007-12-02 12:50:20 -04:00
|
|
|
print(l[0]+l[1])
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
def help_add(self):
|
2007-12-02 12:50:20 -04:00
|
|
|
print("help text for add")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
return
|
|
|
|
|
|
|
|
def do_exit(self, arg):
|
|
|
|
return True
|
|
|
|
|
|
|
|
def test_main(verbose=None):
|
2008-05-20 18:35:26 -03:00
|
|
|
from test import support, test_cmd
|
|
|
|
support.run_doctest(test_cmd, verbose)
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
|
|
|
|
def test_coverage(coverdir):
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
import trace
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
|
|
|
|
trace=0, count=1)
|
|
|
|
tracer.run('reload(cmd);test_main()')
|
|
|
|
r=tracer.results()
|
2007-12-02 12:50:20 -04:00
|
|
|
print("Writing coverage results...")
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
r.write_results(show_missing=True, summary=True, coverdir=coverdir)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if "-c" in sys.argv:
|
|
|
|
test_coverage('/tmp/cmd.cover')
|
Merged revisions 77185-77188,77262,77313,77317,77331-77333,77337-77338 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77185 | andrew.kuchling | 2009-12-31 10:17:05 -0600 (Thu, 31 Dec 2009) | 1 line
Add some items
........
r77186 | benjamin.peterson | 2009-12-31 10:28:24 -0600 (Thu, 31 Dec 2009) | 1 line
update expat comment
........
r77187 | andrew.kuchling | 2009-12-31 10:38:53 -0600 (Thu, 31 Dec 2009) | 1 line
Add various items
........
r77188 | benjamin.peterson | 2009-12-31 10:49:37 -0600 (Thu, 31 Dec 2009) | 1 line
add another advancement
........
r77262 | andrew.kuchling | 2010-01-02 19:15:21 -0600 (Sat, 02 Jan 2010) | 1 line
Add a few items
........
r77313 | benjamin.peterson | 2010-01-04 18:04:19 -0600 (Mon, 04 Jan 2010) | 1 line
add a test about hashing array.array
........
r77317 | georg.brandl | 2010-01-05 12:14:52 -0600 (Tue, 05 Jan 2010) | 1 line
Add Stefan.
........
r77331 | georg.brandl | 2010-01-06 11:43:06 -0600 (Wed, 06 Jan 2010) | 1 line
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
........
r77332 | georg.brandl | 2010-01-06 12:02:16 -0600 (Wed, 06 Jan 2010) | 7 lines
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
........
r77333 | georg.brandl | 2010-01-06 12:26:08 -0600 (Wed, 06 Jan 2010) | 1 line
#5950: document that zip files with comments are unsupported in zipimport.
........
r77337 | r.david.murray | 2010-01-06 21:09:08 -0600 (Wed, 06 Jan 2010) | 3 lines
Add -W to the 'basics', 'opt', and 'all' test runs so that we get verbose
information if a failure happens.
........
r77338 | r.david.murray | 2010-01-06 22:04:28 -0600 (Wed, 06 Jan 2010) | 2 lines
Fix inadvertent checkin of debug line.
........
2010-01-09 14:53:06 -04:00
|
|
|
elif "-i" in sys.argv:
|
|
|
|
samplecmdclass().cmdloop()
|
Merged revisions 59259-59274 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59260 | lars.gustaebel | 2007-12-01 22:02:12 +0100 (Sat, 01 Dec 2007) | 5 lines
Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
........
r59262 | georg.brandl | 2007-12-01 23:24:47 +0100 (Sat, 01 Dec 2007) | 4 lines
Document PyEval_* functions from ceval.c.
Credits to Michael Sloan from GHOP.
........
r59263 | georg.brandl | 2007-12-01 23:27:56 +0100 (Sat, 01 Dec 2007) | 2 lines
Add a few refcount data entries.
........
r59264 | georg.brandl | 2007-12-01 23:38:48 +0100 (Sat, 01 Dec 2007) | 4 lines
Add test suite for cmd module.
Written by Michael Schneider for GHOP.
........
r59265 | georg.brandl | 2007-12-01 23:42:46 +0100 (Sat, 01 Dec 2007) | 3 lines
Add examples to the ElementTree documentation.
Written by h4wk.cz for GHOP.
........
r59266 | georg.brandl | 2007-12-02 00:12:45 +0100 (Sun, 02 Dec 2007) | 3 lines
Add "Using Python on Windows" document, by Robert Lehmann.
Written for GHOP.
........
r59271 | georg.brandl | 2007-12-02 15:34:34 +0100 (Sun, 02 Dec 2007) | 3 lines
Add example to mmap docs.
Written for GHOP by Rafal Rawicki.
........
r59272 | georg.brandl | 2007-12-02 15:37:29 +0100 (Sun, 02 Dec 2007) | 2 lines
Convert bdb.rst line endings to Unix style.
........
r59274 | georg.brandl | 2007-12-02 15:58:50 +0100 (Sun, 02 Dec 2007) | 4 lines
Add more entries to the glossary.
Written by Jeff Wheeler for GHOP.
........
2007-12-02 11:22:16 -04:00
|
|
|
else:
|
|
|
|
test_main()
|