This commit is contained in:
Vincent Jacques
2012-02-25 07:39:51 +00:00
parent 842ba875d3
commit c0aa08be96
2 changed files with 67 additions and 67 deletions
+21 -21
View File
@@ -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
+46 -46
View File
@@ -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",
],
)