Changeset 559396 in git
- Timestamp:
- Jun 17, 2005, 11:29:27 AM (18 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 88f1af180fd61cad5c84ed7e886b02fa905372c9
- Parents:
- d113d3aba56b6d8664654dbfaeeae4b356a2527e
- Location:
- modules/openmathserver
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/openmathserver/context.py
rd113d3 r559396 74 74 #TODO: Make all objects __hash__ and __eq__ 75 75 if (len(obj.attributes)==0): 76 return obj.XML encode(self)76 return obj.XMLEncode(self) 77 77 else: 78 78 toencode=copy(obj) … … 81 81 attribution=OMAttribution(*([OMAttributePair(k,obj.attributes[k])\ 82 82 for k in obj.attributes])+[toencode]) 83 return attribution.XML encode(self)83 return attribution.XMLEncode(self) 84 84 85 85 class SimpleXMLEncoder(object): -
modules/openmathserver/objects.py
rd113d3 r559396 88 88 XMLAttributes=property(__getXMLAttributes,__setXMLAttributes,__delXMLAttributes,\ 89 89 "xml attributes") 90 def XML encode(self, context):90 def XMLEncode(self, context): 91 91 92 92 attr=self.XMLAttributes … … 243 243 def evaluate(self, context): 244 244 return context.evaluate(self.ref) 245 def XML encode(self, context):245 def XMLEncode(self, context): 246 246 "FIXME: maybe it should also be able to encode as reference" 247 247 return context.XMLEncodeObject(self.ref) … … 310 310 i=OMint(22482489) 311 311 print i.body 312 print i.XML encode(context)312 print i.XMLEncode(context) 313 313 #i.body="dshj" 314 314 -
modules/openmathserver/xmlencodetest.py
rd113d3 r559396 6 6 i=OMint(22482489) 7 7 #print i.body 8 print i.XML encode(context)8 print i.XMLEncode(context) 9 9 print context.XMLEncodeObject(i) 10 10 v=OMVar("x") 11 print v.XML encode(context)11 print v.XMLEncode(context) 12 12 x=v 13 13 y=OMVar("y") 14 14 a=OMApply(OMSymbol("plus",arith1.content),[x,y,i]) 15 print a.XML encode(context)15 print a.XMLEncode(context) 16 16 print context.XMLEncodeObject(context.evaluate(a)) 17 17 a1=OMApply(OMSymbol("plus",arith1.content),[OMint(1),OMint(2)])
Note: See TracChangeset
for help on using the changeset viewer.