pyvikunja 0.10__tar.gz → 0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvikunja-0.10/pyvikunja.egg-info → pyvikunja-0.11}/PKG-INFO +1 -1
- {pyvikunja-0.10 → pyvikunja-0.11}/pyproject.toml +1 -1
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/task.py +9 -2
- {pyvikunja-0.10 → pyvikunja-0.11/pyvikunja.egg-info}/PKG-INFO +1 -1
- {pyvikunja-0.10 → pyvikunja-0.11}/LICENSE +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/README.md +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/__init__.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/api.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/enum/repeat_mode.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/enum/task_priority.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/label.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/models.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/project.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/team.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja/models/user.py +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja.egg-info/SOURCES.txt +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja.egg-info/dependency_links.txt +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja.egg-info/requires.txt +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/pyvikunja.egg-info/top_level.txt +0 -0
- {pyvikunja-0.10 → pyvikunja-0.11}/setup.cfg +0 -0
@@ -34,10 +34,11 @@ class Task(BaseModel):
|
|
34
34
|
self.assignees: List[User] = [User(user_data) for user_data in data.get('assignees', []) or []]
|
35
35
|
|
36
36
|
# Parse repeat_mode into an enum
|
37
|
-
self.repeat_mode: RepeatMode = self._parse_repeat_mode(data.get('repeat_mode'))
|
37
|
+
self.repeat_mode: Optional[RepeatMode] = self._parse_repeat_mode(data.get('repeat_mode'))
|
38
38
|
|
39
39
|
# Parse repeat_after into timedelta
|
40
40
|
self.repeat_after: Optional[timedelta] = self._parse_repeat_after(data.get('repeat_after'))
|
41
|
+
self.repeat_enabled = self.repeat_after is not None
|
41
42
|
|
42
43
|
def _parse_repeat_mode(self, mode: Optional[int]) -> Optional[RepeatMode]:
|
43
44
|
"""Convert repeat_mode integer into an Enum value, defaulting to NONE."""
|
@@ -115,7 +116,13 @@ class Task(BaseModel):
|
|
115
116
|
iso_date = str(date.isoformat())
|
116
117
|
return await self.update({'end_date': iso_date})
|
117
118
|
|
118
|
-
async def
|
119
|
+
async def set_repeating_enabled(self, enabled: bool):
|
120
|
+
return await self.update({
|
121
|
+
'repeat_after': None if not enabled else 3600 # 1 hour min
|
122
|
+
})
|
123
|
+
|
124
|
+
async def set_repeating_interval(self, interval: Optional[timedelta] = None,
|
125
|
+
mode: Optional[RepeatMode] = None) -> 'Task':
|
119
126
|
new_interval = interval if interval else self.repeat_after
|
120
127
|
total_seconds = int(new_interval.total_seconds())
|
121
128
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|