Skip to content

Commit

Permalink
Remove Edit action helpers
Browse files Browse the repository at this point in the history
I'm not going to use them in v2 of update
  • Loading branch information
kfsone committed Nov 2, 2014
1 parent 4864852 commit 2d338d5
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions commands/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@
######################################################################
# Parsing Helpers

class EditAction(ArgAction):
"""
argparse action that stores a value and also flags args._editing
"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, "_editing", True)
setattr(namespace, self.dest, values or self.default)


class EditActionStoreTrue(ArgAction):
"""
argparse action that stores True but also flags args._editing
"""
def __init__(self, option_strings, dest, nargs=None, **kwargs):
if nargs is not None:
raise ValueError("nargs not allowed")
super(EditActionStoreTrue, self).__init__(option_strings, dest, nargs=0, **kwargs)

def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, "_editing", True)
setattr(namespace, self.dest, True)


class ParseArgument(object):
"""
Provides argument forwarding so that 'makeSubParser' can take function-like arguments.
Expand Down

0 comments on commit 2d338d5

Please sign in to comment.