Skip to content

Commit

Permalink
Merge pull request #55 from MinchinWeb/style
Browse files Browse the repository at this point in the history
Style Changes
  • Loading branch information
bram85 committed Oct 13, 2015
2 parents 1cd3a09 + 8ade0c2 commit 95861af
Show file tree
Hide file tree
Showing 82 changed files with 1,171 additions and 733 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,4 +1,4 @@
*.pyc
*.py[cod]
*.sw?
install
.coverage
Expand All @@ -19,6 +19,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.eggs/

# Sublime Text
*.sublime-*
Expand Down
9 changes: 9 additions & 0 deletions .travis.yml
Expand Up @@ -2,8 +2,17 @@ sudo: false # run on new infrastructure
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "pypy3"
matrix:
allow_failures:
- python: "3.2"
- python: "pypy"
- python: "pypy3"
install:
- "pip install ."
- "pip install icalendar"
Expand Down
10 changes: 3 additions & 7 deletions test/CommandTest.py → test/CommandTestCase.py
@@ -1,5 +1,5 @@
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl>
# Copyright (C) 2014 - 2015 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
Expand All @@ -14,10 +14,9 @@
# 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 unittest

from test.TopydoTestCase import TopydoTest
from topydo.lib.Utils import escape_ansi
from test.TopydoTest import TopydoTest


class CommandTest(TopydoTest):
def __init__(self, *args, **kwargs):
Expand All @@ -32,6 +31,3 @@ def out(self, p_output):
def error(self, p_error):
if p_error:
self.errors += escape_ansi(p_error + "\n")

if __name__ == '__main__':
unittest.main()
7 changes: 6 additions & 1 deletion test/TestFacilities.py → test/Facilities.py
@@ -1,5 +1,5 @@
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl>
# Copyright (C) 2014 - 2015 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
Expand All @@ -19,13 +19,15 @@
from topydo.lib.TodoFile import TodoFile
from topydo.lib.TodoList import TodoList


def load_file(p_filename):
"""
Loads a todo file from the given filename and returns a list of todos.
"""
todolist = load_file_to_raw_list(p_filename)
return [Todo(src) for src in todolist]


def load_file_to_raw_list(p_filename):
"""
Loads a todo file from the given filename and returns a list of todo
Expand All @@ -34,17 +36,20 @@ def load_file_to_raw_list(p_filename):
todofile = TodoFile(p_filename)
return todofile.read()


def load_file_to_todolist(p_filename):
"""
Loads a todo file to a TodoList instance.
"""
todolist = load_file_to_raw_list(p_filename)
return TodoList(todolist)


def todolist_to_string(p_list):
""" Converts a todo list to a single string. """
return '\n'.join([t.source() for t in p_list])


def print_view(p_view):
printer = PrettyPrinter()
return printer.print_list(p_view.todos)

0 comments on commit 95861af

Please sign in to comment.