libjam 0.0.12__py3-none-any.whl → 0.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
libjam/notebook.py
CHANGED
@@ -107,16 +107,18 @@ class Notebook:
|
|
107
107
|
parser.write(file)
|
108
108
|
|
109
109
|
# Reads a given json file as a dictionary.
|
110
|
+
# Returns None if file doesn't exist.
|
110
111
|
def read_json(self, json_file: str):
|
111
112
|
if drawer.is_file(json_file) is False:
|
112
113
|
return None
|
113
114
|
json_file = drawer.absolute_path(json_file)
|
114
115
|
json_string = open(json_file, 'r').read()
|
116
|
+
json_string = json_string.replace('null', 'None')
|
117
|
+
# Trying the sane method
|
115
118
|
try:
|
116
119
|
data = json.loads(json_string)
|
120
|
+
# Exception in case json contains multiline values
|
117
121
|
except json.decoder.JSONDecodeError:
|
118
|
-
json_string =
|
122
|
+
json_string = ' '.join(json_string.split())
|
119
123
|
data = ast.literal_eval(json_string)
|
120
|
-
except:
|
121
|
-
data = None
|
122
124
|
return data
|
@@ -3,9 +3,9 @@ libjam/captain.py,sha256=igx-ecKJBI_vBN-pW7KmSEnmYMIHQEb9tFzpy5qHmI8,5636
|
|
3
3
|
libjam/clipboard.py,sha256=5HxlO8ztLJPlnSCq4PncGvY4JGc9C4J2uHcepjC6zmg,3496
|
4
4
|
libjam/drawer.py,sha256=vKL1iN8chHjXZRsTdmhE8qpDaZAgh7Orx5KtrvgplcE,12100
|
5
5
|
libjam/flashcard.py,sha256=ulV4KPC3BRWLxwkQ87vsY0aM38nYpzOjUOISxTIRVDg,437
|
6
|
-
libjam/notebook.py,sha256=
|
6
|
+
libjam/notebook.py,sha256=UFgTEXESVYUWlghMEXhzgHFmGgnrsB7sWUcr5UvjC7k,4534
|
7
7
|
libjam/typewriter.py,sha256=waKY1sDxGzI2ZT5dSzFmLGbaNTIpEM5Zhg_OlPFUAng,3730
|
8
|
-
libjam-0.0.
|
9
|
-
libjam-0.0.
|
10
|
-
libjam-0.0.
|
11
|
-
libjam-0.0.
|
8
|
+
libjam-0.0.13.dist-info/METADATA,sha256=2C-lbT2WVaYap5l7HiH6Zs2ZYTWrOXMCr8_PM4VbmiE,2141
|
9
|
+
libjam-0.0.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
10
|
+
libjam-0.0.13.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
11
|
+
libjam-0.0.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|