This commit is contained in:
Vincent Jacques
2012-02-25 07:39:53 +00:00
parent c0aa08be96
commit f1a7b0dc09
3 changed files with 65 additions and 65 deletions
+6 -6
View File
@@ -11,7 +11,7 @@ class SimpleTypePolicy:
def create( self, obj, rawValue ):
return rawValue
class GithubObjectTypePolicy:
class ObjectTypePolicy:
def __init__( self, type ):
self.__type = type
@@ -52,14 +52,14 @@ class SeveralAttributes:
for attributePolicy in self.__attributePolicies:
attributePolicy.apply( cls )
def BasicAttribute( attributeName ):
def InternalSimpleAttribute( attributeName ):
return InternalAttribute( attributeName, SimpleTypePolicy() )
def BasicAttributes( *attributeNames ):
return SeveralAttributes( [ BasicAttribute( attributeName ) for attributeName in attributeNames ] )
def InternalSimpleAttributes( *attributeNames ):
return SeveralAttributes( [ InternalSimpleAttribute( attributeName ) for attributeName in attributeNames ] )
def ComplexAttribute( attributeName, type ):
return InternalAttribute( attributeName, GithubObjectTypePolicy( type ) )
def InternalObjectAttribute( attributeName, type ):
return InternalAttribute( attributeName, ObjectTypePolicy( type ) )
class BaseUrl( AttributeFromCallable ):
def __init__( self, baseUrl ):