37 |
# Used to store schema data |
# Used to store schema data |
38 |
# TODO: Is this used anywhere?? |
# TODO: Is this used anywhere?? |
39 |
import string |
import string |
|
class Schema: |
|
|
def __init__(self, attrs={}, getChildSchema=None): |
|
|
self.name = '' |
|
|
self.type = '' |
|
|
self.__dict__.update(attrs) |
|
|
if getChildSchema != None: |
|
|
self.getChildSchema = getChildSchema |
|
|
|
|
|
def __cmp__(self, other): |
|
|
if not isinstance(other, Schema): |
|
|
return 1 |
|
|
elif id(other) == id(self): |
|
|
return 0 |
|
|
else: |
|
|
return cmp(string.lower(self.name), string.lower(other.name)) or 1 |
|
|
|
|
|
def getChildSchema(self, parent): |
|
|
return () |
|
|
|
|
|
|
|
|
|
|