Ignore:
Timestamp:
Jun 14, 2005, 11:48:02 AM (18 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
bb3e2b01b8b571e1ce0e1df85bcb71fb0ccb8e9d
Parents:
50225ad7ef398575b5988f3bb049c8b508002f04
Message:
*bricken: having even more fun


git-svn-id: file:///usr/local/Singular/svn/trunk@8360 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/openmathserver/context.py

    r50225a r9a95b3  
    44from omexceptions import *
    55from objects import *
     6from re import sub
    67class Context(object):
    78    #TODO: Referenzen durch scope richtig behandeln
     
    910        self.scope=Scope()
    1011        self.implementations={}
     12        self.XMLEncoder=SimpleXMLEncoder()
    1113    def addCDImplementation(self, implementation):
    1214        self.implementations[implementation.cd]=implementation
     
    6062    def apply(self,func,args):
    6163        return func(self,*args)
    62        
     64    def XMLEncodeBody(self,body):
     65        return self.XMLEncoder.encode(body)
     66
     67class SimpleXMLEncoder(object):
     68    def encode(self, string):
     69        return sub("<","&lt;",sub("&","&amp;",string))
     70       
    6371class Scope(object):
    6472    def __init__(self):
Note: See TracChangeset for help on using the changeset viewer.