Skip to content

Commit 030c36e

Browse files
authored
Merge pull request #1368 from mathics/poke1024html-rebase
Import HTML - rebasing from PR #644
2 parents 37911b1 + 8e0ccb6 commit 030c36e

File tree

12 files changed

+1654
-8
lines changed

12 files changed

+1654
-8
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(* HTML Importer *)
2+
3+
Begin["System`Convert`HTML`"]
4+
5+
ImportExport`RegisterImport[
6+
"HTML",
7+
{
8+
"Data" :> HTML`DataImport,
9+
"FullData" :> HTML`FullDataImport,
10+
"Hyperlinks" :> HTML`HyperlinksImport,
11+
"ImageLinks" :> HTML`ImageLinksImport,
12+
"Plaintext" :> HTML`PlaintextImport,
13+
"Source" :> HTML`SourceImport,
14+
"Title" :> HTML`TitleImport,
15+
"XMLObject" :> HTML`XMLObjectImport,
16+
HTML`PlaintextImport
17+
},
18+
{},
19+
AvailableElements -> {"Data", "FullData", "Hyperlinks", "ImageLinks", "Plaintext", "Source", "Title", "XMLObject"},
20+
DefaultElement -> "Plaintext",
21+
FunctionChannels -> {"FileNames"}
22+
]
23+
24+
End[]

mathics/builtin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def is_builtin(var):
145145

146146
disable_file_module_names = [] if ENABLE_FILES_MODULE else ["files_io.files", "files_io.importexport"]
147147

148-
for subdir in ("drawing", "files_io", "numbers", "specialfns",):
148+
for subdir in ("drawing", "files_io", "numbers", "specialfns", "fileformats"):
149149
import_name = f"{__name__}.{subdir}"
150150

151151
if import_name in disable_file_module_names:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
File Formats
3+
4+
Built-in Importers.
5+
6+
"""
7+
8+
# The Built-in Functions are defined in a separate context under the
9+
# System`. For example System`HTML` and System`XML. This is done to not
10+
# pollute the System` namespace.
11+
12+
13+
from mathics.version import __version__ # noqa used in loading to check consistency.

0 commit comments

Comments
 (0)