Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate pymathics doc #778

Merged
merged 10 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions mathics/builtin/assignments/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
assign_store_rules_by_tag,
normalize_lhs,
)
from mathics.core.atoms import String
from mathics.core.attributes import (
A_HOLD_ALL,
A_HOLD_FIRST,
Expand Down Expand Up @@ -66,17 +67,17 @@ class LoadModule(Builtin):
<dd>'Load Mathics definitions from the python module $module$
</dl>
>> LoadModule["nomodule"]
: Python module nomodule does not exist.
: Python import errors with: No module named 'nomodule'.
= $Failed
>> LoadModule["sys"]
: Python module sys is not a pymathics module.
: Python module "sys" is not a Mathics3 module.
= $Failed
"""

name = "LoadModule"
messages = {
"notfound": "Python module `1` does not exist.",
"notmathicslib": "Python module `1` is not a pymathics module.",
"loaderror": """Python import errors with: `1`.""",
"notmathicslib": """Python module "`1`" is not a Mathics3 module.""",
}
summary_text = "load a pymathics module"

Expand All @@ -87,8 +88,8 @@ def eval(self, module, evaluation):
except PyMathicsLoadException:
evaluation.message(self.name, "notmathicslib", module)
return SymbolFailed
except ImportError:
evaluation.message(self.get_name(), "notfound", module)
except Exception as e:
evaluation.message(self.get_name(), "loaderror", String(str(e)))
return SymbolFailed
return module

Expand Down
Loading