summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/lib-toolbox
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-01-16 14:38:10 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-01-16 14:38:10 (GMT)
commit5b0533d9ca4849ccf5196e5a1d09196a453ed362 (patch)
tree7a61a43be9a06bf82f9ab2d0b95c069cf8c88f31 /Mac/Lib/lib-toolbox
parent48b805c07c18e56e06d2f30a83623072c2e4c5fd (diff)
downloadcpython-5b0533d9ca4849ccf5196e5a1d09196a453ed362.zip
cpython-5b0533d9ca4849ccf5196e5a1d09196a453ed362.tar.gz
cpython-5b0533d9ca4849ccf5196e5a1d09196a453ed362.tar.bz2
Addition by Bill Bedford: Ordinal and NOrdinal classes so we can
implement "every", etc.
Diffstat (limited to 'Mac/Lib/lib-toolbox')
-rw-r--r--Mac/Lib/lib-toolbox/aetypes.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/Mac/Lib/lib-toolbox/aetypes.py b/Mac/Lib/lib-toolbox/aetypes.py
index 3dc0d0e..4bdc93c 100644
--- a/Mac/Lib/lib-toolbox/aetypes.py
+++ b/Mac/Lib/lib-toolbox/aetypes.py
@@ -185,6 +185,31 @@ class NComparison(Comparison):
def __init__(self, obj1, obj2):
Comparison.__init__(obj1, self.relo, obj2)
+class Ordinal:
+ """An AE Ordinal"""
+
+ def __init__(self, abso):
+# self.obj1 = obj1
+ self.abso = "%-4.4s" % str(abso)
+
+ def __repr__(self):
+ return "Ordinal(%s)" % (`self.abso`)
+
+ def __str__(self):
+ return "%s" % (string.strip(self.abso))
+
+ def __aepack__(self):
+ return pack(self.abso, 'abso')
+
+def IsOrdinal(x):
+ return IsInstance(x, Ordinal)
+
+class NOrdinal(Ordinal):
+ # The class attribute 'abso' must be set in a subclass
+
+ def __init__(self):
+ Ordinal.__init__(self, self.abso)
+
class Logical:
"""An AE logical expression object"""
@@ -533,7 +558,7 @@ exec template % ("Text", 'text')
exec template % ("Character", 'cha ')
exec template % ("Word", 'cwor')
exec template % ("Line", 'clin')
-exec template % ("Paragraph", 'cpar')
+exec template % ("paragraph", 'cpar')
exec template % ("Window", 'cwin')
exec template % ("Document", 'docu')
exec template % ("File", 'file')