From 28f4b68b94420c72ad65ab734ce03775c4e44c9d Mon Sep 17 00:00:00 2001 From: mogad0n Date: Fri, 18 Sep 2020 10:58:06 +0530 Subject: [PATCH] NameError --- plugin.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugin.py b/plugin.py index a840e0a..4f64012 100644 --- a/plugin.py +++ b/plugin.py @@ -38,9 +38,6 @@ import sys import datetime import pytz -ct = datetime.datetime.now(tz=tz) -import datetime -import time try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization('Tripsit') @@ -209,8 +206,8 @@ class Tripsit(callbacks.Plugin): ih = msg.prefix.split("!")[1] if self.db[ih] is not None: timezone = self.db[ih] - tz = pytz.timezone(timezone) - time = datetime.datetime.now(tz=tz) + timez = pytz.timezone(timezone) + time = datetime.datetime.now(tz=timez) else: timezone = 'UTC' time = datetime.datetime.utcnow() @@ -263,8 +260,8 @@ class Tripsit(callbacks.Plugin): if timezone == 'UTC': time = datetime.datetime.utcnow() else: - tz = pytz.timezone(timezone) - time = datetime.datetime.now(tz=tz) + timez = pytz.timezone(timezone) + time = datetime.datetime.now(tz=timez) dose_time = dateutil.parser.isoparse(lastdose['time']) since_dose = time - dose_time since_dose_seconds = since_dose.total_seconds()