From ccd924d9e73b458b0b1f32715e7542dfa4e82aa4 Mon Sep 17 00:00:00 2001 From: Dan <294904+dngfx@users.noreply.github.com> Date: Sun, 24 Feb 2019 21:13:02 +0000 Subject: [PATCH] Remove superfluous json import and change datetime to match code standards. --- modules/imgur.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/imgur.py b/modules/imgur.py index a9e3bd62..2aaf97bb 100644 --- a/modules/imgur.py +++ b/modules/imgur.py @@ -1,8 +1,7 @@ #--require-config imgur-api-key -import re, json +import re, datetime from src import ModuleManager, utils, EventManager -from datetime import datetime REGEX_IMAGE = re.compile("https?://(?:i\.)?imgur.com/(\w+)") REGEX_GALLERY = re.compile("https?://imgur.com/gallery/(\w+)") @@ -63,7 +62,7 @@ class Module(ModuleManager.BaseModule): nsfw = utils.irc.bold(NSFW_TEXT) + " " if data["nsfw"] else "" title = data["title"] + " " if data["title"] else "" views = data["views"] - time = datetime.utcfromtimestamp(data["datetime"]). \ + time = datetime.datetime.utcfromtimestamp(data["datetime"]). \ strftime("%e %b, %Y at %H:%M") ups = utils.irc.color(str(data["ups"]) + "▲", utils.consts.GREEN) downs = utils.irc.color("▼" + str(data["downs"]), utils.consts.RED) @@ -95,7 +94,7 @@ class Module(ModuleManager.BaseModule): width = data["width"] height = data["height"] views = data["views"] - time = datetime.utcfromtimestamp(data["datetime"]).\ + time = datetime.datetime.utcfromtimestamp(data["datetime"]).\ strftime("%e %b, %Y at %H:%M") #%Y-%m-%d %H:%M:%S+00:00 (UTC)