Commit 3e9f8eef authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add default implementation for printing groups

It will simply gather all todo items in all groups and pass them to
print_list
parent 9a7b6df8
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from itertools import chain
from topydo.lib.prettyprinters.Colors import PrettyPrinterColorFilter from topydo.lib.prettyprinters.Colors import PrettyPrinterColorFilter
from topydo.lib.prettyprinters.Numbers import PrettyPrinterNumbers from topydo.lib.prettyprinters.Numbers import PrettyPrinterNumbers
from topydo.lib.TopydoString import TopydoString from topydo.lib.TopydoString import TopydoString
...@@ -33,6 +35,10 @@ class Printer(object): ...@@ -33,6 +35,10 @@ class Printer(object):
for todo in p_todos: for todo in p_todos:
self.print_todo(todo) self.print_todo(todo)
def print_groups(self, p_groups):
todos = list(chain.from_iterable(p_groups.values()))
return self.print_list(todos)
class PrettyPrinter(Printer): class PrettyPrinter(Printer):
""" """
......
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