Commit 9693544b authored by Bram Schoenmakers's avatar Bram Schoenmakers

Merge branch 'master' into sort-context-project

parents fe3328a1 c1a49ede
......@@ -14,11 +14,22 @@ matrix:
- python: "pypy"
- python: "pypy3"
install:
- "python -m pip install pip --upgrade"
- "pip install ."
- "pip install icalendar"
- "pip install pylint"
script: "./run-tests.sh"
- "pip install .[ical]"
- "pip install .[test]"
- "pip install coveralls"
script:
- "green -vvr"
- "python -m pylint --errors-only topydo test"
# Cache Dependencies
after_script:
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then
coveralls;
fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then
coveralls;
fi
cache:
directories:
- $HOME/travis/.cache/pip
......
Main author / maintainer: Bram Schoenmakers (@bram85)
For a list of contributors, please refer to the Contributors page on
[Github](https://github.com/bram85/topydo/graphs/contributors).
0.7
---
* New subcommand: `revert`. Revert the last executed command(s). The number of
revisions can be tuned in the configuration file:
[topydo]
backup_count = 25
* New feature: aliases. Aliases can be defined in the configuration file:
[aliases]
showall = ls -x
(thanks to @mruwek)
* Filter based on priorities (thanks to @mruwek)
ls (A)
ls (<A)
* `ls` has a `-n` flag to limit the number of todo items (similar to the
list_limit option in the configuration file:
ls -n 5
* Prompt mode no longer warns about background modifications to todo.txt when a
read-only command is entered (e.g. `ls`).
* Removed restriction in `edit` mode that requires keeping the same amount of
lines in the todo.txt file.
* `edit` only processes the todo items when edits were actually made in the
editor.
* Bugfix: not all tags were properly hidden with the `hide_tags` configuration
option.
* Better PEP8 compliance (thanks to @MinchinWeb)
* Various test/CI improvements (thanks to @MinchinWeb)
* Support for Python 3.2 removed.
* Many other minor improvements (a.o. thanks to @MinchinWeb)
0.6
---
......@@ -16,7 +54,9 @@
---
* Remove 'ical' subcommand in favor of 'topydo ls -f ical'
* Remove options highlight_projects_colors in favor of colorscheme options. In case you wish to disable the project/context colors, assign an empty value in the configuration file:
* Remove options highlight_projects_colors in favor of colorscheme options. In
case you wish to disable the project/context colors, assign an empty value in
the configuration file:
[colorscheme]
project_color =
......
......@@ -22,7 +22,7 @@ smoothly into topydo.
* Run tests with:
./run-tests.sh [python2|python3]
green
Obviously, I won't accept anything that makes the tests fail. When you submit
a Pull Request, Travis CI will automatically run all tests for various Python
......
topydo
======
[![Build Status](https://travis-ci.org/bram85/topydo.svg?branch=master)](https://travis-ci.org/bram85/topydo) [![Join the chat at https://gitter.im/bram85/topydo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bram85/topydo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=bram85&url=https://github.com/bram85/topydo&title=topydo&language=&tags=github&category=software)
[![Build Status](https://travis-ci.org/bram85/topydo.svg?branch=master)](https://travis-ci.org/bram85/topydo) [![Coverage Status](https://coveralls.io/repos/bram85/topydo/badge.svg?branch=master&service=github)](https://coveralls.io/github/bram85/topydo?branch=master) [![Join the chat at https://gitter.im/bram85/topydo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bram85/topydo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=bram85&url=https://github.com/bram85/topydo&title=topydo&language=&tags=github&category=software)
topydo is a todo list application using the [todo.txt format][1]. It is heavily
inspired by the [todo.txt CLI][2] by Gina Trapani. This tool is actually a
......
#!/bin/bash
if [ "$1" = "python2" ] || [ "$1" = "python3" ]; then
PYTHON=$1
else
# run whatever is active
PYTHON=python
fi
# Run normal tests
if ! $PYTHON setup.py test; then
exit 1
fi
# pylint is not supported on 3.2, so skip the test there
if $PYTHON --version 2>&1 | grep 'Python 3\.2' > /dev/null; then
exit 0
fi
if ! $PYTHON -m pylint --errors-only topydo test; then
exit 1
fi
exit 0
......@@ -34,9 +34,12 @@ setup(
],
extras_require = {
':sys_platform=="win32"': ['colorama>=0.2.5'],
':python_version=="2.7"': ['ushlex'],
'ical': ['icalendar'],
'prompt-toolkit': ['prompt-toolkit >= 0.53'],
'edit-cmd-tests': ['mock'],
'test': ['green', 'coverage'],
'test:python_version=="2.7"': ['mock'],
'test:python_version!="3.2"': ['pylint'],
},
entry_points= {
'console_scripts': ['topydo = topydo.cli.UILoader:main'],
......
......@@ -14,7 +14,7 @@
# 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 test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Utils import escape_ansi
......
......@@ -2,3 +2,4 @@
foo = rm -f test
baz = FooBar
format = ls -F "|I| x c d {(}p{)} s k" -n 25
smile = ls
......@@ -20,7 +20,7 @@ from io import StringIO
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands import AddCommand, ListCommand
from topydo.lib import TodoList
from topydo.lib.Config import config
......
......@@ -16,7 +16,7 @@
import unittest
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.AppendCommand import AppendCommand
from topydo.lib.TodoList import TodoList
......
......@@ -16,8 +16,8 @@
import unittest
from test.CommandTestCase import CommandTest
from test.Facilities import load_file_to_todolist
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
......
......@@ -18,7 +18,7 @@
import unittest
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Colors import NEUTRAL_COLOR, Colors
from topydo.lib.Config import config
......
......@@ -16,7 +16,7 @@
import unittest
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
......
......@@ -18,7 +18,7 @@ import unittest
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.DeleteCommand import DeleteCommand
from topydo.lib.Config import config
from topydo.lib.TodoList import TodoList
......
......@@ -16,7 +16,7 @@
import unittest
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.DepCommand import DepCommand
from topydo.lib.TodoList import TodoList
......
......@@ -18,7 +18,7 @@ import unittest
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.DepriCommand import DepriCommand
from topydo.lib.TodoList import TodoList
......
......@@ -19,7 +19,7 @@ from datetime import date, timedelta
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.DoCommand import DoCommand
from topydo.lib.TodoList import TodoList
......
......@@ -19,7 +19,7 @@ import unittest
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.EditCommand import EditCommand
from topydo.lib.Config import config
from topydo.lib.Todo import Todo
......
......@@ -19,9 +19,9 @@
import unittest
from datetime import date, timedelta
from test.Facilities import (load_file, load_file_to_todolist,
from test.facilities import (load_file, load_file_to_todolist,
todolist_to_string)
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib import Filter
from topydo.lib.Todo import Todo
......
......@@ -18,7 +18,7 @@ import unittest
from six import u
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.Commands import get_subcommand
from topydo.commands.AddCommand import AddCommand
from topydo.commands.DeleteCommand import DeleteCommand
......@@ -54,6 +54,14 @@ class GetSubcommandTest(TopydoTest):
self.assertTrue(issubclass(real_cmd, ListCommand))
self.assertEqual(final_args, ["-F", "|I| x c d {(}p{)} s k", "-n", "25"])
def test_alias03(self):
config("test/data/aliases.conf")
args = ["smile"]
real_cmd, final_args = get_subcommand(args)
self.assertTrue(issubclass(real_cmd, ListCommand))
self.assertEqual(final_args, [u("\u263b")])
def test_default_cmd01(self):
args = ["bar"]
real_cmd, final_args = get_subcommand(args)
......
......@@ -16,7 +16,7 @@
import unittest
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Graph import DirectedGraph
......
......@@ -17,7 +17,7 @@
import unittest
from datetime import date
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from topydo.lib.Importance import importance
from topydo.lib.Todo import Todo
......
......@@ -16,7 +16,7 @@
import unittest
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.JsonPrinter import JsonPrinter
from topydo.lib.Todo import Todo
......
......@@ -20,8 +20,8 @@ import unittest
from six import u
from test.CommandTestCase import CommandTest
from test.Facilities import load_file_to_todolist
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ListCommand import ListCommand
from topydo.lib.Config import config
......
......@@ -16,8 +16,8 @@
import unittest
from test.CommandTestCase import CommandTest
from test.Facilities import load_file_to_todolist
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ListContextCommand import ListContextCommand
......
......@@ -16,8 +16,8 @@
import unittest
from test.CommandTestCase import CommandTest
from test.Facilities import load_file_to_todolist
from test.command_testcase import CommandTest
from test.facilities import load_file_to_todolist
from topydo.commands.ListProjectCommand import ListProjectCommand
......
......@@ -19,7 +19,7 @@ from datetime import date, timedelta
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.PostponeCommand import PostponeCommand
from topydo.lib.TodoList import TodoList
......
......@@ -18,7 +18,7 @@ import unittest
from six import u
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.PriorityCommand import PriorityCommand
from topydo.lib.TodoList import TodoList
......
......@@ -17,7 +17,7 @@
import unittest
from datetime import date, timedelta
from test.TopydoTestCase import TopydoTest
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
......
......@@ -17,7 +17,7 @@
import unittest
from datetime import date, timedelta
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.RelativeDate import relative_date_to_date
......
......@@ -22,7 +22,7 @@ from glob import glob
from six import u
from uuid import uuid4
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.AddCommand import AddCommand
from topydo.commands.ArchiveCommand import ArchiveCommand
from topydo.commands.DeleteCommand import DeleteCommand
......
......@@ -16,8 +16,8 @@
import unittest
from test.CommandTestCase import CommandTest
from test.Facilities import load_file_to_todolist
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
......
......@@ -16,9 +16,9 @@
import unittest
from test.Facilities import (load_file, load_file_to_todolist, print_view,
from test.facilities import (load_file, load_file_to_todolist, print_view,
todolist_to_string)
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from topydo.lib.Sorter import Sorter
......
......@@ -16,7 +16,7 @@
import unittest
from test.CommandTestCase import CommandTest
from test.command_testcase import CommandTest
from topydo.commands.TagCommand import TagCommand
from topydo.lib.TodoList import TodoList
......
......@@ -17,7 +17,7 @@
import unittest
from datetime import date, timedelta
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Todo import Todo
......
......@@ -20,7 +20,7 @@ import re
import unittest
from datetime import date, timedelta
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.TodoBase import TodoBase
......
......@@ -18,8 +18,8 @@ import unittest
from six import u
from test.Facilities import load_file
from test.TopydoTestCase import TopydoTest
from test.facilities import load_file
from test.topydo_testcase import TopydoTest
class TodoFileTest(TopydoTest):
......
......@@ -19,7 +19,7 @@
import re
import unittest
from test.TopydoTestCase import TopydoTest
from test.topydo_testcase import TopydoTest
from topydo.lib.Config import config
from topydo.lib.Todo import Todo
from topydo.lib.TodoFile import TodoFile
......
......@@ -16,8 +16,8 @@
import unittest
from test.Facilities import load_file, print_view, todolist_to_string
from test.TopydoTestCase import TopydoTest
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
......
......@@ -103,7 +103,7 @@ class PromptApplication(CLIApplicationBase):
# refuse to perform operations such as 'del' and 'do' if the
# todo.txt file has been changed in the background.
if not self.is_read_only(subcommand) and self.mtime != mtime_after:
if subcommand and not self.is_read_only(subcommand) and self.mtime != mtime_after:
error("WARNING: todo.txt file was modified by another application.\nTo prevent unintended changes, this operation was not executed.")
continue
......
......@@ -17,9 +17,13 @@
import os
import shlex
from six import iteritems
from six import iteritems, PY2
from six.moves import configparser
if PY2:
import ushlex as shlex
import codecs
class ConfigError(Exception):
def __init__(self, p_text):
self.text = p_text
......@@ -132,7 +136,15 @@ class _Config:
if p_path is not None:
files = [p_path]
self.cp.read(files)
if PY2:
for path in files:
try:
with codecs.open(path, 'r', encoding='utf-8') as f:
self.cp.readfp(f)
except IOError:
pass
else:
self.cp.read(files)
self._supplement_sections()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment