diff options
Diffstat (limited to 'pygithub3/resources')
-rw-r--r-- | pygithub3/resources/base.py | 5 | ||||
-rw-r--r-- | pygithub3/resources/pull_requests.py | 22 |
2 files changed, 23 insertions, 4 deletions
diff --git a/pygithub3/resources/base.py b/pygithub3/resources/base.py index 4ca2aa3..7045529 100644 --- a/pygithub3/resources/base.py +++ b/pygithub3/resources/base.py @@ -1,10 +1,7 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- -try: - import simplejson as json -except ImportError: - import json +from pygithub3.core.utils import json class Resource(object): diff --git a/pygithub3/resources/pull_requests.py b/pygithub3/resources/pull_requests.py new file mode 100644 index 0000000..a28e0fe --- /dev/null +++ b/pygithub3/resources/pull_requests.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- + +from .base import Resource + + +class PullRequest(Resource): + _dates = ('created_at', 'updated_at', 'closed_at', 'merged_at') + + def __str__(self): + return '<PullRequest (%s)>' % getattr(self, 'title', '') + + +class File(Resource): + def __str__(self): + return '<File (%s)>' % getattr(self, 'filename', '') + + +class Comment(Resource): + _dates = ('created_at', 'updated_at') + + def __str__(self): + return '<Comment (#%s)>' % getattr(self, 'id', '') |