This commit is contained in:
Vincent Jacques
2012-11-27 21:14:30 +01:00
parent c8c889f5a9
commit 54554b280d
61 changed files with 385 additions and 33 deletions
+19
View File
@@ -33,6 +33,25 @@ DEFAULT_TIMEOUT = 10
class Github(object):
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent=None):
"""
Please edit this generated docstring for method :func:`Github.__init__`.
:param login_or_token: string
:param password: string
:param base_url: string
:param timeout: integer
:param client_id: string
:param client_secret: string
:param user_agent: string
"""
assert login_or_token is None or isinstance(login_or_token, (str, unicode)), login_or_token
assert password is None or isinstance(password, (str, unicode)), password
assert base_url is None or isinstance(base_url, (str, unicode)), base_url
assert timeout is None or isinstance(timeout, (int, long)), timeout
assert client_id is None or isinstance(client_id, (str, unicode)), client_id
assert client_secret is None or isinstance(client_secret, (str, unicode)), client_secret
assert user_agent is None or isinstance(user_agent, (str, unicode)), user_agent
self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret, user_agent)
def __get_FIX_REPO_GET_GIT_REF(self):
+7
View File
@@ -16,6 +16,13 @@
class InputFileContent(object):
def __init__(self, content):
"""
Please edit this generated docstring for method :func:`github.InputFileContent.InputFileContent.__init__`.
:param content: string
"""
assert isinstance(content, (str, unicode)), content
self.__content = content
@property
+11
View File
@@ -16,6 +16,17 @@
class InputGitAuthor(object):
def __init__(self, name, email, date):
"""
Please edit this generated docstring for method :func:`github.InputGitAuthor.InputGitAuthor.__init__`.
:param name: string
:param email: string
:param date: string
"""
assert isinstance(name, (str, unicode)), name
assert isinstance(email, (str, unicode)), email
assert isinstance(date, (str, unicode)), date # @todo Datetime?
self.__name = name
self.__email = email
self.__date = date
+15
View File
@@ -18,6 +18,21 @@ import github.GithubObject
class InputGitTreeElement(object):
def __init__(self, path, mode, type, content=github.GithubObject.NotSet, sha=github.GithubObject.NotSet):
"""
Please edit this generated docstring for method :func:`github.InputGitTreeElement.InputGitTreeElement.__init__`.
:param path: string
:param mode: string
:param type: string
:param content: string
:param sha: string
"""
assert isinstance(path, (str, unicode)), path
assert isinstance(mode, (str, unicode)), mode
assert isinstance(type, (str, unicode)), type
assert isinstance(content, (str, unicode)), content
assert isinstance(sha, (str, unicode)), sha
self.__path = path
self.__mode = mode
self.__type = type
+8
View File
@@ -13,6 +13,12 @@
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
"""
The primary class you will instanciate is :class:`github.Github.Github`.
From its `get_`, `create_` methods, you will obtain instances of all Github objects
like :class:`github.NamedUser.NamedUser` or :class:`github.Repository.Repository`.
"""
import logging
from Github import Github
@@ -23,6 +29,8 @@ from InputGitTreeElement import InputGitTreeElement
def enable_console_debug_logging(): # pragma no cover
"""Is this included"""
logger = logging.getLogger("github")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())