aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services/repos/forks.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-03-01 13:12:00 +0100
committerDavid Medina <davidmedina9@gmail.com>2012-03-01 13:12:00 +0100
commit397238b404a66ba25aec1e4d7902e16104eddefc (patch)
tree7453341e1e3257282cf5d87285b451b6fc13ec23 /pygithub3/services/repos/forks.py
parentServices.repos.Repo doc (diff)
downloadpython-github3-397238b404a66ba25aec1e4d7902e16104eddefc.tar.xz
python-github3-397238b404a66ba25aec1e4d7902e16104eddefc.zip
Restructure modules and packages in a clean way
The docs has increased lines of code, so I split it
Diffstat (limited to 'pygithub3/services/repos/forks.py')
-rw-r--r--pygithub3/services/repos/forks.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pygithub3/services/repos/forks.py b/pygithub3/services/repos/forks.py
new file mode 100644
index 0000000..09f23c5
--- /dev/null
+++ b/pygithub3/services/repos/forks.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+
+from . import Service
+
+
+class Forks(Service):
+
+ def list(self, user=None, repo=None, sort='newest'):
+ request = self.make_request('repos.forks.list', user=user, repo=repo)
+ return self._get_result(request, sort=sort)
+
+ def create(self, user=None, repo=None, org=None):
+ request = self.make_request('repos.forks.create', user=user, repo=repo)
+ #org = {'org': org} if org else {}
+ org = org and {'org': org} or {}
+ return self._post(request, **org)