Skip to content

Commit c72f76a

Browse files
authored
Revise Import. Add ZIP import. (#1841)
Start redoing `Import` * Add `eval_FindFile` and `eval_FileFormat`. Use these instead of `Expression(...).evaluate`. * Start handling `ZIP` imports. * Move `Formats` under `SystemFiles` which is where WMA put this. * Start reducing differences in these files; but the files are renamed to `.wl` to avoid confusion with Objective C's `.m` files.
1 parent c2af55a commit c72f76a

27 files changed

Lines changed: 274 additions & 76 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include README.rst
2-
include CHANGES.rst
2+
include CHANGES.md
33
include ChangeLog
44
include COPYING.txt
55
include FUTURE.rst

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ Mathics3 is released under the GNU General Public License Version 3 (GPL3).
7070
:target: https://badge.fury.io/py/Mathics3
7171
.. |PyPI Installs| image:: https://pepy.tech/badge/Mathics3
7272
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/Mathics3.svg
73-
.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/mathics.svg
74-
:target: https://repology.org/project/mathics/versions
73+
.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/mathics3.svg
74+
:target: https://repology.org/project/mathics3/versions

mathics/autoload/formats/Base64/Export.m renamed to mathics/SystemFiles/Formats/Base64/Export.wl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* ::Package:: *)
12

23
Begin["System`Convert`B64Dump`"]
34

@@ -21,6 +22,7 @@
2122
FunctionChannels -> {"FileNames"},
2223
Options -> {"CharacterEncoding", "ByteOrderMark"},
2324
DefaultElement -> "Plaintext",
25+
Encoding -> True
2426
BinaryFormat -> False
2527
]
2628

mathics/autoload/formats/Base64/Import.m renamed to mathics/SystemFiles/Formats/Base64/Import.wl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(* ::Package:: *)
2+
13
Begin["System`Convert`B64Dump`"]
24

35

@@ -21,6 +23,7 @@
2123
FunctionChannels -> {"FileNames"},
2224
AvailableElements -> {"Data"},
2325
DefaultElement -> "Data",
26+
Encoding -> True
2427
Options -> {
2528
"CharacterEncoding"
2629
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(* ::Package:: *)
2+
13
(* CSV Exporter *)
24

35
Begin["System`Convert`TableDump`"]
@@ -8,7 +10,7 @@
810
};
911

1012
CSVExport[strm_OutputStream, data_, OptionsPattern[]]:=
11-
Module[{char, wraplist, sep = OptionValue["FieldSeparators"]},
13+
Module[{char, wraplist, sep = OptionValue["FieldSeparators"]},
1214
If[strm === $Failed, Return[$Failed]];
1315
wraplist[x_] := If[Head[x] === List, x, {x}];
1416
char = Map[ToString, wraplist /@ wraplist[data], {2}];
@@ -21,7 +23,7 @@
2123
System`Convert`TableDump`CSVExport,
2224
FunctionChannels -> {"Streams"},
2325
Options -> {"ByteOrderMark"},
24-
DefaultElement -> "Plaintext",
26+
DefaultElement -> "Data",
2527
BinaryFormat -> False,
2628
Options -> {
2729
"CharacterEncoding",
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(* ::Package:: *)
2+
13
(* CSV Importer *)
24

35
Begin["System`Convert`TableDump`"]
@@ -23,12 +25,13 @@
2325
System`Convert`TableDump`ImportCSV,
2426
{
2527
"Data" :> GetData,
26-
"Grid" :> GetGrid
28+
"Grid" :> GetGrid
2729
},
2830
(* Sources -> ImportExport`DefaultSources["Table"], *)
2931
FunctionChannels -> {"Streams"},
3032
AvailableElements -> {"Data", "Grid"},
3133
DefaultElement -> "Data",
34+
BinaryFormat -> False,
3235
Options -> {
3336
"CharacterEncoding",
3437
"FieldSeparators"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)