Commit Graph

342 Commits

Author SHA1 Message Date
Salvo 'LtWorf' Tomaselli
482704be81 Only show the tuple, not the full context 2020-08-30 19:42:06 +02:00
Salvo 'LtWorf' Tomaselli
821b96c6e8 Force \n as endline
Closes: #15

On windows python uses \r\n when saving, but \n when loading so it is a mess.

So i need to force it.
2020-08-30 19:42:00 +02:00
Salvo 'LtWorf' Tomaselli
1a5e78d6d4 Fix crash on empty text 2020-08-27 15:03:57 +02:00
Salvo 'LtWorf' Tomaselli
15026ddb0d Make mypy happy 2020-08-26 21:17:04 +02:00
Salvo 'LtWorf' Tomaselli
96404b4d98 Add pretty print function 2020-08-26 21:17:04 +02:00
Salvo 'LtWorf' Tomaselli
ea1d5f9752 Load json without casting
It will avoid json stuff cast as string.

It is a workaround for this https://github.com/ltworf/typedload/pull/140

But anyway cast is not needed so it is fine to disable it.
2020-08-26 21:16:36 +02:00
Salvo 'LtWorf' Tomaselli
9d6402b48c Make a bunch of stuff private
Only export the entry points, not all the inner functions.
2020-08-26 17:26:55 +02:00
Salvo 'LtWorf' Tomaselli
a727c51e75 Handle new parser nodes 2020-08-26 17:16:14 +02:00
Salvo 'LtWorf' Tomaselli
1181042ee0 Handle empty context 2020-08-26 17:15:51 +02:00
Salvo 'LtWorf' Tomaselli
7228c86d72 I had completely forgotten about multiline optimizations 2020-08-26 17:14:22 +02:00
Salvo 'LtWorf' Tomaselli
ae2e838df2 Fix cli for the double format 2020-08-24 19:09:20 +02:00
Salvo 'LtWorf' Tomaselli
a110f3f2c5 GUI manage json files 2020-08-24 19:09:20 +02:00
Salvo 'LtWorf' Tomaselli
5a271dce1d Usual mypy workaround
https://github.com/ltworf/typedload/issues/132

https://github.com/python/mypy/issues/9003
2020-08-24 19:08:52 +02:00
Salvo 'LtWorf' Tomaselli
177ca5a3ee Values can be None 2020-08-24 18:42:18 +02:00
Salvo 'LtWorf' Tomaselli
0920559a82 Make mypy happy 2020-08-24 18:38:10 +02:00
Salvo 'LtWorf' Tomaselli
d592cc3050 Fix json loading
With some small amount of error detection.
2020-08-24 18:37:19 +02:00
Salvo 'LtWorf' Tomaselli
4d81858c8b Make Rdate into something typedload can handle 2020-08-24 18:02:11 +02:00
Salvo 'LtWorf' Tomaselli
c4bc74d612 Add a new json format 2020-08-24 18:02:11 +02:00
Salvo 'LtWorf' Tomaselli
2e5d18f418 Switch to dataclass
NamedTuple has some bug that makes dumping broken
2020-08-24 18:02:11 +02:00
Salvo 'LtWorf' Tomaselli
4c101526e6 Use None instead o a special string 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
33a2a21617 Fix types 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
18d6f5ebfb Remove add and sub from Rdate
They were not symmetrical, better to remove them.
2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
4dc7f131f3 Only use eq 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
774c8eed67 Compare to anything 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
b69fd0980b Do not clash names 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
b86c0c6a61 Remove leftover print 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
69f7e83626 Fix printing 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
90b3163e32 Add the --- token bare 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
5c8cbde27a No autocasts needed
All casting is done when loading
2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
7800a157bf Convert Rdate object to keep working 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
73aa0dd2a1 New code to guess types 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
f410b112af Use the new by column type detection 2020-08-24 18:02:10 +02:00
Salvo 'LtWorf' Tomaselli
5259921bb1 Better error message 2020-08-24 18:02:09 +02:00
Salvo 'LtWorf' Tomaselli
aea763021c Remove useless new object 2020-08-24 18:02:09 +02:00
Salvo 'LtWorf' Tomaselli
c246c0715d Remove useless operations 2020-08-24 18:02:09 +02:00
Salvo 'LtWorf' Tomaselli
ccfdff6fd3 Use fstrings 2020-08-15 21:25:35 +02:00
Salvo 'LtWorf' Tomaselli
1bbef1f1b8 function to load a relation from iterators 2020-08-15 20:54:58 +02:00
Salvo 'LtWorf' Tomaselli
519cc35b18 Use lists for partial content
So conversion to set is done only once.
2020-08-15 09:17:23 +02:00
Salvo 'LtWorf' Tomaselli
683ff6f26d Better typing 2020-08-13 14:38:42 +02:00
Salvo 'LtWorf' Tomaselli
08e5131479 Removed update/insert/delete
I don't use them and AFAIK this module has no other users
2020-08-13 14:37:55 +02:00
Salvo 'LtWorf' Tomaselli
4722c9b0e8 Relations are now frozen 2020-08-13 14:34:57 +02:00
Salvo 'LtWorf' Tomaselli
87ec732d24 Use the new API 2020-08-13 14:34:57 +02:00
Salvo 'LtWorf' Tomaselli
be9fdd2e84 Make relation immutable 2020-08-13 14:34:54 +02:00
Salvo 'LtWorf' Tomaselli
456a89be93 Remove backwards compatibility 2020-08-13 10:20:29 +02:00
Salvo 'LtWorf' Tomaselli
8df4d45aba Define public members 2020-08-13 10:20:29 +02:00
Salvo 'LtWorf' Tomaselli
9d1f25d65d Parse unary expressions left to right and fail if extra tokens are found
This fixes the case where there is garbage after a valid unary operator.
2020-08-12 20:16:40 +02:00
Salvo 'LtWorf' Tomaselli
2ceaa3e1db The final rename 2020-08-12 17:35:55 +02:00
Salvo 'LtWorf' Tomaselli
731327c079 Var rename 2020-08-12 17:34:46 +02:00
Salvo 'LtWorf' Tomaselli
fbef0f9deb Make mypy happy 2020-08-12 17:32:41 +02:00
Salvo 'LtWorf' Tomaselli
6fcb5ecb85 Bring more happyness to mypy 2020-08-12 15:33:41 +02:00