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
3a52e9dc
Commit
3a52e9dc
authored
Jul 30, 2017
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sorted import statements
parent
751105ea
Changes
65
Show whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
116 additions
and
105 deletions
+116
-105
.isort.cfg
.isort.cfg
+2
-0
setup.py
setup.py
+2
-2
test/command_testcase.py
test/command_testcase.py
+1
-0
test/test_add_command.py
test/test_add_command.py
+1
-1
test/test_append_command.py
test/test_append_command.py
+1
-1
test/test_archive_command.py
test/test_archive_command.py
+1
-1
test/test_colors.py
test/test_colors.py
+1
-2
test/test_config.py
test/test_config.py
+1
-1
test/test_delete_command.py
test/test_delete_command.py
+1
-1
test/test_dep_command.py
test/test_dep_command.py
+1
-1
test/test_depri_command.py
test/test_depri_command.py
+1
-1
test/test_do_command.py
test/test_do_command.py
+1
-1
test/test_edit_command.py
test/test_edit_command.py
+1
-1
test/test_filter.py
test/test_filter.py
+1
-1
test/test_get_sub_command.py
test/test_get_sub_command.py
+3
-2
test/test_graph.py
test/test_graph.py
+1
-1
test/test_importance.py
test/test_importance.py
+2
-1
test/test_json_printer.py
test/test_json_printer.py
+1
-1
test/test_list_command.py
test/test_list_command.py
+4
-3
test/test_list_context_command.py
test/test_list_context_command.py
+1
-1
test/test_list_format.py
test/test_list_format.py
+3
-3
test/test_list_project_command.py
test/test_list_project_command.py
+1
-1
test/test_postpone_command.py
test/test_postpone_command.py
+1
-1
test/test_priority_command.py
test/test_priority_command.py
+1
-1
test/test_progress_color.py
test/test_progress_color.py
+4
-2
test/test_recurrence.py
test/test_recurrence.py
+1
-1
test/test_relative_date.py
test/test_relative_date.py
+2
-1
test/test_revert_command.py
test/test_revert_command.py
+2
-2
test/test_sort_command.py
test/test_sort_command.py
+1
-1
test/test_sorter.py
test/test_sorter.py
+3
-2
test/test_tag_command.py
test/test_tag_command.py
+3
-2
test/test_todo.py
test/test_todo.py
+1
-1
test/test_todo_base.py
test/test_todo_base.py
+1
-1
test/test_todo_file.py
test/test_todo_file.py
+0
-1
test/test_todo_list.py
test/test_todo_list.py
+1
-1
test/test_utils.py
test/test_utils.py
+1
-1
test/test_view.py
test/test_view.py
+1
-1
topydo/Commands.py
topydo/Commands.py
+1
-1
topydo/commands/AddCommand.py
topydo/commands/AddCommand.py
+1
-1
topydo/commands/AppendCommand.py
topydo/commands/AppendCommand.py
+3
-2
topydo/commands/EditCommand.py
topydo/commands/EditCommand.py
+3
-2
topydo/commands/ListCommand.py
topydo/commands/ListCommand.py
+3
-3
topydo/commands/RevertCommand.py
topydo/commands/RevertCommand.py
+3
-3
topydo/lib/ChangeSet.py
topydo/lib/ChangeSet.py
+1
-1
topydo/lib/Config.py
topydo/lib/Config.py
+2
-2
topydo/lib/DCommand.py
topydo/lib/DCommand.py
+1
-1
topydo/lib/ListFormat.py
topydo/lib/ListFormat.py
+3
-2
topydo/lib/ProgressColor.py
topydo/lib/ProgressColor.py
+0
-1
topydo/lib/Sorter.py
topydo/lib/Sorter.py
+2
-4
topydo/lib/TodoFileWatched.py
topydo/lib/TodoFileWatched.py
+3
-1
topydo/lib/TopydoString.py
topydo/lib/TopydoString.py
+1
-1
topydo/lib/Utils.py
topydo/lib/Utils.py
+2
-3
topydo/lib/prettyprinters/Colors.py
topydo/lib/prettyprinters/Colors.py
+0
-1
topydo/lib/prettyprinters/Format.py
topydo/lib/prettyprinters/Format.py
+1
-1
topydo/lib/prettyprinters/Numbers.py
topydo/lib/prettyprinters/Numbers.py
+0
-1
topydo/ui/CompleterBase.py
topydo/ui/CompleterBase.py
+0
-1
topydo/ui/UILoader.py
topydo/ui/UILoader.py
+1
-1
topydo/ui/cli/CLI.py
topydo/ui/cli/CLI.py
+3
-4
topydo/ui/columns/ColumnLayout.py
topydo/ui/columns/ColumnLayout.py
+2
-2
topydo/ui/columns/CommandLineWidget.py
topydo/ui/columns/CommandLineWidget.py
+2
-2
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+12
-10
topydo/ui/columns/TodoWidget.py
topydo/ui/columns/TodoWidget.py
+1
-1
topydo/ui/columns/ViewWidget.py
topydo/ui/columns/ViewWidget.py
+1
-0
topydo/ui/prompt/Prompt.py
topydo/ui/prompt/Prompt.py
+7
-6
topydo/ui/prompt/PromptCompleter.py
topydo/ui/prompt/PromptCompleter.py
+2
-1
No files found.
.isort.cfg
0 → 100644
View file @
3a52e9dc
[settings]
skip=topydo/ui/CLIApplicationBase.py
setup.py
View file @
3a52e9dc
import
codecs
import
os
import
re
import
codecs
from
setuptools
import
setup
,
find_packages
from
setuptools
import
find_packages
,
setup
_HERE
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
...
...
test/command_testcase.py
View file @
3a52e9dc
...
...
@@ -16,6 +16,7 @@
import
os
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Utils
import
escape_ansi
...
...
test/test_add_command.py
View file @
3a52e9dc
...
...
@@ -17,8 +17,8 @@
import
unittest
from
datetime
import
date
from
io
import
StringIO
from
test.command_testcase
import
CommandTest
from
topydo.commands
import
AddCommand
,
ListCommand
from
topydo.lib
import
TodoList
from
topydo.lib.Config
import
config
...
...
test/test_append_command.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
unittest
from
datetime
import
date
from
test.command_testcase
import
CommandTest
from
topydo.commands.AppendCommand
import
AppendCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_archive_command.py
View file @
3a52e9dc
...
...
@@ -15,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
topydo.commands.ArchiveCommand
import
ArchiveCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_colors.py
View file @
3a52e9dc
...
...
@@ -17,13 +17,12 @@
""" Tests for the colorscheme functionality. """
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Color
import
Color
from
topydo.lib.Config
import
config
from
topydo.lib.Todo
import
Todo
NEUTRAL_COLOR
=
'
\
033
[0m'
...
...
test/test_config.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Config
import
config
...
...
test/test_delete_command.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
topydo.commands.DeleteCommand
import
DeleteCommand
from
topydo.lib.Config
import
config
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_dep_command.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
topydo.commands.DepCommand
import
DepCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_depri_command.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
topydo.commands.DepriCommand
import
DepriCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_do_command.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
unittest
from
datetime
import
date
,
timedelta
from
test.command_testcase
import
CommandTest
from
topydo.commands.DoCommand
import
DoCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_edit_command.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
os
import
unittest
from
test.command_testcase
import
CommandTest
from
topydo.commands.EditCommand
import
EditCommand
from
topydo.lib.Config
import
config
from
topydo.lib.Todo
import
Todo
...
...
test/test_filter.py
View file @
3a52e9dc
...
...
@@ -18,10 +18,10 @@
import
unittest
from
datetime
import
date
,
timedelta
from
test.facilities
import
(
load_file
,
load_file_to_todolist
,
todolist_to_string
)
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib
import
Filter
from
topydo.lib.Todo
import
Todo
...
...
test/test_get_sub_command.py
View file @
3a52e9dc
...
...
@@ -15,14 +15,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.Commands
import
get_subcommand
from
topydo.commands.AddCommand
import
AddCommand
from
topydo.commands.DeleteCommand
import
DeleteCommand
from
topydo.commands.ListCommand
import
ListCommand
from
topydo.commands.TagCommand
import
TagCommand
from
topydo.lib.Config
import
config
,
ConfigError
from
topydo.lib.Config
import
ConfigError
,
config
class
GetSubcommandTest
(
TopydoTest
):
def
test_normal_cmd
(
self
):
...
...
test/test_graph.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Graph
import
DirectedGraph
...
...
test/test_importance.py
View file @
3a52e9dc
...
...
@@ -16,9 +16,10 @@
import
unittest
from
datetime
import
date
from
test.topydo_testcase
import
TopydoTest
from
freezegun
import
freeze_time
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Config
import
config
from
topydo.lib.Importance
import
importance
from
topydo.lib.Todo
import
Todo
...
...
test/test_json_printer.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.printers.Json
import
JsonPrinter
from
topydo.lib.Todo
import
Todo
...
...
test/test_list_command.py
View file @
3a52e9dc
...
...
@@ -15,15 +15,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
codecs
import
re
import
os
import
re
import
sys
import
unittest
from
collections
import
namedtuple
from
freezegun
import
freeze_time
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
freezegun
import
freeze_time
from
topydo.commands.ListCommand
import
ListCommand
from
topydo.lib.Config
import
config
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_list_context_command.py
View file @
3a52e9dc
...
...
@@ -15,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
topydo.commands.ListContextCommand
import
ListContextCommand
...
...
test/test_list_format.py
View file @
3a52e9dc
...
...
@@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
collections
import
namedtuple
from
freezegun
import
freeze_time
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
freezegun
import
freeze_time
from
topydo.commands.ListCommand
import
ListCommand
from
topydo.lib.Config
import
config
from
topydo.lib.TodoListBase
import
TodoListBase
...
...
test/test_list_project_command.py
View file @
3a52e9dc
...
...
@@ -15,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
topydo.commands.ListProjectCommand
import
ListProjectCommand
...
...
test/test_postpone_command.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
unittest
from
datetime
import
date
,
timedelta
from
test.command_testcase
import
CommandTest
from
topydo.commands.PostponeCommand
import
PostponeCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_priority_command.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
topydo.commands.PriorityCommand
import
PriorityCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_progress_color.py
View file @
3a52e9dc
...
...
@@ -14,15 +14,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
freezegun
import
freeze_time
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
freezegun
import
freeze_time
from
topydo.lib.Config
import
config
from
topydo.lib.ProgressColor
import
progress_color
from
topydo.lib.Todo
import
Todo
from
topydo.lib.TodoList
import
TodoList
def
set_256_colors
():
config
(
p_overrides
=
{(
'topydo'
,
'colors'
):
'256'
})
...
...
test/test_recurrence.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
unittest
from
datetime
import
date
,
timedelta
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Config
import
config
from
topydo.lib.Recurrence
import
NoRecurrenceException
,
advance_recurring_todo
from
topydo.lib.Todo
import
Todo
...
...
test/test_relative_date.py
View file @
3a52e9dc
...
...
@@ -16,9 +16,10 @@
import
unittest
from
datetime
import
date
from
test.topydo_testcase
import
TopydoTest
from
freezegun
import
freeze_time
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.RelativeDate
import
relative_date_to_date
...
...
test/test_revert_command.py
View file @
3a52e9dc
...
...
@@ -17,12 +17,11 @@
import
os
import
tempfile
import
unittest
from
datetime
import
date
from
glob
import
glob
from
test.command_testcase
import
CommandTest
from
uuid
import
uuid4
from
test.command_testcase
import
CommandTest
from
topydo.commands.AddCommand
import
AddCommand
from
topydo.commands.ArchiveCommand
import
ArchiveCommand
from
topydo.commands.DeleteCommand
import
DeleteCommand
...
...
@@ -33,6 +32,7 @@ from topydo.lib.Config import config
from
topydo.lib.TodoFile
import
TodoFile
from
topydo.lib.TodoList
import
TodoList
class
RevertCommandTest
(
CommandTest
):
def
setUp
(
self
):
super
().
setUp
()
...
...
test/test_sort_command.py
View file @
3a52e9dc
...
...
@@ -15,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.command_testcase
import
CommandTest
from
test.facilities
import
load_file_to_todolist
from
topydo.commands.SortCommand
import
SortCommand
from
topydo.lib.Config
import
config
...
...
test/test_sorter.py
View file @
3a52e9dc
...
...
@@ -14,12 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
freezegun
import
freeze_time
import
unittest
from
test.facilities
import
(
load_file
,
load_file_to_todolist
,
print_view
,
todolist_to_string
)
from
test.topydo_testcase
import
TopydoTest
from
freezegun
import
freeze_time
from
topydo.lib.Config
import
config
from
topydo.lib.Sorter
import
Sorter
...
...
test/test_tag_command.py
View file @
3a52e9dc
...
...
@@ -14,10 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
freezegun
import
freeze_time
import
unittest
from
test.command_testcase
import
CommandTest
from
freezegun
import
freeze_time
from
topydo.commands.TagCommand
import
TagCommand
from
topydo.lib.TodoList
import
TodoList
...
...
test/test_todo.py
View file @
3a52e9dc
...
...
@@ -16,8 +16,8 @@
import
unittest
from
datetime
import
date
,
timedelta
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Todo
import
Todo
...
...
test/test_todo_base.py
View file @
3a52e9dc
...
...
@@ -19,8 +19,8 @@
import
re
import
unittest
from
datetime
import
date
,
timedelta
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.TodoBase
import
TodoBase
...
...
test/test_todo_file.py
View file @
3a52e9dc
...
...
@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.facilities
import
load_file
from
test.topydo_testcase
import
TopydoTest
...
...
test/test_todo_list.py
View file @
3a52e9dc
...
...
@@ -18,8 +18,8 @@
import
re
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Config
import
config
from
topydo.lib.Todo
import
Todo
from
topydo.lib.TodoFile
import
TodoFile
...
...
test/test_utils.py
View file @
3a52e9dc
...
...
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib.Utils
import
translate_key_to_config
...
...
test/test_view.py
View file @
3a52e9dc
...
...
@@ -15,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
from
test.facilities
import
load_file
,
print_view
,
todolist_to_string
from
test.topydo_testcase
import
TopydoTest
from
topydo.lib
import
Filter
from
topydo.lib.Sorter
import
Sorter
from
topydo.lib.TodoFile
import
TodoFile
...
...
topydo/Commands.py
View file @
3a52e9dc
...
...
@@ -21,7 +21,7 @@ instance based on an argument list.
import
sys
from
topydo.lib.Config
import
config
,
ConfigError
from
topydo.lib.Config
import
ConfigError
,
config
SUBCOMMAND_MAP
=
{
'add'
:
'AddCommand'
,
...
...
topydo/commands/AddCommand.py
View file @
3a52e9dc
...
...
@@ -22,9 +22,9 @@ from datetime import date
from
os.path
import
expanduser
from
sys
import
stdin
from
topydo.lib.WriteCommand
import
WriteCommand
from
topydo.lib.Config
import
config
from
topydo.lib.prettyprinters.Numbers
import
PrettyPrinterNumbers
from
topydo.lib.WriteCommand
import
WriteCommand
class
AddCommand
(
WriteCommand
):
...
...
topydo/commands/AppendCommand.py
View file @
3a52e9dc
...
...
@@ -14,12 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
topydo.lib.Config
import
config
from
topydo.lib.Command
import
InvalidCommandArgument
from
topydo.lib.
WriteCommand
import
WriteCommand
from
topydo.lib.
Config
import
config
from
topydo.lib.prettyprinters.Numbers
import
PrettyPrinterNumbers
from
topydo.lib.TodoListBase
import
InvalidTodoException
from
topydo.lib.TodoParser
import
parse_line
from
topydo.lib.WriteCommand
import
WriteCommand
class
AppendCommand
(
WriteCommand
):
def
__init__
(
self
,
p_args
,
p_todolist
,
#pragma: no branch
...
...
topydo/commands/EditCommand.py
View file @
3a52e9dc
...
...
@@ -14,10 +14,10 @@
# 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
import
codecs
import
tempfile
import
os
import
shlex
import
tempfile
from
subprocess
import
CalledProcessError
,
check_call
from
topydo.lib.Config
import
config
...
...
@@ -25,6 +25,7 @@ from topydo.lib.MultiCommand import MultiCommand
from
topydo.lib.prettyprinters.Numbers
import
PrettyPrinterNumbers
from
topydo.lib.Todo
import
Todo
def
_get_file_mtime
(
p_file
):
return
os
.
stat
(
p_file
.
name
).
st_mtime
...
...
topydo/commands/ListCommand.py
View file @
3a52e9dc
...
...
@@ -14,18 +14,18 @@
# 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
import
re
import
sys
import
os
from
topydo.lib.Config
import
config
from
topydo.lib.ExpressionCommand
import
ExpressionCommand
from
topydo.lib.Filter
import
HiddenTagFilter
,
InstanceFilter
from
topydo.lib.ListFormat
import
ListFormatError
from
topydo.lib.printers.PrettyPrinter
import
pretty_printer_factory
from
topydo.lib.prettyprinters.Format
import
PrettyPrinterFormatFilter
from
topydo.lib.
TodoListBase
import
InvalidTodoException
from
topydo.lib.
printers.PrettyPrinter
import
pretty_printer_factory
from
topydo.lib.Sorter
import
Sorter
from
topydo.lib.TodoListBase
import
InvalidTodoException
from
topydo.lib.Utils
import
get_terminal_size
from
topydo.lib.View
import
View
...
...
topydo/commands/RevertCommand.py
View file @
3a52e9dc
...
...
@@ -14,12 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
topydo.lib
.Command
import
Command
from
topydo.lib
import
TodoFile
,
TodoList
from
topydo.lib.ChangeSet
import
ChangeSet
from
topydo.lib
import
TodoFile
from
topydo.lib
import
TodoList
from
topydo.lib.Command
import
Command
from
topydo.lib.Config
import
config
class
RevertCommand
(
Command
):
def
__init__
(
self
,
p_args
,
p_todolist
,
#pragma: no branch
p_out
=
lambda
a
:
None
,
...
...
topydo/lib/ChangeSet.py
View file @
3a52e9dc
...
...
@@ -19,7 +19,6 @@
import
json
import
time
import
zlib
from
copy
import
deepcopy
from
hashlib
import
sha1
from
os
import
path
...
...
@@ -27,6 +26,7 @@ from os import path
from
topydo.lib.Config
import
config
from
topydo.lib.TodoList
import
TodoList
def
hash_todolist
(
p_todolist
):
""" Calculates hash for TodoList.TodoList object. """
todolist_hash
=
sha1
(
p_todolist
.
print_todos
().
encode
(
'utf-8'
)).
hexdigest
()
...
...
topydo/lib/Config.py
View file @
3a52e9dc
...
...
@@ -15,17 +15,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
configparser
from
functools
import
lru_cache
import
os
import
re
import
shlex
from
collections
import
OrderedDict
from
functools
import
lru_cache
from
itertools
import
accumulate
from
string
import
ascii_lowercase
from
topydo.lib.Color
import
Color
def
home_config_path
(
p_filename
):
return
os
.
path
.
join
(
os
.
path
.
expanduser
(
'~'
),
p_filename
)
...
...
topydo/lib/DCommand.py
View file @
3a52e9dc
...
...
@@ -17,8 +17,8 @@
import
re
from
topydo.lib.MultiCommand
import
MultiCommand
from
topydo.lib.printers.PrettyPrinter
import
PrettyPrinter
from
topydo.lib.prettyprinters.Numbers
import
PrettyPrinterNumbers
from
topydo.lib.printers.PrettyPrinter
import
PrettyPrinter
class
DCommand
(
MultiCommand
):
...
...
topydo/lib/ListFormat.py
View file @
3a52e9dc
...
...
@@ -16,12 +16,13 @@
""" Utilities for formatting output with "list_format" option."""
import
arrow
import
re
import
arrow
from
topydo.lib.Config
import
config
from
topydo.lib.ProgressColor
import
progress_color
from
topydo.lib.Utils
import
get_terminal_size
,
escape_ansi
,
humanize_date
from
topydo.lib.Utils
import
escape_ansi
,
get_terminal_size
,
humanize_date
MAIN_PATTERN
=
(
r'^({{(?P<before>.+?)}})?'
r'(?P<placeholder>{ph}|\
[{ph}
\])'
...
...
topydo/lib/ProgressColor.py
View file @
3a52e9dc
...
...
@@ -20,7 +20,6 @@ from topydo.lib.Color import Color
from
topydo.lib.Config
import
config
from
topydo.lib.Recurrence
import
relative_date_to_date
# when a todo item has not enough information to determine the length, assume
# this length
ASSUMED_TODO_LENGTH
=
14
# days
...
...
topydo/lib/Sorter.py
View file @
3a52e9dc
...
...
@@ -16,16 +16,15 @@
""" This module provides functionality to sort lists with todo items. """
from
collections
import
OrderedDict
,
namedtuple
from
itertools
import
groupby
import
re
from
collections
import
OrderedDict
,
namedtuple
from
datetime
import
date
from
itertools
import
groupby
from
topydo.lib.Config
import
config
from
topydo.lib.Importance
import
average_importance
,
importance
from
topydo.lib.Utils
import
date_string_to_date
,
humanize_date
Field
=
namedtuple
(
'Field'
,
[
'sort'
,
'group'
,
'label'
])
FIELDS
=
{
...
...
@@ -269,4 +268,3 @@ class Sorter(object):
result[key] = self.sort(_group)
return result
topydo/lib/TodoFileWatched.py
View file @
3a52e9dc
...
...
@@ -20,8 +20,10 @@ changes.
"""
import
os.path
from
watchdog.events
import
(
FileCreatedEvent
,
FileModifiedEvent
,
FileSystemEventHandler
)
from
watchdog.observers
import
Observer
from
watchdog.events
import
FileSystemEventHandler
,
FileModifiedEvent
,
FileCreatedEvent
from
topydo.lib.TodoFile
import
TodoFile
...
...
topydo/lib/TopydoString.py
View file @
3a52e9dc
...
...
@@ -18,6 +18,7 @@
import
collections
class
TopydoString
(
collections
.
UserString
):
"""
Represents a string that also contains color information. A combination of
...
...
@@ -50,4 +51,3 @@ class TopydoString(collections.UserString):
def
set_color
(
self
,
p_pos
,
p_color
):
""" Start using a color at the given position. """
self
.
colors
[
p_pos
]
=
p_color
topydo/lib/Utils.py
View file @
3a52e9dc
...
...
@@ -18,12 +18,12 @@
Various utility functions.
"""
import
arrow
import
re
from
collections
import
namedtuple
from
datetime
import
date
import
arrow
def
date_string_to_date
(
p_date
):
"""
...
...
@@ -116,4 +116,3 @@ def humanize_date(p_datetime):
now
=
arrow
.
now
()
date
=
now
.
replace
(
day
=
p_datetime
.
day
,
month
=
p_datetime
.
month
,
year
=
p_datetime
.
year
)
return
date
.
humanize
(
now
).
replace
(
'just now'
,
'today'
)
topydo/lib/prettyprinters/Colors.py
View file @
3a52e9dc
...
...
@@ -56,4 +56,3 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
p_todo_str.append('', AbstractColor.NEUTRAL)
return p_todo_str
topydo/lib/prettyprinters/Format.py
View file @
3a52e9dc
...
...
@@ -19,8 +19,8 @@ Provides a pretty printer filter that generates a todo string based on a format
string.
"""
from
topydo.lib.PrettyPrinterFilter
import
PrettyPrinterFilter
from
topydo.lib.ListFormat
import
ListFormatParser
from
topydo.lib.PrettyPrinterFilter
import
PrettyPrinterFilter
class
PrettyPrinterFormatFilter
(
PrettyPrinterFilter
):
...
...
topydo/lib/prettyprinters/Numbers.py
View file @
3a52e9dc
...
...
@@ -29,4 +29,3 @@ class PrettyPrinterNumbers(PrettyPrinterFilter):
def
filter
(
self
,
p_todo_str
,
p_todo
):
""" Prepends the number to the todo string. """
return
"|{:>3}| {}"
.
format
(
self
.
todolist
.
number
(
p_todo
),
p_todo_str
)
topydo/ui/CompleterBase.py
View file @
3a52e9dc
...
...
@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
datetime
from
functools
import
lru_cache
from
topydo.Commands
import
SUBCOMMAND_MAP
...
...
topydo/ui/UILoader.py
View file @
3a52e9dc
...
...
@@ -20,7 +20,7 @@ import getopt
import
sys
from
topydo.ui.cli.CLI
import
CLIApplication
from
topydo.ui.CLIApplicationBase
import
MAIN_
OPTS
,
MAIN_LONG
_OPTS
,
error
from
topydo.ui.CLIApplicationBase
import
MAIN_
LONG_OPTS
,
MAIN
_OPTS
,
error
# enable color on windows CMD
if
"win32"
in
sys
.
platform
:
...
...
topydo/ui/cli/CLI.py
View file @
3a52e9dc
...
...
@@ -18,9 +18,10 @@
import
sys
from
topydo.Commands
import
get_subcommand
from
topydo.lib
import
TodoFile
,
TodoList
from
topydo.lib.Config
import
ConfigError
,
config
from
topydo.ui.CLIApplicationBase
import
CLIApplicationBase
,
error
from
topydo.lib
import
TodoFile
from
topydo.lib.Config
import
config
,
ConfigError
# First thing is to poke the configuration and check whether it's sane
# The modules below may already read in configuration upon import, so
...
...
@@ -31,8 +32,6 @@ except ConfigError as config_error:
error
(
str
(
config_error
))
sys
.
exit
(
1
)
from
topydo.Commands
import
get_subcommand
from
topydo.lib
import
TodoList
class
CLIApplication
(
CLIApplicationBase
):
...
...
topydo/ui/columns/ColumnLayout.py
View file @
3a52e9dc
...
...
@@ -14,10 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
configparser
import
RawConfigParser
,
NoOptionErro
r
from
configparser
import
NoOptionError
,
RawConfigParse
r
from
os.path
import
expanduser
from
topydo.lib.Config
import
home_config_path
,
config
from
topydo.lib.Config
import
config
,
home_config_path
def
columns
(
p_alt_layout_path
=
None
):
...
...
topydo/ui/columns/CommandLineWidget.py
View file @
3a52e9dc
...
...
@@ -14,10 +14,10 @@
# 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
urwid
from
os.path
import
commonprefix
import
urwid
from
topydo.ui.columns.CompletionBoxWidget
import
CompletionBoxWidget
...
...
topydo/ui/columns/Main.py
View file @
3a52e9dc
...
...
@@ -19,30 +19,32 @@ import getopt
import
shlex
import
sys
import
time
import
urwid
from
collections
import
namedtuple
from
string
import
ascii_uppercase
import
urwid
from
topydo.Commands
import
get_subcommand
from
topydo.lib.Config
import
config
,
ConfigError
from
topydo.ui.columns.ColumnCompleter
import
ColumnCompleter
from
topydo.lib
import
TodoList
from
topydo.lib.Config
import
ConfigError
,
config
from
topydo.lib.Filter
import
(
DependencyFilter
,
HiddenTagFilter
,
RelevanceFilter
,
get_filter_list
)
from
topydo.lib.Sorter
import
Sorter
from
topydo.lib.
Filter
import
get_filter_list
,
RelevanceFilter
,
DependencyFilter
,
HiddenTagFilter
from
topydo.lib.
TodoFileWatched
import
TodoFileWatched
from
topydo.lib.Utils
import
get_terminal_size
from
topydo.lib.View
import
View
from
topydo.lib.TodoFileWatched
import
TodoFileWatched
from
topydo.lib
import
TodoList
from
topydo.ui.CLIApplicationBase
import
CLIApplicationBase
,
error
,
GENERIC_HELP
from
topydo.ui.CLIApplicationBase
import
(
GENERIC_HELP
,
CLIApplicationBase
,
error
)
from
topydo.ui.columns.ColumnCompleter
import
ColumnCompleter
from
topydo.ui.columns.ColumnLayout
import
columns
from
topydo.ui.columns.CommandLineWidget
import
CommandLineWidget
from
topydo.ui.columns.ConsoleWidget
import
ConsoleWidget
from
topydo.ui.columns.KeystateWidget
import
KeystateWidget
from
topydo.ui.columns.TodoWidget
import
TodoWidget
from
topydo.ui.columns.TodoListWidget
import
TodoListWidget
from
topydo.ui.columns.TodoWidget
import
TodoWidget
from
topydo.ui.columns.Transaction
import
Transaction
from
topydo.ui.columns.Utils
import
PaletteItem
,
to_urwid_color
from
topydo.ui.columns.ViewWidget
import
ViewWidget
from
topydo.ui.columns.ColumnLayout
import
columns
class
UIView
(
View
):
...
...
topydo/ui/columns/TodoWidget.py
View file @
3a52e9dc
...
...
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
re
import
urwid
from
topydo.lib.Config
import
config
...
...
@@ -195,4 +196,3 @@ class TodoWidget(urwid.WidgetWrap):
def wipe_cache(p_class):
""" Wipes the cache """
p_class.cache = {}
topydo/ui/columns/ViewWidget.py
View file @
3a52e9dc
...
...
@@ -18,6 +18,7 @@ import urwid
from
topydo.lib.Config
import
config
class
ViewWidget
(
urwid
.
LineBox
):
def
__init__
(
self
,
p_todolist
):
self
.
_todolist
=
p_todolist
...
...
topydo/ui/prompt/Prompt.py
View file @
3a52e9dc
...
...
@@ -19,12 +19,15 @@
import
shlex
import
sys
from
topydo.ui.CLIApplicationBase
import
CLIApplicationBase
,
error
,
GENERIC_HELP
from
topydo.ui.prompt.PromptCompleter
import
PromptCompleter
from
prompt_toolkit.shortcuts
import
prompt
from
prompt_toolkit.history
import
InMemoryHistory
from
prompt_toolkit.shortcuts
import
prompt
from
topydo.lib.Config
import
config
,
ConfigError
from
topydo.Commands
import
get_subcommand
from
topydo.lib.Config
import
ConfigError
,
config
from
topydo.lib.TodoFileWatched
import
TodoFileWatched
from
topydo.ui.CLIApplicationBase
import
(
GENERIC_HELP
,
CLIApplicationBase
,
error
)
from
topydo.ui.prompt.PromptCompleter
import
PromptCompleter
# First thing is to poke the configuration and check whether it's sane
# The modules below may already read in configuration upon import, so
...
...
@@ -35,8 +38,6 @@ except ConfigError as config_error:
error
(
str
(
config_error
))
sys
.
exit
(
1
)
from
topydo.Commands
import
get_subcommand
from
topydo.lib.TodoFileWatched
import
TodoFileWatched
class
PromptApplication
(
CLIApplicationBase
):
...
...
topydo/ui/prompt/PromptCompleter.py
View file @
3a52e9dc
...
...
@@ -22,9 +22,10 @@ by the prompt toolkit.
import
re
from
prompt_toolkit.completion
import
Completer
,
Completion
from
topydo.ui.CompleterBase
import
CompleterBase
,
date_suggestions
from
topydo.lib.Config
import
config
from
topydo.lib.RelativeDate
import
relative_date_to_date
from
topydo.ui.CompleterBase
import
CompleterBase
,
date_suggestions
def
_dates
(
p_word_before_cursor
):
...
...
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