diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-03-29 12:27:46 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-03-29 12:30:17 -0400 |
commit | 2500f39521bf5e5bab3a63468e88699310bad47e (patch) | |
tree | dff0caebe2904bdfe19b5ad5678741d7b2fa1dc9 /cmd2/cmd2.py | |
parent | 070262e1f397e2297cdb1ad611db6b6d5bed8830 (diff) | |
download | cmd2-git-ordered_history.tar.gz |
Changed History to use OrderDict to support Python 3.6 in non-CPython environments.ordered_history
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index c91fb4db..5cd3ec78 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -43,6 +43,7 @@ from code import ( InteractiveConsole, ) from collections import ( + OrderedDict, namedtuple, ) from contextlib import ( @@ -4376,7 +4377,7 @@ class Cmd(cmd.Cmd): for idx, hi in history.items(): self.poutput(hi.pr(idx, script=args.script, expanded=args.expanded, verbose=args.verbose)) - def _get_history(self, args: argparse.Namespace) -> Dict[int, HistoryItem]: + def _get_history(self, args: argparse.Namespace) -> 'OrderedDict[int, HistoryItem]': """If an argument was supplied, then retrieve partial contents of the history; otherwise retrieve entire history. This function returns a dictionary with history items keyed by their 1-based index in ascending order. |