Skip to content

Commit

Permalink
formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Aug 6, 2012
1 parent af3245c commit cdb097a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spyne/model/primitive.py
Expand Up @@ -69,9 +69,11 @@
r'(?:(?P<seconds>\d+(.\d+)?)S)?)?'
)


_ns_xs = spyne.const.xml_ns.xsd
_ns_xsi = spyne.const.xml_ns.xsi


class AnyXml(SimpleModel):
"""An xml node that can contain any number of sub nodes. It's represented by
an ElementTree object."""
Expand All @@ -98,6 +100,7 @@ def from_string(cls, string):
except etree.XMLSyntaxError:
raise ValidationError(string)


class AnyDict(SimpleModel):
"""An xml node that can contain any number of sub nodes. It's represented by
a dict instance that can contain other dicts or iterables of strings as
Expand All @@ -119,6 +122,7 @@ def from_string(cls, string):
except:
raise ValidationError(string)


class Unicode(SimpleModel):
"""The type to represent human-readable data. Its native format is `unicode`.
or `str` with given encoding.
Expand Down Expand Up @@ -214,7 +218,6 @@ def from_string(cls, value):
String = Unicode


# FIXME: Support this for soft validation
class AnyUri(String):
"""A special kind of String type designed to hold an uri."""

Expand Down Expand Up @@ -271,12 +274,12 @@ def is_default(cls):

@staticmethod
def validate_native(cls, value):
return ( SimpleModel.validate_native(cls, value) and
value is None or (
value > cls.Attributes.gt and
value >= cls.Attributes.ge and
value < cls.Attributes.lt and
value <= cls.Attributes.le
return SimpleModel.validate_native(cls, value) and (
value is None or (
value > cls.Attributes.gt and
value >= cls.Attributes.ge and
value < cls.Attributes.lt and
value <= cls.Attributes.le
))

@classmethod
Expand Down

0 comments on commit cdb097a

Please sign in to comment.