summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8a42d3f)
Since the switch to YAML, quotations around strings are
automatically interpreted an so not included in the parsed result.
Remove legacy code which stripped leading and trailing quotes from
string values as this is no longer needed.
):
"""Return an absolute file path based on configuration."""
):
"""Return an absolute file path based on configuration."""
- # make sure to get rid of any surrounding quotes first thing
- if file_name:
- file_name = file_name.strip("\"'")
-
# this is all unnecessary if it's already absolute
if file_name and os.path.isabs(file_name):
return os.path.realpath(file_name)
# this is all unnecessary if it's already absolute
if file_name and os.path.isabs(file_name):
return os.path.realpath(file_name)
) and "internal:storage" in universe.contents:
storage = universe.categories["internal"]["storage"]
if not root_path:
) and "internal:storage" in universe.contents:
storage = universe.categories["internal"]["storage"]
if not root_path:
- root_path = storage.get("root_path").strip("\"'")
+ root_path = storage.get("root_path")
if not search_path:
search_path = storage.get("search_path")
if not default_dir:
if not search_path:
search_path = storage.get("search_path")
if not default_dir:
- default_dir = storage.get("default_dir").strip("\"'")
+ default_dir = storage.get("default_dir")
# if there's only one file loaded, try to work around a chicken<egg
elif hasattr(universe, "files") and len(
# if there's only one file loaded, try to work around a chicken<egg
elif hasattr(universe, "files") and len(
# if an existing file or directory reference was supplied, prepend it
if relative:
# if an existing file or directory reference was supplied, prepend it
if relative:
- relative = relative.strip("\"'")
if os.path.isdir(relative):
search_path = [relative] + search_path
else:
if os.path.isdir(relative):
search_path = [relative] + search_path
else:
# make the search path entries absolute and throw away any dupes
clean_search_path = []
for each_path in search_path:
# make the search path entries absolute and throw away any dupes
clean_search_path = []
for each_path in search_path:
- each_path = each_path.strip("\"'")
if not os.path.isabs(each_path):
each_path = os.path.realpath(os.path.join(root_path, each_path))
if each_path not in clean_search_path:
if not os.path.isabs(each_path):
each_path = os.path.realpath(os.path.join(root_path, each_path))
if each_path not in clean_search_path: