Improve comformance to pep8 (+dos2unix)

PyGithub is now a public projects with several public contibutors,
I have to abandon my very personal coding conventions.
This commit is contained in:
Vincent Jacques
2012-09-17 20:37:22 +02:00
parent 7f61adcaf5
commit 531c3f2d32
107 changed files with 5245 additions and 5094 deletions
+41 -40
View File
@@ -13,33 +13,34 @@
import GithubObject
class UserKey( GithubObject.GithubObject ):
class UserKey(GithubObject.GithubObject):
@property
def id( self ):
self._completeIfNotSet( self._id )
return self._NoneIfNotSet( self._id )
def id(self):
self._completeIfNotSet(self._id)
return self._NoneIfNotSet(self._id)
@property
def key( self ):
self._completeIfNotSet( self._key )
return self._NoneIfNotSet( self._key )
def key(self):
self._completeIfNotSet(self._key)
return self._NoneIfNotSet(self._key)
@property
def title( self ):
self._completeIfNotSet( self._title )
return self._NoneIfNotSet( self._title )
def title(self):
self._completeIfNotSet(self._title)
return self._NoneIfNotSet(self._title)
@property
def url( self ):
self._completeIfNotSet( self._url )
return self._NoneIfNotSet( self._url )
def url(self):
self._completeIfNotSet(self._url)
return self._NoneIfNotSet(self._url)
@property
def verified( self ):
self._completeIfNotSet( self._verified )
return self._NoneIfNotSet( self._verified )
def verified(self):
self._completeIfNotSet(self._verified)
return self._NoneIfNotSet(self._verified)
def delete( self ):
def delete(self):
headers, data = self._requester.requestAndCheck(
"DELETE",
self.url,
@@ -47,42 +48,42 @@ class UserKey( GithubObject.GithubObject ):
None
)
def edit( self, title = GithubObject.NotSet, key = GithubObject.NotSet ):
assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title
assert key is GithubObject.NotSet or isinstance( key, ( str, unicode ) ), key
def edit(self, title=GithubObject.NotSet, key=GithubObject.NotSet):
assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title
assert key is GithubObject.NotSet or isinstance(key, (str, unicode)), key
post_parameters = dict()
if title is not GithubObject.NotSet:
post_parameters[ "title" ] = title
post_parameters["title"] = title
if key is not GithubObject.NotSet:
post_parameters[ "key" ] = key
post_parameters["key"] = key
headers, data = self._requester.requestAndCheck(
"PATCH",
self.url,
None,
post_parameters
)
self._useAttributes( data )
self._useAttributes(data)
def _initAttributes( self ):
def _initAttributes(self):
self._id = GithubObject.NotSet
self._key = GithubObject.NotSet
self._title = GithubObject.NotSet
self._url = GithubObject.NotSet
self._verified = GithubObject.NotSet
def _useAttributes( self, attributes ):
if "id" in attributes: # pragma no branch
assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ]
self._id = attributes[ "id" ]
if "key" in attributes: # pragma no branch
assert attributes[ "key" ] is None or isinstance( attributes[ "key" ], ( str, unicode ) ), attributes[ "key" ]
self._key = attributes[ "key" ]
if "title" in attributes: # pragma no branch
assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ]
self._title = attributes[ "title" ]
if "url" in attributes: # pragma no branch
assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ]
self._url = attributes[ "url" ]
if "verified" in attributes: # pragma no branch
assert attributes[ "verified" ] is None or isinstance( attributes[ "verified" ], bool ), attributes[ "verified" ]
self._verified = attributes[ "verified" ]
def _useAttributes(self, attributes):
if "id" in attributes: # pragma no branch
assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"]
self._id = attributes["id"]
if "key" in attributes: # pragma no branch
assert attributes["key"] is None or isinstance(attributes["key"], (str, unicode)), attributes["key"]
self._key = attributes["key"]
if "title" in attributes: # pragma no branch
assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"]
self._title = attributes["title"]
if "url" in attributes: # pragma no branch
assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"]
self._url = attributes["url"]
if "verified" in attributes: # pragma no branch
assert attributes["verified"] is None or isinstance(attributes["verified"], bool), attributes["verified"]
self._verified = attributes["verified"]