Skip to content

Commit 818f3b9

Browse files
Changes from AML.
1 parent c1ad063 commit 818f3b9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

resources/constants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
# Addon options and tuneables.
3636
# -------------------------------------------------------------------------------------------------
3737
# Compact, smaller size, non-human readable JSON. False forces human-readable JSON for development.
38-
# In AEL speed is not as critical so False. In AML this must be True when releasing.
38+
# In AEL speed is not as critical so False is OK.
39+
# In AML this must be True when releasing.
3940
OPTION_COMPACT_JSON = False
4041

4142
# Use less memory when writing big JSON files, but writing is slower.
42-
# In AEL this can be False when releasing. In AML it must be True.
43+
# In AEL this can be False when releasing.
44+
# In AML it must be True when releasing.
4345
OPTION_LOWMEM_WRITE_JSON = False
4446

4547
# The addon name in the GUI. Title of Kodi dialogs (yesno, progress, etc.) and used also in log functions.

resources/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ def utils_load_JSON_file(json_filename, default_obj = {}, verbose = True):
365365
# Note that there is a bug in the json module where the ensure_ascii=False flag can produce
366366
# a mix of unicode and str objects.
367367
# See http://stackoverflow.com/questions/18337407/saving-utf-8-texts-in-json-dumps-as-utf8-not-as-u-escape-sequence
368-
def utils_write_JSON_file(json_filename, json_data, verbose = True, pprint = False, lowmem = False):
368+
def utils_write_JSON_file(json_filename, json_data, verbose = True, pprint = False):
369369
l_start = time.time()
370370
if verbose: log_debug('utils_write_JSON_file() "{}"'.format(json_filename))
371371

372372
# Choose JSON iterative encoder or normal encoder.
373-
if lowmem:
374-
if verbose: log_debug('utils_write_JSON_file() Using lowmem option')
373+
if OPTION_LOWMEM_WRITE_JSON:
374+
if verbose: log_debug('utils_write_JSON_file() Using OPTION_LOWMEM_WRITE_JSON option')
375375
if pprint:
376376
jobj = json.JSONEncoder(ensure_ascii = False, sort_keys = True,
377377
indent = JSON_INDENT, separators = JSON_SEP)
@@ -396,7 +396,7 @@ def utils_write_JSON_file(json_filename, json_data, verbose = True, pprint = Fal
396396
# Write JSON to disk
397397
try:
398398
with io.open(json_filename, 'wt', encoding = 'utf-8') as file:
399-
if lowmem:
399+
if OPTION_LOWMEM_WRITE_JSON:
400400
# Chunk by chunk JSON writer, uses less memory but takes longer.
401401
for chunk in jobj.iterencode(json_data):
402402
file.write(text_type(chunk))

0 commit comments

Comments
 (0)