Put private methods after public ones

This commit is contained in:
Vincent Jacques
2012-05-04 12:55:24 +02:00
parent 07af042cf1
commit ce0aa9f34f
22 changed files with 547 additions and 547 deletions
+21 -21
View File
@@ -11,33 +11,13 @@ class {{ class.name }}( object ):
if not lazy:
self.__complete()
{% for attribute in class.attributes %}
{% for attribute in class.attributes|dictsort:"name" %}
@property
def {{ attribute.name }}( self ):
self.__completeIfNeeded( self.__{{ attribute.name }} )
return self.__{{ attribute.name }}
{% endfor %}
def __initAttributes( self ):
{% for attribute in class.attributes %}
self.__{{ attribute.name }} = None
{% endfor %}
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
{% for method in class.methods|dictsort:"name" %}
def {{ method.name|join:"_" }}( {% include "GithubObject.Parameters.py" with function=method only %} ):
{% if method.request %}
@@ -97,6 +77,26 @@ class {{ class.name }}( object ):
{% endif %}
{% endfor %}
def __initAttributes( self ):
{% for attribute in class.attributes %}
self.__{{ attribute.name }} = None
{% endfor %}
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
# @todo Do not generate __complete if type has no url attribute
def __complete( self ):
result = self.__github._dataRequest(
"GET",
self.__url,
None,
None
)
self.__useAttributes( result )
self.__completed = True
def __useAttributes( self, attributes ):
#@todo No need to check if attribute is in attributes when attribute is mandatory
{% for attribute in class.attributes %}