Skip to content

Commit 84315d8

Browse files
authored
Consolidate more error messages inside mathics.builtin.messages (#1838)
That is in the General section. This will be needed for PyICU improvements.
1 parent 356615c commit 84315d8

6 files changed

Lines changed: 3 additions & 6 deletions

File tree

mathics/autoload/formats/Image/Import.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
FunctionChannels -> {"FileNames"}
1313
];
1414

15-
(* FIXME: RegisterImageImport shoudl work with MIME types, not psuedo-canonicalized file extensions. *)
15+
(* FIXME: RegisterImageImport should work with MIME types, not psuedo-canonicalized file extensions. *)
1616
RegisterImageImport[#]& /@ {"BMP", "GIF", "JPEG2000", "JPEG", "JPG", "PCX", "PNG", "PPM", "PBM", "PGM", "TIFF", "ICO", "TGA"};
1717

1818
End[]

mathics/builtin/files_io/importexport.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import sys
2323
import urllib.request as request
2424
from itertools import chain
25-
from typing import Dict, Final
2625
from urllib.error import HTTPError, URLError
2726

2827
from mathics.core.atoms import ByteArray

mathics/builtin/forms/data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class _NumberForm(Builtin):
128128
"Value for option NumberSeparator -> `1` should be a string "
129129
"or a pair of strings."
130130
),
131-
"opttf": "Value of option `1` -> `2` should be True or False.",
132131
"sigz": (
133132
"In addition to the number of digits requested, one or more "
134133
"zeros will appear as placeholders."

mathics/builtin/list/predicates.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ContainsOnly(Builtin):
4040

4141
messages = {
4242
"lsa": "List or association expected instead of `1`.",
43-
"nodef": "Unknown option `1` for ContainsOnly.",
4443
"optx": "Unknown option `1` in `2`.",
4544
}
4645

mathics/builtin/messages.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class General(Builtin):
220220
"matsq": "Argument `1` is not a non-empty square matrix.",
221221
"newpkg": "In WL, there is a new package for this.",
222222
"nffil": "File not found during `1`.",
223+
"nodef": "Unknown option `1` for `2`.",
223224
"nonopt": "Options expected (instead of `1`) beyond position `2` in `3`. An option must be a rule or a list of rules.",
224225
"noopen": "Cannot open `1`.",
225226
"nord": "Invalid comparison with `1` attempted.",
@@ -228,6 +229,7 @@ class General(Builtin):
228229
"obspkg": "In WL, this package is obsolete.",
229230
"openx": "`1` is not open.",
230231
"optb": "Optional object `1` in `2` is not a single blank.",
232+
"opttf": "Value of option `1` -> `2` should be True or False.",
231233
"ovfl": "Overflow occurred in computation.",
232234
"partd": "Part specification is longer than depth of object.",
233235
"partw": "Part `1` of `2` does not exist.",

mathics/builtin/numbers/algebra.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class _Algebraic(Builtin):
7575

7676
messages = {
7777
"modn": "Value of option `1` -> `2` should be an integer.",
78-
"opttf": "Value of option `1` -> `2` should be True or False.",
7978
"modulus": "Modulus option not supported yet.",
8079
}
8180

@@ -642,7 +641,6 @@ class _Expand(Builtin):
642641

643642
messages = {
644643
"modn": "Value of option `1` -> `2` should be an integer.",
645-
"opttf": "Value of option `1` -> `2` should be True or False.",
646644
}
647645

648646
def convert_options(self, options: dict, evaluation: Evaluation):

0 commit comments

Comments
 (0)