eric6/Tasks/TasksFile.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 8031
ce5858a237d2
child 8218
7c09585bd960
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

8011
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de>
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a class representing the tasks JSON file.
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import json
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import time
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from PyQt5.QtCore import QObject
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from E5Gui import E5MessageBox
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from E5Gui.E5OverrideCursor import E5OverridenCursor
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 from E5Gui.E5Application import e5App
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 import Preferences
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class TasksFile(QObject):
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Class representing the tasks JSON file.
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 def __init__(self, isGlobal: bool, parent: QObject = None):
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param isGlobal flag indicating a file for global tasks
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @type bool
8016
e484fc67677e Corrected some code documentation strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8011
diff changeset
32 @param parent reference to the parent object (defaults to None)
8011
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @type QObject (optional)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 super(TasksFile, self).__init__(parent)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.__isGlobal = isGlobal
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 def writeFile(self, filename: str) -> bool:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 Public method to write the tasks data to a tasks JSON file.
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 @param filename name of the tasks file
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @type str
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 @return flag indicating a successful write
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 @rtype bool
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 """
8017
7ec108389fde TasksFile: did some minir corrections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8016
diff changeset
47 # prepare the tasks data dictionary
8011
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 # step 0: header
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 tasksDict = {}
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 if self.__isGlobal:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 tasksDict["header"] = {
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 "comment": "eric tasks file",
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 "saved": time.strftime('%Y-%m-%d, %H:%M:%S'),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 "warning": (
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 "This file was generated automatically, do not edit."
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 ),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 }
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 # step 1: project scan filter
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 tasksDict["ProjectScanFilter"] = ""
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 # step 2: tasks
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 tasksDict["Tasks"] = [
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 task.toDict()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 for task in e5App().getObject("TaskViewer").getGlobalTasks()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 ]
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 else:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 tasksDict["header"] = {
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 "comment": "eric tasks file for project {0}".format(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 e5App().getObject("Project").getProjectName()),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 "warning": (
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 "This file was generated automatically, do not edit."
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 ),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 }
8031
ce5858a237d2 Changed the Project and MultiProject configuration option "XMLTimestamp" to "TimestampFile". A configuration check is suggested.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8017
diff changeset
74 if Preferences.getProject("TimestampFile"):
8011
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 tasksDict["header"]["saved"] = (
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 time.strftime('%Y-%m-%d, %H:%M:%S')
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 )
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 # step 1: project scan filter
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 tasksDict["ProjectScanFilter"] = (
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 e5App().getObject("TaskViewer").getTasksScanFilter()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 )
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 # step 2: tasks
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 tasksDict["Tasks"] = [
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 task.toDict()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 for task in e5App().getObject("TaskViewer").getProjectTasks()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 ]
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 try:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 jsonString = json.dumps(tasksDict, indent=2)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 with open(filename, "w") as f:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 f.write(jsonString)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 except (TypeError, EnvironmentError) as err:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 with E5OverridenCursor():
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 E5MessageBox.critical(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 None,
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.tr("Save Tasks"),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.tr(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 "<p>The tasks file <b>{0}</b> could not be"
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 " written.</p><p>Reason: {1}</p>"
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 ).format(filename, str(err))
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 )
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 return False
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 return True
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 def readFile(self, filename: str) -> bool:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 Public method to read the tasks data from a task JSON file.
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 @param filename name of the project file
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 @type str
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 @return flag indicating a successful read
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 @rtype bool
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 """
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 try:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 with open(filename, "r") as f:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 jsonString = f.read()
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 tasksDict = json.loads(jsonString)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 except (EnvironmentError, json.JSONDecodeError) as err:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 E5MessageBox.critical(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 None,
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.tr("Read Tasks"),
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.tr(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 "<p>The tasks file <b>{0}</b> could not be read.</p>"
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 "<p>Reason: {1}</p>"
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 ).format(filename, str(err))
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 )
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 return False
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 viewer = e5App().getObject("TaskViewer")
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 if tasksDict["ProjectScanFilter"]:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 viewer.setTasksScanFilter(tasksDict["ProjectScanFilter"])
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 addedTasks = []
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 for task in tasksDict["Tasks"]:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 addedTask = viewer.addTask(
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 task["summary"], priority=task["priority"],
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 filename=task["filename"], lineno=task["lineno"],
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 completed=task["completed"], _time=task["created"],
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 isProjectTask=not self.__isGlobal, taskType=task["type"],
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 description=task["description"], uid=task["uid"],
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 parentTask=task["parent_uid"])
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 addedTasks.append((addedTask, task["expanded"]))
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 for task, expanded in addedTasks:
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 task.setExpanded(expanded)
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148
630a173cb137 Implemented the JSON based tasks files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 return True

eric ide

mercurial