From 3371f0aabc61dfc8549f0752ccc83aef06df61e8 Mon Sep 17 00:00:00 2001 From: David Medina Date: Sun, 12 Feb 2012 17:53:07 +0100 Subject: Repos service initialized +service.repos.repo --- pygithub3/resources/orgs.py | 14 +++++++++++++ pygithub3/resources/repos.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 pygithub3/resources/orgs.py create mode 100644 pygithub3/resources/repos.py (limited to 'pygithub3/resources') diff --git a/pygithub3/resources/orgs.py b/pygithub3/resources/orgs.py new file mode 100644 index 0000000..3996172 --- /dev/null +++ b/pygithub3/resources/orgs.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from .base import Resource + +__all__ = ('Org', ) + + +class Org(Resource): + + _dates = ('created_at', ) + + def __str__(self): + return '' % getattr(self, 'name', '') diff --git a/pygithub3/resources/repos.py b/pygithub3/resources/repos.py new file mode 100644 index 0000000..609ede4 --- /dev/null +++ b/pygithub3/resources/repos.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from .base import Resource +from .users import User +from .orgs import Org + +__all__ = ('Repo', ) + + +class Repo(Resource): + + _dates = ('created_at', 'pushed_at') + _maps = {'owner': User, 'organization': Org, 'parent': 'self', + 'source': 'self'} + + def __str__(self): + return '' % getattr(self, 'name', '') + + +class Team(Resource): + + def __str__(self): + return '' % getattr(self, 'name', '') + + +class Commit(Resource): + + def __str__(self): + return '' % ( + getattr(self, 'sha', ''), + getattr(self, 'message', '')) + + +class Tag(Resource): + + _maps = {'commit': Commit} + + def __str__(self): + return '' % getattr(self, 'name', '') + + +class Branch(Resource): + + _maps = {'commit': Commit} + + def __str__(self): + return '' % getattr(self, 'name', '') -- cgit v1.2.3-59-g8ed1b