Commit f406c527 authored by Emmanuel Arias's avatar Emmanuel Arias

Update upstream source from tag 'upstream/1.43.7'

Update to upstream version '1.43.7'
with Debian dir 1a707f3f58dabc4aabbb434add3511ab9f243383
parents 35c24f21 70442fce
Metadata-Version: 2.1
Name: PyGithub
Version: 1.43.3
Version: 1.43.7
Summary: Use the full Github API v3
Home-page: http://pygithub.readthedocs.io/en/latest/
Author: Vincent Jacques
......@@ -39,9 +39,9 @@ Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
Provides-Extra: integrations
Metadata-Version: 2.1
Name: PyGithub
Version: 1.43.7
Summary: Use the full Github API v3
Home-page: http://pygithub.readthedocs.io/en/latest/
Author: Vincent Jacques
Author-email: vincent@vincent-jacques.net
License: UNKNOWN
Description: (Very short) Tutorial
=====================
First create a Github instance::
from github import Github
# using username and password
g = Github("user", "password")
# or using an access token
g = Github("access_token")
Then play with your Github objects::
for repo in g.get_user().get_repos():
print(repo.name)
repo.edit(has_wiki=False)
Reference documentation
=======================
See http://pygithub.readthedocs.io/en/latest/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
Provides-Extra: integrations
COPYING
COPYING.LESSER
MANIFEST.in
README.md
setup.py
PyGithub.egg-info/PKG-INFO
PyGithub.egg-info/SOURCES.txt
PyGithub.egg-info/dependency_links.txt
PyGithub.egg-info/requires.txt
PyGithub.egg-info/top_level.txt
github/AuthenticatedUser.py
github/Authorization.py
github/AuthorizationApplication.py
github/Branch.py
github/BranchProtection.py
github/Clones.py
github/Commit.py
github/CommitCombinedStatus.py
github/CommitComment.py
github/CommitStats.py
github/CommitStatus.py
github/Comparison.py
github/Consts.py
github/ContentFile.py
github/Download.py
github/Event.py
github/File.py
github/Gist.py
github/GistComment.py
github/GistFile.py
github/GistHistoryState.py
github/GitAuthor.py
github/GitBlob.py
github/GitCommit.py
github/GitObject.py
github/GitRef.py
github/GitRelease.py
github/GitReleaseAsset.py
github/GitTag.py
github/GitTree.py
github/GitTreeElement.py
github/GithubException.py
github/GithubObject.py
github/GitignoreTemplate.py
github/Hook.py
github/HookDescription.py
github/HookResponse.py
github/InputFileContent.py
github/InputGitAuthor.py
github/InputGitTreeElement.py
github/Installation.py
github/InstallationAuthorization.py
github/Invitation.py
github/Issue.py
github/IssueComment.py
github/IssueEvent.py
github/IssuePullRequest.py
github/Label.py
github/Legacy.py
github/License.py
github/MainClass.py
github/Migration.py
github/Milestone.py
github/NamedUser.py
github/Notification.py
github/NotificationSubject.py
github/Organization.py
github/PaginatedList.py
github/Path.py
github/Permissions.py
github/Plan.py
github/Project.py
github/ProjectCard.py
github/ProjectColumn.py
github/PullRequest.py
github/PullRequestComment.py
github/PullRequestMergeStatus.py
github/PullRequestPart.py
github/PullRequestReview.py
github/Rate.py
github/RateLimit.py
github/Reaction.py
github/Referrer.py
github/Repository.py
github/RepositoryKey.py
github/Requester.py
github/RequiredPullRequestReviews.py
github/RequiredStatusChecks.py
github/SourceImport.py
github/Stargazer.py
github/StatsCodeFrequency.py
github/StatsCommitActivity.py
github/StatsContributor.py
github/StatsParticipation.py
github/StatsPunchCard.py
github/Tag.py
github/Team.py
github/Topic.py
github/UserKey.py
github/View.py
github/__init__.py
\ No newline at end of file
deprecated
pyjwt
requests>=2.14.0
[integrations]
cryptography
......@@ -6,6 +6,7 @@
[![License](https://img.shields.io/badge/license-LGPL-blue.svg)](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License)
[![Join the chat at https://gitter.im/PyGithub/PyGithub](https://badges.gitter.im/PyGithub/PyGithub.svg)](https://gitter.im/PyGithub/PyGithub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Open Source Helpers](https://www.codetriage.com/pygithub/pygithub/badges/users.svg)](https://www.codetriage.com/pygithub/pygithub)
[![codecov](https://codecov.io/gh/PyGithub/PyGithub/branch/master/graph/badge.svg)](https://codecov.io/gh/PyGithub/PyGithub)
PyGitHub is a Python (2 and 3) library to access the [GitHub API v3] and [Github Enterprise API v3].
This library enables you to manage [GitHub] resources such as repositories, user profiles, and organizations in your Python applications.
......
pygithub (1.43.7-1) UNRELEASED; urgency=medium
* New upstream version 1.43.7
-- Emmanuel Arias <emamnuelarias30@gmail.com> Thu, 25 Apr 2019 01:29:24 +0000
pygithub (1.43.3-1) unstable; urgency=medium
[Ondřej Nový]
......
......@@ -55,6 +55,7 @@ import github.Issue
import github.Event
import github.Authorization
import github.Notification
import github.Migration
import Consts
......@@ -237,6 +238,14 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._name)
return self._name.value
@property
def node_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._node_id)
return self._node_id.value
@property
def organizations_url(self):
"""
......@@ -486,7 +495,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
post_parameters = {
"public": public,
"files": dict((key, value._identity) for key, value in files.iteritems()),
"files": {key: value._identity for key, value in files.iteritems()},
}
if description is not github.GithubObject.NotSet:
post_parameters["description"] = description
......@@ -835,23 +844,30 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
)
return github.Notification.Notification(self._requester, headers, data, completed=True)
def get_notifications(self, all=github.GithubObject.NotSet, participating=github.GithubObject.NotSet):
def get_notifications(self, all=github.GithubObject.NotSet, participating=github.GithubObject.NotSet, since=github.GithubObject.NotSet, before=github.GithubObject.NotSet):
"""
:calls: `GET /notifications <http://developer.github.com/v3/activity/notifications>`_
:param all: bool
:param participating: bool
:param since: datetime.datetime
:param before: datetime.datetime
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Notification.Notification`
"""
assert all is github.GithubObject.NotSet or isinstance(all, bool), all
assert participating is github.GithubObject.NotSet or isinstance(participating, bool), participating
assert since is github.GithubObject.NotSet or isinstance(since, datetime.datetime), since
assert before is github.GithubObject.NotSet or isinstance(before, datetime.datetime), before
params = dict()
if all is not github.GithubObject.NotSet:
params["all"] = all
if participating is not github.GithubObject.NotSet:
params["participating"] = participating
# TODO: implement parameter "since"
if since is not github.GithubObject.NotSet:
params["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
if before is not github.GithubObject.NotSet:
params["before"] = before.strftime("%Y-%m-%dT%H:%M:%SZ")
return github.PaginatedList.PaginatedList(
github.Notification.Notification,
......@@ -1139,6 +1155,50 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
input={}
)
def create_migration(self, repos, lock_repositories=github.GithubObject.NotSet, exclude_attachments=github.GithubObject.NotSet):
"""
:calls: `POST /user/migrations`_
:param repos: list or tuple of str
:param lock_repositories: bool
:param exclude_attachments: bool
:rtype: :class:`github.Migration.Migration`
"""
assert isinstance(repos, (list, tuple)), repos
assert all(isinstance(repo, (str, unicode)) for repo in repos), repos
assert lock_repositories is github.GithubObject.NotSet or isinstance(lock_repositories, bool), lock_repositories
assert exclude_attachments is github.GithubObject.NotSet or isinstance(exclude_attachments, bool), exclude_attachments
post_parameters = {
"repositories": repos
}
if lock_repositories is not github.GithubObject.NotSet:
post_parameters["lock_repositories"] = lock_repositories
if exclude_attachments is not github.GithubObject.NotSet:
post_parameters["exclude_attachments"] = exclude_attachments
headers, data = self._requester.requestJsonAndCheck(
"POST",
"/user/migrations",
input=post_parameters,
headers={
"Accept": Consts.mediaTypeMigrationPreview
}
)
return github.Migration.Migration(self._requester, headers, data, completed=True)
def get_migrations(self):
"""
:calls: `GET /user/migrations`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Migration.Migration`
"""
return github.PaginatedList.PaginatedList(
github.Migration.Migration,
self._requester,
"/user/migrations",
None,
headers={
"Accept": Consts.mediaTypeMigrationPreview
}
)
def _initAttributes(self):
self._avatar_url = github.GithubObject.NotSet
self._bio = github.GithubObject.NotSet
......@@ -1161,6 +1221,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
self._location = github.GithubObject.NotSet
self._login = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._node_id = github.GithubObject.NotSet
self._organizations_url = github.GithubObject.NotSet
self._owned_private_repos = github.GithubObject.NotSet
self._plan = github.GithubObject.NotSet
......@@ -1220,6 +1281,8 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
self._login = self._makeStringAttribute(attributes["login"])
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "node_id" in attributes: # pragma no branch
self._node_id = self._makeStringAttribute(attributes["node_id"])
if "organizations_url" in attributes: # pragma no branch
self._organizations_url = self._makeStringAttribute(attributes["organizations_url"])
if "owned_private_repos" in attributes: # pragma no branch
......
......@@ -2,12 +2,11 @@
############################ Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2016 Jannis Gebauer <ja.geb@me.com> #
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
# Copyright 2018 sfdye <tsfdye@gmail.com> #
# Copyright 2018 Justin Kufro <jkufro@andrew.cmu.edu> #
# Copyright 2018 Ivan Minno <iminno@andrew.cmu.edu> #
# Copyright 2018 Zilei Gu <zileig@andrew.cmu.edu> #
# Copyright 2018 Yves Zumbach <yzumbach@andrew.cmu.edu> #
# Copyright 2018 Leying Chen <leyingc@andrew.cmu.edu> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
......@@ -30,34 +29,49 @@
import github.GithubObject
class Status(github.GithubObject.NonCompletableGithubObject):
class Clones(github.GithubObject.NonCompletableGithubObject):
"""
This class represents Statuses. The reference can be found here https://status.github.com/api
This class represents a popular Path for a GitHub repository.
The reference can be found here https://developer.github.com/v3/repos/traffic/
"""
def __repr__(self):
return self.get__repr__({"status": self._status.value})
return self.get__repr__({
"timestamp": self._timestamp.value,
"count": self._count.value,
"uniques": self._uniques.value
})
@property
def status(self):
def timestamp(self):
"""
:type: string
:type: datetime.datetime
"""
return self._status.value
return self._timestamp.value
@property
def last_updated(self):
def count(self):
"""
:type: datetime.datetime
:type: integer
"""
return self._count.value
@property
def uniques(self):
"""
:type: integer
"""
return self._last_updated.value
return self._uniques.value
def _initAttributes(self):
self._status = github.GithubObject.NotSet
self._last_updated = github.GithubObject.NotSet
self._timestamp = github.GithubObject.NotSet
self._count = github.GithubObject.NotSet
self._uniques = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "status" in attributes: # pragma no branch
self._status = self._makeStringAttribute(attributes["status"])
if "last_updated" in attributes: # pragma no branch
self._last_updated = self._makeDatetimeAttribute(attributes["last_updated"])
if "timestamp" in attributes: # pragma no branch
self._timestamp = self._makeDatetimeAttribute(attributes["timestamp"])
if "count" in attributes: # pragma no branch
self._count = self._makeIntAttribute(attributes["count"])
if "uniques" in attributes: # pragma no branch
self._uniques = self._makeIntAttribute(attributes["uniques"])
......@@ -48,6 +48,7 @@ RES_LAST_MODIFIED = "last-modified"
headerRateLimit = "x-ratelimit-limit"
headerRateRemaining = "x-ratelimit-remaining"
headerRateReset = "x-ratelimit-reset"
headerOAuthScopes = "x-oauth-scopes"
headerOTP = "X-GitHub-OTP"