Remove the notion of ImmediateCompletion

This commit is contained in:
Vincent Jacques
2012-05-30 19:00:37 +02:00
parent 7a622975d6
commit 12d427464f
48 changed files with 189 additions and 227 deletions
@@ -68,7 +68,7 @@
{% if attribute.type.simple %}
self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ]
{% else %}
self.__{{ attribute.name }} = {% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, attributes[ "{{ attribute.name }}" ], completion = LazyCompletion )
self.__{{ attribute.name }} = {% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, attributes[ "{{ attribute.name }}" ], completed = False )
{% endif %}
{% else %}
@@ -77,7 +77,7 @@
self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ]
{% else %}
self.__{{ attribute.name }} = [
{% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, element, completion = LazyCompletion )
{% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, element, completed = False )
for element in attributes[ "{{ attribute.name }}" ]
]
{% endif %}
@@ -23,7 +23,7 @@
{% else %}
{% if method.type.cardinality == "scalar" %}
return {% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }}( self.__requester, data, completion = NoCompletion )
return {% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }}( self.__requester, data, completed = True )
{% endif %}
{% if method.type.cardinality == "list" %}
+2 -4
View File
@@ -10,14 +10,12 @@ import {{ dependency }}
{% endfor %}
class {{ class.name }}( object ):
def __init__( self, requester, attributes, completion ):
def __init__( self, requester, attributes, completed ):
self.__requester = requester
self.__initAttributes()
self.__useAttributes( attributes )
{% if class.isCompletable %}
self.__completed = completion != LazyCompletion
if completion == ImmediateCompletion:
self.__complete() # pragma: no cover
self.__completed = completed
{% endif %}
{% include "GithubObject.PublicAttributes.py" %}