Permalink
Browse files

formatting.

  • Loading branch information...
1 parent af3245c commit cdb097a319bc2e8e92b6ff62fd681cd45bc50fc4 @plq committed Aug 6, 2012
Showing with 10 additions and 7 deletions.
  1. +10 −7 spyne/model/primitive.py
View
@@ -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."""
@@ -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
@@ -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.
@@ -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."""
@@ -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

0 comments on commit cdb097a

Please sign in to comment.