Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
8d2fa4de
Commit
8d2fa4de
authored
Nov 08, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of argument_shift.
parent
ac61e8e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
topydo/lib/Command.py
topydo/lib/Command.py
+2
-13
No files found.
topydo/lib/Command.py
View file @
8d2fa4de
...
...
@@ -28,8 +28,7 @@ class Command(object):
Sets up the basic properties for executing a subcommand.
p_args is a list of arguments that can be passed to this subcommand.
These can be retrieved with argument(), or the existence of an argument
using argument_shift().
These can be retrieved with argument().
p_todolist is a reference to the todolist instance to operate on.
...
...
@@ -55,7 +54,7 @@ class Command(object):
Execute the command. Intercepts the help subsubcommand to show the help
text.
"""
if
self
.
arg
ument_shift
(
"help"
)
:
if
self
.
arg
s
and
self
.
argument
(
0
)
==
"help"
:
self
.
error
(
self
.
usage
()
+
"
\
n
\
n
"
+
self
.
help
())
return
False
...
...
@@ -71,16 +70,6 @@ class Command(object):
return
value
def
argument_shift
(
self
,
p_expr
):
"""
Returns true when the first argument equals the given expression.
"""
if
len
(
self
.
args
)
and
self
.
argument
(
0
)
==
p_expr
:
del
self
.
args
[
0
]
return
True
return
False
def
getopt
(
self
,
p_flags
,
p_long
=
[]):
try
:
result
=
getopt
.
getopt
(
self
.
args
,
p_flags
,
p_long
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment