summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2021-08-21 12:42:45 +0200
committerGravatar √Čtienne Deparis 2021-08-21 12:42:45 +0200
commit8f8e55e1cfa519ac67b8446bded312a572517361 (patch)
tree6ffbda7cb03c55d49ebf7c2318bedaa1a2ca965a
parentd0e446e37d65d2b36454f60008bd8dc461897c7a (diff)
downloadpimtools-wip-org-todo.tar.gz
pimtools-wip-org-todo.tar.xz
pimtools-wip-org-todo.zip
wip: Work on org todowip-org-todo
-rw-r--r--pimtools/parsers/vtodo.py20
-rw-r--r--pimtools/todos.py2
2 files changed, 18 insertions, 4 deletions
diff --git a/pimtools/parsers/vtodo.py b/pimtools/parsers/vtodo.py
index c0eb826..8be9974 100644
--- a/pimtools/parsers/vtodo.py
+++ b/pimtools/parsers/vtodo.py
@@ -35,11 +35,25 @@ class VTodoParser(AbstractParser):
value += "%"
return value
+ def print_org_todo(self):
+ summary = self.get("summary")
+ if summary == "":
+ summary = "N/A"
+ map_status = {
+ "NEEDS-ACTION": "TODO ",
+ "COMPLETED": "DONE "
+ }
+ lines = [
+ "* {todo}{title}".format(
+ todo=map_status[self.get("status")], title=summary
+ )
+ ]
+ return "\n".join(lines)
+
def _format_title(self):
summary = self.get("summary")
if summary == "":
- lines = ["N/A"]
- else:
- lines = [summary]
+ summary = "N/A"
+ lines = [summary]
lines.append("-" * len(lines[0]))
return lines
diff --git a/pimtools/todos.py b/pimtools/todos.py
index 9734854..9949a2c 100644
--- a/pimtools/todos.py
+++ b/pimtools/todos.py
@@ -117,7 +117,7 @@ class Todos:
print(f.read())
def convert_org(self, card):
- print(card.print_org_contact())
+ print(card.print_org_todo())
print()