Fix mutable params + compact names json
This commit is contained in:
@@ -249,14 +249,14 @@ def enum_jsons(bundle_id):
|
||||
yield fname, json.load(fp)
|
||||
|
||||
|
||||
def appids_in_out(selection=['*']):
|
||||
if selection != ['*']:
|
||||
def appids_in_out(selection=None):
|
||||
if selection and selection != ['*']:
|
||||
return selection
|
||||
return [os.path.basename(x) for x in glob.glob(path_out_app('*'))]
|
||||
|
||||
|
||||
def appids_in_data(selection=['*']):
|
||||
if selection != ['*']:
|
||||
def appids_in_data(selection=None):
|
||||
if selection and selection != ['*']:
|
||||
return selection
|
||||
global _all_data_bundle_ids
|
||||
if not _all_data_bundle_ids:
|
||||
@@ -287,6 +287,10 @@ def json_read(path):
|
||||
return json.load(fp)
|
||||
|
||||
|
||||
def json_safe_read(path, fallback=None):
|
||||
return json_read(path) if file_exists(path) else fallback
|
||||
|
||||
|
||||
def json_write(path, obj, pretty=False):
|
||||
with open(path, 'w') as fp:
|
||||
json.dump(obj, fp, indent=2 if pretty else None, sort_keys=pretty)
|
||||
|
||||
Reference in New Issue
Block a user