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
eb6bb6f2
Commit
eb6bb6f2
authored
Nov 21, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add edit subcommand.
parent
b9a346ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
topydo/cli/Main.py
topydo/cli/Main.py
+2
-0
topydo/lib/EditCommand.py
topydo/lib/EditCommand.py
+31
-0
No files found.
topydo/cli/Main.py
View file @
eb6bb6f2
...
@@ -74,6 +74,7 @@ from topydo.lib.DeleteCommand import DeleteCommand
...
@@ -74,6 +74,7 @@ from topydo.lib.DeleteCommand import DeleteCommand
from
topydo.lib.DepCommand
import
DepCommand
from
topydo.lib.DepCommand
import
DepCommand
from
topydo.lib.DepriCommand
import
DepriCommand
from
topydo.lib.DepriCommand
import
DepriCommand
from
topydo.lib.DoCommand
import
DoCommand
from
topydo.lib.DoCommand
import
DoCommand
from
topydo.lib.EditCommand
import
EditCommand
from
topydo.lib.ListCommand
import
ListCommand
from
topydo.lib.ListCommand
import
ListCommand
from
topydo.lib.ListContextCommand
import
ListContextCommand
from
topydo.lib.ListContextCommand
import
ListContextCommand
from
topydo.lib.ListProjectCommand
import
ListProjectCommand
from
topydo.lib.ListProjectCommand
import
ListProjectCommand
...
@@ -173,6 +174,7 @@ class CLIApplication(object):
...
@@ -173,6 +174,7 @@ class CLIApplication(object):
'dep'
:
DepCommand
,
'dep'
:
DepCommand
,
'depri'
:
DepriCommand
,
'depri'
:
DepriCommand
,
'do'
:
DoCommand
,
'do'
:
DoCommand
,
'edit'
:
EditCommand
,
'ls'
:
ListCommand
,
'ls'
:
ListCommand
,
'lscon'
:
ListContextCommand
,
'lscon'
:
ListContextCommand
,
'listcon'
:
ListContextCommand
,
'listcon'
:
ListContextCommand
,
...
...
topydo/lib/EditCommand.py
0 → 100644
View file @
eb6bb6f2
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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
os
from
subprocess
import
call
from
topydo.lib.Command
import
Command
from
topydo.lib.Config
import
config
class
EditCommand
(
Command
):
def
__init__
(
self
,
p_todolist
,
*
p_args
):
super
(
EditCommand
,
self
).
__init__
([],
None
)
def
execute
(
self
):
editor
=
os
.
environ
[
'EDITOR'
]
or
'vi'
todo
=
config
().
todotxt
()
return
call
([
editor
,
todo
])
==
0
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