Manual implementation of typing of last parameters

This commit is contained in:
Vincent Jacques
2012-06-01 18:54:35 +01:00
parent ed75bb74ec
commit 9954a3fd1b
21 changed files with 160 additions and 77 deletions
+3 -1
View File
@@ -9,6 +9,7 @@ import Repository
import NamedUser
import Plan
import Organization
import InputFileContent
import Event
class NamedUser( GithubObject.GithubObject ):
@@ -144,10 +145,11 @@ class NamedUser( GithubObject.GithubObject ):
def create_gist( self, public, files, description = GithubObject.NotSet ):
assert isinstance( public, bool ), public
assert all( isinstance( element, InputFileContent.InputFileContent ) for element in files.itervalues() ), files
assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description
post_parameters = {
"public": public,
"files": files,
"files": { key : value._identity() for key, value in files.iteritems() },
}
if description is not GithubObject.NotSet:
post_parameters[ "description" ] = description