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
6250df4b
Commit
6250df4b
authored
Dec 26, 2015
by
Jacek Sowiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support backups in column-ui
parent
78850e9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
topydo/cli/CLIApplicationBase.py
topydo/cli/CLIApplicationBase.py
+8
-5
topydo/ui/Main.py
topydo/ui/Main.py
+2
-0
No files found.
topydo/cli/CLIApplicationBase.py
View file @
6250df4b
...
@@ -189,17 +189,20 @@ class CLIApplicationBase(object):
...
@@ -189,17 +189,20 @@ class CLIApplicationBase(object):
READ_ONLY_COMMANDS
)
READ_ONLY_COMMANDS
)
return
p_command
.
__module__
.
endswith
(
read_only_commands
)
return
p_command
.
__module__
.
endswith
(
read_only_commands
)
def
_execute
(
self
,
p_command
,
p_args
):
def
_backup
(
self
,
p_command
,
p_args
):
"""
Execute a subcommand with arguments. p_command is a class (not an
object).
"""
if
config
().
backup_count
()
>
0
and
p_command
and
not
self
.
is_read_only
(
p_command
):
if
config
().
backup_count
()
>
0
and
p_command
and
not
self
.
is_read_only
(
p_command
):
call
=
[
p_command
.
__module__
.
lower
()[
16
:
-
7
]]
+
p_args
# strip "topydo.commands" and "Command"
call
=
[
p_command
.
__module__
.
lower
()[
16
:
-
7
]]
+
p_args
# strip "topydo.commands" and "Command"
from
topydo.lib.ChangeSet
import
ChangeSet
from
topydo.lib.ChangeSet
import
ChangeSet
self
.
backup
=
ChangeSet
(
self
.
todolist
,
p_call
=
call
)
self
.
backup
=
ChangeSet
(
self
.
todolist
,
p_call
=
call
)
def
_execute
(
self
,
p_command
,
p_args
):
"""
Execute a subcommand with arguments. p_command is a class (not an
object).
"""
self
.
_backup
(
p_command
,
p_args
)
command
=
p_command
(
command
=
p_command
(
p_args
,
p_args
,
self
.
todolist
,
self
.
todolist
,
...
...
topydo/ui/Main.py
View file @
6250df4b
...
@@ -125,6 +125,8 @@ class UIApplication(CLIApplicationBase):
...
@@ -125,6 +125,8 @@ class UIApplication(CLIApplicationBase):
p_command
=
shlex
.
split
(
p_command
)
p_command
=
shlex
.
split
(
p_command
)
(
subcommand
,
args
)
=
get_subcommand
(
p_command
)
(
subcommand
,
args
)
=
get_subcommand
(
p_command
)
self
.
_backup
(
subcommand
,
args
)
try
:
try
:
command
=
subcommand
(
command
=
subcommand
(
args
,
args
,
...
...
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