morelists 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl

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.
morelists/__init__.py CHANGED
@@ -39,6 +39,11 @@ class GameList():
39
39
 
40
40
 
41
41
  def safeSum(self):
42
+ """
43
+ Returns the sum in a safe matter.
44
+
45
+ Dont use this, please access the sum by using .sum
46
+ """
42
47
  try:
43
48
  return (self.addValue - self.subtractValue) * self.multiplyValue / self.divideValue
44
49
  except ZeroDivisionError:
@@ -387,10 +392,14 @@ class GameList():
387
392
  if name == "sum":
388
393
  if not object.__getattribute__(self, "freeze"):
389
394
  self.update()
390
- return (object.__getattribute__(self, "addValue") -
391
- object.__getattribute__(self, "subtractValue")) * \
392
- object.__getattribute__(self, "multiplyValue") / \
393
- object.__getattribute__(self, "divideValue")
395
+ try:
396
+ return (object.__getattribute__(self, "addValue") -
397
+ object.__getattribute__(self, "subtractValue")) * \
398
+ object.__getattribute__(self, "multiplyValue") / \
399
+ object.__getattribute__(self, "divideValue")
400
+ except ZeroDivisionError:
401
+ print("[WARNING]: While retrieving the sum, a ZeroDivisionError showed up. Defaulting to 0")
402
+ return 0
394
403
  elif name == "history":
395
404
  if not object.__getattribute__(self, "freeze"):
396
405
  self.update()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: morelists
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: A small and easy list you can add together like a math equation and has a expiration date for items. Mostly useful for games with stats from multiple sources. More lists will come soon.
5
5
  Home-page: https://github.com/EmanuelNorsk/enlist
6
6
  Author: Emanuel Odén Hesselroth
@@ -0,0 +1,6 @@
1
+ morelists/__init__.py,sha256=nnk03JRnoaIVtFaqlPhIZFiyLzW2fdKBkA1gAJsBjv8,17063
2
+ morelists-0.1.3.dist-info/licenses/LICENSE,sha256=-ASFHlrne1rk8zV57Qj01X2JB-D67ZHPMv1PtQhrbN8,32
3
+ morelists-0.1.3.dist-info/METADATA,sha256=AC3NZ-WtGgffMMiY7sk9ER9pxh8CVUGVq-Uj36yxgPA,681
4
+ morelists-0.1.3.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
5
+ morelists-0.1.3.dist-info/top_level.txt,sha256=Zd7NosYzor-RcH_aD86FXJa3fQzWunYA4_FQS3Yodqo,10
6
+ morelists-0.1.3.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- morelists/__init__.py,sha256=b46BNQD_evFdrX8YU5ignMxU6ZBDIpEx0KbXoQCY8PI,16729
2
- morelists-0.1.2.dist-info/licenses/LICENSE,sha256=-ASFHlrne1rk8zV57Qj01X2JB-D67ZHPMv1PtQhrbN8,32
3
- morelists-0.1.2.dist-info/METADATA,sha256=JtoS_qxKDCJ8q_r3ootsTvDI_1E38VcM7jx4dVHaMvk,681
4
- morelists-0.1.2.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
5
- morelists-0.1.2.dist-info/top_level.txt,sha256=Zd7NosYzor-RcH_aD86FXJa3fQzWunYA4_FQS3Yodqo,10
6
- morelists-0.1.2.dist-info/RECORD,,