aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/resources/base.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-06-03 14:43:00 +0200
committerDavid Medina <davidmedina9@gmail.com>2012-06-03 14:43:00 +0200
commit5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0 (patch)
tree384c25d038f4ea73a37508ec3ef815de172e8d1e /pygithub3/resources/base.py
parentMerge branch 'services/issues' of https://github.com/alejandrogomez/python-github3 into services/issues (diff)
downloadpython-github3-5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0.tar.xz
python-github3-5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0.zip
WIP on issues
Fix GET params Config precendence of user/repo TODO: milestones , fix tests and test it
Diffstat (limited to 'pygithub3/resources/base.py')
-rw-r--r--pygithub3/resources/base.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pygithub3/resources/base.py b/pygithub3/resources/base.py
index 7045529..4c65b8b 100644
--- a/pygithub3/resources/base.py
+++ b/pygithub3/resources/base.py
@@ -1,8 +1,12 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
+from datetime import datetime
+
from pygithub3.core.utils import json
+GITHUB_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
+
class Resource(object):
@@ -44,9 +48,8 @@ class Resource(object):
return wrapper
def parse_date(string_date):
- from datetime import datetime
try:
- date = datetime.strptime(string_date, '%Y-%m-%dT%H:%M:%SZ')
+ date = datetime.strptime(string_date, GITHUB_DATE_FORMAT)
except TypeError:
date = None
return date