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
c2d6511a
Commit
c2d6511a
authored
Feb 24, 2017
by
Jacek Sowiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Command.name() when looking for read-only cmds
parent
19cca43a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
topydo/ui/CLIApplicationBase.py
topydo/ui/CLIApplicationBase.py
+4
-4
No files found.
topydo/ui/CLIApplicationBase.py
View file @
c2d6511a
...
...
@@ -27,7 +27,7 @@ from topydo.lib.TopydoString import TopydoString
MAIN_OPTS
=
"ac:C:d:ht:v"
MAIN_LONG_OPTS
=
(
'version'
)
READ_ONLY_COMMANDS
=
(
'
List'
,
'ListContext'
,
'ListP
roject'
)
READ_ONLY_COMMANDS
=
(
'
list'
,
'listcontext'
,
'listp
roject'
)
GENERIC_HELP
=
"""Available commands:
...
...
@@ -245,9 +245,9 @@ class CLIApplicationBase(object):
def
is_read_only
(
self
,
p_command
):
""" Returns True when the given command class is read-only. """
read_only_commands
=
tuple
(
cmd
+
'Command'
for
cmd
in
(
'Revert'
,
)
+
READ_ONLY_COMMANDS
)
return
p_command
.
__module__
.
endswith
(
read_only_commands
)
read_only_commands
=
tuple
(
cmd
for
cmd
in
(
'revert'
,
)
+
READ_ONLY_COMMANDS
)
return
p_command
.
name
()
in
read_only_commands
def
_backup
(
self
,
p_command
,
p_args
=
[],
p_label
=
None
):
if
config
().
backup_count
()
>
0
and
p_command
and
not
self
.
is_read_only
(
p_command
):
...
...
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