Skip to content

Extract parser methods#110

Merged
tleonhardt merged 6 commits intomasterfrom
extract_parser_methods
May 30, 2017
Merged

Extract parser methods#110
tleonhardt merged 6 commits intomasterfrom
extract_parser_methods

Conversation

@catherinedevlin
Copy link
Copy Markdown
Contributor

Created a ParserManager class to build and store parsers, insulating the main Cmd class from that (still confusing) code.

Comment thread cmd2.py

def _finalize_app_parameters(self):
self.commentGrammars.ignore(pyparsing.quotedString).setParseAction(lambda x: '')
self.shortcuts = sorted(self.shortcuts.items(), reverse=True)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, we might want to add a comment documenting that self.shortcuts starts out as a dictionary, but here we are turning it into a sorted list of tuples, sorted in reverse order by shortcut.

@tleonhardt tleonhardt merged commit bfd5061 into master May 30, 2017
@tleonhardt tleonhardt deleted the extract_parser_methods branch May 30, 2017 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants