aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-12 11:08:24 +0000
committerGravatar jesopo2019-02-12 11:08:24 +0000
commit8c9626f0a919af4240e9a21e1b5f3bcb4723f1a4 (patch)
treec36a8cee28662485b5b1a09241f50ab9f8e0e8d1
parentInsert `label` tag to lines in labeled BATCHes (line_handler.py) (diff)
Put an strf format for ISO8601 in utils
-rw-r--r--modules/github/__init__.py3
-rw-r--r--src/utils/__init__.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/modules/github/__init__.py b/modules/github/__init__.py
index 9a9e97a7..0e0d2b73 100644
--- a/modules/github/__init__.py
+++ b/modules/github/__init__.py
@@ -1,7 +1,6 @@
import datetime, itertools, json, math, urllib.parse
from src import ModuleManager, utils
-_ISO8601 = "%Y-%m-%dT%H:%M:%S%z"
FORM_ENCODED = "application/x-www-form-urlencoded"
COMMIT_URL = "https://github.com/%s/commit/%s"
@@ -381,7 +380,7 @@ class Module(ModuleManager.BaseModule):
return url
def _iso8601(self, s):
- return datetime.datetime.strptime(s, _ISO8601)
+ return datetime.datetime.strptime(s, utils.ISO8601_FORMAT)
def ping(self, data):
return ["Received new webhook"]
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 738541d5..692d305a 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -1,6 +1,8 @@
import decimal, io, ipaddress, re, typing
from src.utils import cli, consts, irc, http, parse, security
+ISO8601_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
+
TIME_SECOND = 1
TIME_MINUTE = TIME_SECOND*60
TIME_HOUR = TIME_MINUTE*60