diff --git a/github/ObjectCapacities/ArgumentsChecker.py b/github/ObjectCapacities/ArgumentsChecker.py index ce8f6496..135e591b 100644 --- a/github/ObjectCapacities/ArgumentsChecker.py +++ b/github/ObjectCapacities/ArgumentsChecker.py @@ -1,21 +1,21 @@ -import itertools - -class ArgumentsChecker: - def __init__( self, mandatoryParameters, optionalParameters ): - self.__mandatoryParameters = mandatoryParameters - self.__optionalParameters = optionalParameters - - def check( self, args, kwds ): - data = dict( kwds ) - for arg, argumentName in itertools.izip( args, itertools.chain( self.__mandatoryParameters, self.__optionalParameters ) ): - if argumentName in kwds: - raise TypeError() - else: - data[ argumentName ] = arg - for argumentName in data: - if argumentName not in itertools.chain( self.__mandatoryParameters, self.__optionalParameters ): - raise TypeError() - for argumentName in self.__mandatoryParameters: - if argumentName not in data: - raise TypeError() - return data +import itertools + +class ArgumentsChecker: + def __init__( self, mandatoryParameters, optionalParameters ): + self.__mandatoryParameters = mandatoryParameters + self.__optionalParameters = optionalParameters + + def check( self, args, kwds ): + data = dict( kwds ) + for arg, argumentName in itertools.izip( args, itertools.chain( self.__mandatoryParameters, self.__optionalParameters ) ): + if argumentName in kwds: + raise TypeError() + else: + data[ argumentName ] = arg + for argumentName in data: + if argumentName not in itertools.chain( self.__mandatoryParameters, self.__optionalParameters ): + raise TypeError() + for argumentName in self.__mandatoryParameters: + if argumentName not in data: + raise TypeError() + return data diff --git a/setup.py b/setup.py index 0670a00e..bd9e64cf 100644 --- a/setup.py +++ b/setup.py @@ -1,46 +1,46 @@ -#!/usr/bin/env python - -from distutils.core import setup -import textwrap - -setup( - name = 'PyGithub', - version = '0.2', - description = 'Use the full Github API v3', - author = 'Vincent Jacques', - author_email = 'vincent@vincent-jacques.net', - url = 'http://vincent-jacques.net/PyGithub', - long_description = textwrap.dedent( """\ - Tutorial - ======== - - First create a Gihub instance:: - - from github import Github - - g = Github( "user", "password" ) - - Then play with your Github objects:: - - for repo in g.user().get_repos(): - print repo.name - repo.edit( has_wiki = False ) - - Reference documentation - ======================= - - See http://vincent-jacques.net/PyGithub""" ), - packages = [ - 'github', - 'github.ObjectCapacities', - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Software Development", - ], -) +#!/usr/bin/env python + +from distutils.core import setup +import textwrap + +setup( + name = 'PyGithub', + version = '0.2', + description = 'Use the full Github API v3', + author = 'Vincent Jacques', + author_email = 'vincent@vincent-jacques.net', + url = 'http://vincent-jacques.net/PyGithub', + long_description = textwrap.dedent( """\ + Tutorial + ======== + + First create a Gihub instance:: + + from github import Github + + g = Github( "user", "password" ) + + Then play with your Github objects:: + + for repo in g.user().get_repos(): + print repo.name + repo.edit( has_wiki = False ) + + Reference documentation + ======================= + + See http://vincent-jacques.net/PyGithub""" ), + packages = [ + 'github', + 'github.ObjectCapacities', + ], + classifiers=[ + "Development Status :: 4 - Beta", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Software Development", + ], +)