sysview-py 0.1.0__tar.gz → 0.2.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sysview-py
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Add your description here
5
5
  Author: Michael Wilson
6
6
  Author-email: Michael Wilson <mw@1wilson.org>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sysview-py"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,5 +1,5 @@
1
1
  import hashlib
2
- from datetime import datetime
2
+ from datetime import datetime, timedelta
3
3
 
4
4
 
5
5
  status_map = {
@@ -90,11 +90,16 @@ class ReportItem:
90
90
  @property
91
91
  def status(self):
92
92
  age = datetime.now() - self.date
93
+ threshold = timedelta(days=1)
93
94
  status = self._status
94
- if age > 1:
95
- status = "OUTDATED"
95
+ if age > threshold:
96
+ status = "UNKNOWN"
96
97
  return status
97
98
 
99
+ @status.setter
100
+ def status(self, value):
101
+ self._status = value
102
+
98
103
  @property
99
104
  def status_code(self):
100
105
  return status_map[self.status]
@@ -173,12 +178,12 @@ class Report:
173
178
  raw_item += f"{line}\n"
174
179
  elif "---" == line:
175
180
  if item_pointer > 0:
176
- item = ReportItem(raw_item, report_id=self.report_id)
181
+ item = ReportItem(raw_item, report_id=self.report_id, date=self.date)
177
182
  item.parse()
178
183
  self.items.append(item)
179
184
  item_pointer = item_pointer + 1
180
185
  raw_item = ""
181
- item = ReportItem(raw_item, report_id=self.report_id)
186
+ item = ReportItem(raw_item, report_id=self.report_id, date=self.date)
182
187
  item.parse()
183
188
  self.items.append(item)
184
189
  self.items.sort(key=lambda item: item.status_code, reverse=True)
File without changes