diff --git a/common/lib/symmath/symmath/formula.py b/common/lib/symmath/symmath/formula.py
index 79c4797076..1dbabbb3b8 100644
--- a/common/lib/symmath/symmath/formula.py
+++ b/common/lib/symmath/symmath/formula.py
@@ -600,21 +600,16 @@ class formula(object):
"""
Handle requests to snuggletex API to convert the Ascii math to MathML
"""
- # url = 'http://192.168.1.2:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo'
- # url = 'http://127.0.0.1:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo'
url = 'https://math-xserver.mitx.mit.edu/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo'
- if 1:
- payload = {
- 'asciiMathInput': asciimath,
- 'asciiMathML': mathml,
- #'asciiMathML':unicode(mathml).encode('utf-8'),
- }
- headers = {'User-Agent': "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"}
- request = requests.post(url, data=payload, headers=headers, verify=False)
- request.encoding = 'utf-8'
- ret = request.text
- # print "encoding: ", request.encoding
+ payload = {
+ 'asciiMathInput': asciimath,
+ 'asciiMathML': mathml,
+ }
+ headers = {'User-Agent': "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"}
+ request = requests.post(url, data=payload, headers=headers, verify=False)
+ request.encoding = 'utf-8'
+ ret = request.text
mode = 0
cmathml = []
@@ -629,153 +624,4 @@ class formula(object):
cmathml.append(k)
cmathml = '\n'.join(cmathml[2:])
cmathml = ''
- # print cmathml
return cmathml
-
-#-----------------------------------------------------------------------------
-
-
-def test1():
- """Test XML strings - addition"""
- xmlstr = """
-
- """
- return formula(xmlstr)
-
-
-def test2():
- """Test XML strings - addition, Greek alpha"""
- xmlstr = u"""
-
- """
- return formula(xmlstr)
-
-
-def test3():
- """Test XML strings - addition, Greek gamma"""
- xmlstr = """
-
- """
- return formula(xmlstr)
-
-
-def test4():
- """Test XML strings - addition, Greek alpha, mfrac"""
- xmlstr = u"""
-
-"""
- return formula(xmlstr)
-
-
-def test5():
- """Test XML strings - sum of two matrices"""
- xmlstr = u"""
-
-"""
- return formula(xmlstr)
-
-
-def test6():
- """Test XML strings - imaginary numbers"""
- xmlstr = u"""
-
-"""
- return formula(xmlstr, options='imaginary')