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
6bba1561
Commit
6bba1561
authored
Oct 26, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move getopt functionality to superclass.
parent
90b16b67
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
lib/Command.py
lib/Command.py
+10
-0
lib/ListCommand.py
lib/ListCommand.py
+1
-6
No files found.
lib/Command.py
View file @
6bba1561
...
...
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
getopt
class
InvalidCommandArgument
(
Exception
):
pass
...
...
@@ -79,6 +81,14 @@ class Command(object):
return
False
def
getopt
(
self
,
p_flags
):
try
:
result
=
getopt
.
getopt
(
self
.
args
,
p_flags
)
except
getopt
.
GetoptError
:
result
=
([],
self
.
args
)
return
result
def
usage
(
self
):
return
"No usage text available for this command."
...
...
lib/ListCommand.py
View file @
6bba1561
...
...
@@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
getopt
import
Command
import
Config
import
Filter
...
...
@@ -32,10 +30,7 @@ class ListCommand(Command.Command):
self
.
show_all
=
False
def
_process_flags
(
self
):
try
:
opts
,
args
=
getopt
.
getopt
(
self
.
args
,
's:x'
)
except
getopt
.
GetoptError
:
return
self
.
args
opts
,
args
=
self
.
getopt
(
's:x'
)
for
o
,
a
in
opts
:
if
o
==
'-x'
:
...
...
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