16
16
SymbolFullForm ,
17
17
SymbolGraphics ,
18
18
SymbolGraphics3D ,
19
+ SymbolInputForm ,
19
20
SymbolMathMLForm ,
20
21
SymbolOutputForm ,
21
22
SymbolStandardForm ,
@@ -84,31 +85,31 @@ def eval_boxes(result, fn: Callable, obj, **options):
84
85
result = expr .elements [0 ].format (obj , expr_type )
85
86
return result .boxes_to_text ()
86
87
elif expr_head is SymbolGraphics :
87
- result = Expression (SymbolStandardForm , expr ).format (obj , "System`MathMLForm" )
88
+ result = Expression (SymbolStandardForm , expr ).format (obj , SymbolMathMLForm )
88
89
89
90
# This part was derived from and the same as evaluation.py format_output.
90
91
91
92
use_quotes = get_settings_value (obj .definitions , "Settings`$QuotedStrings" )
92
93
93
94
if format == "text" :
94
- result = expr .format (obj , "System`OutputForm" )
95
+ result = expr .format (obj , SymbolOutputForm )
95
96
result = eval_boxes (result , result .boxes_to_text , obj )
96
97
97
98
if use_quotes :
98
99
result = '"' + result + '"'
99
100
100
101
return result
101
102
elif format == "xml" :
102
- result = Expression (SymbolStandardForm , expr ).format (obj , "System`MathMLForm" )
103
+ result = Expression (SymbolStandardForm , expr ).format (obj , SymbolMathMLForm )
103
104
elif format == "tex" :
104
- result = Expression (SymbolStandardForm , expr ).format (obj , "System`TeXForm" )
105
+ result = Expression (SymbolStandardForm , expr ).format (obj , SymbolTeXForm )
105
106
elif format == "unformatted" :
106
107
if expr_head is PyMathicsGraph and hasattr (expr , "G" ):
107
108
return format_graph (expr .G )
108
109
if expr_head is SymbolCompiledFunction :
109
- result = expr .format (obj , "System`OutputForm" )
110
+ result = expr .format (obj , SymbolOutputForm )
110
111
elif expr_head is SymbolString :
111
- result = expr .format (obj , "System`InputForm" )
112
+ result = expr .format (obj , SymbolInputForm )
112
113
result = result .boxes_to_text ()
113
114
114
115
if not use_quotes :
@@ -118,16 +119,14 @@ def eval_boxes(result, fn: Callable, obj, **options):
118
119
return result
119
120
elif expr_head is SymbolGraphics3D :
120
121
form_expr = Expression (SymbolStandardForm , expr )
121
- result = form_expr .format (obj , "System`StandardForm" )
122
+ result = form_expr .format (obj , SymbolStandardForm )
122
123
return eval_boxes (result , result .boxes_to_js , obj )
123
124
elif expr_head is SymbolGraphics :
124
125
form_expr = Expression (SymbolStandardForm , expr )
125
- result = form_expr .format (obj , "System`StandardForm" )
126
+ result = form_expr .format (obj , SymbolStandardForm )
126
127
return eval_boxes (result , result .boxes_to_svg , obj )
127
128
else :
128
- result = Expression (SymbolStandardForm , expr ).format (
129
- obj , "System`MathMLForm"
130
- )
129
+ result = Expression (SymbolStandardForm , expr ).format (obj , SymbolMathMLForm )
131
130
else :
132
131
raise ValueError
133
132
0 commit comments