aboutsummaryrefslogtreecommitdiff
path: root/src/philo/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/philo/log.py')
-rw-r--r--src/philo/log.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/philo/log.py b/src/philo/log.py
index 14bdd75..a07b734 100644
--- a/src/philo/log.py
+++ b/src/philo/log.py
@@ -6,14 +6,15 @@
# By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/10/01 10:51:39 by cacharle #+# #+# #
-# Updated: 2020/10/01 14:19:29 by cacharle ### ########.fr #
+# Updated: 2020/10/05 13:52:51 by cacharle ### ########.fr #
# #
# ############################################################################ #
import re
-from .event import Event
-from . import error
+from philo.event import Event
+import philo
+
class Log:
def __init__(self, line: str, philo_num, start_time, end_time):
@@ -24,7 +25,7 @@ class Log:
line
)
if match is None:
- raise error.Format(line, "wrong format")
+ raise philo.error.Format(line, "wrong format")
self._line = line
self.id = self._parse_ranged_int(match.group("id"), 1, philo_num)
@@ -37,10 +38,12 @@ class Log:
try:
value = int(s)
if not (lo <= value <= hi):
- raise error.Format(self._line,
- "{} should be between {} - {}".format(s, lo, hi))
+ raise philo.error.Format(
+ self._line,
+ "{} should be between {} - {}".format(s, lo, hi)
+ )
except ValueError:
- raise error.Format(self._line, "{} sould be an integer".format(s))
+ raise philo.error.Format(self._line, "{} sould be an integer".format(s))
return value
def __repr__(self):