Skip to content

Commit 0e6d846

Browse files
authored
Revert "Mathics scanner import"
1 parent 1b5488a commit 0e6d846

File tree

4 files changed

+17
-30
lines changed

4 files changed

+17
-30
lines changed

mathicsscript/__main__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from mathicsscript.format import format_output
1414

15+
from mathics import replace_wl_with_unicode
1516
from mathics.core.parser import FileLineFeeder
1617
from mathics.core.definitions import Definitions
1718
from mathics.core.expression import Symbol, SymbolTrue, SymbolFalse
@@ -20,8 +21,6 @@
2021
from mathics import version_string, license_string
2122
from mathics import settings
2223

23-
from mathics_scanner.characters import replace_wl_with_plain_text
24-
2524
from pygments import highlight
2625
from pygments.lexers import MathematicaLexer
2726

@@ -328,7 +327,7 @@ def main(
328327
current_pos = GNU_readline.get_current_history_length()
329328
for pos in range(last_pos, current_pos - 1):
330329
GNU_readline.remove_history_item(pos)
331-
wl_input = replace_wl_with_plain_text(source_code.rstrip(), use_unicode=unicode)
330+
wl_input = replace_wl_with_unicode(source_code.rstrip())
332331
GNU_readline.add_history(wl_input)
333332

334333
if query is None:
@@ -345,7 +344,7 @@ def main(
345344
query, timeout=settings.TIMEOUT, format="unformatted"
346345
)
347346
if result is not None:
348-
shell.print_result(result, output_style, use_unicode=unicode)
347+
shell.print_result(result, output_style)
349348

350349
except ShellEscapeException as e:
351350
source_code = e.line

mathicsscript/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def format_output(obj, expr, format=None):
1212
format = obj.format
1313

1414
if isinstance(format, dict):
15-
return {k: obj.format_output(expr, f) for k, f in format.items()}
15+
return dict((k, obj.format_output(expr, f)) for k, f in format.items())
1616

1717
from mathics.core.expression import Expression, BoxError
1818

mathicsscript/termshell.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
import sys
1010
import re
1111
from columnize import columnize
12+
from mathics import replace_unicode_with_wl
1213
from mathics.core.expression import Expression, String, Symbol
1314
from mathics.core.expression import strip_context, from_python
1415
from mathics.core.rules import Rule
15-
from mathics_scanner.characters import (
16-
named_characters,
17-
replace_unicode_with_wl,
18-
replace_wl_with_plain_text,
19-
)
16+
from mathics.core.characters import named_characters
2017

2118
from pygments import highlight, lex
2219
from mathicsscript.mmalexer import MathematicaLexer
@@ -256,7 +253,7 @@ def read_line(self, prompt):
256253
raise ShellEscapeException(line)
257254
return replace_unicode_with_wl(line)
258255

259-
def print_result(self, result, output_style="", use_unicode=True):
256+
def print_result(self, result, output_style=""):
260257
if result is None:
261258
# FIXME decide what to do here
262259
return
@@ -270,9 +267,7 @@ def print_result(self, result, output_style="", use_unicode=True):
270267
print(sys.exc_info()[1])
271268
return
272269

273-
out_str = replace_wl_with_plain_text(str(result.result),
274-
use_unicode=use_unicode)
275-
270+
out_str = str(result.result)
276271
if eval_type == "System`Graph":
277272
out_str = "-Graph-"
278273
elif self.terminal_formatter: # pygmentize

setup.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@
1717
import os.path as osp
1818
from setuptools import find_packages
1919

20-
INSTALL_REQUIRES = [
21-
"Mathics-Scanner>=1.0.0dev",
22-
"Mathics3 >= 2.0.0dev",
23-
"click",
24-
"colorama",
25-
"columnize",
26-
"networkx",
27-
"pygments",
28-
"term-background >= 1.0.1",
29-
]
30-
31-
DEPENDENCY_LINKS = [
32-
'http://github.com/Mathics3/mathics-scanner/tarball/master#egg=Mathics-Scanner-1.0.0dev'
33-
]
3420

3521
def get_srcdir():
3622
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
@@ -80,8 +66,15 @@ def read(*rnames):
8066
package_data={
8167
"": ["inputrc", "inputrc-no-unicode", "inputrc-unicode", "settings/settings.m"]
8268
},
83-
install_requires=INSTALL_REQUIRES,
84-
dependency_links=DEPENDENCY_LINKS,
69+
install_requires=[
70+
"Mathics3 >= 2.0.0dev",
71+
"click",
72+
"colorama",
73+
"columnize",
74+
"networkx",
75+
"pygments",
76+
"term-background >= 1.0.1",
77+
],
8578
entry_points={"console_scripts": ["mathicsscript = mathicsscript.__main__:main"]},
8679
long_description=long_description,
8780
long_description_content_type="text/x-rst",

0 commit comments

Comments
 (0)