Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ovos_utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_ovos_config():
else:
subcores = config.get("submodule_mappings") or {}
for k in subcores:
if _is_running_from_module(k):
if is_running_from_module(k):
config = merge_dict(config, cores[subcores[k]])
break

Expand Down
30 changes: 5 additions & 25 deletions ovos_utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import tempfile
from ovos_utils.bracket_expansion import expand_options
from ovos_utils.log import LOG
from ovos_utils.system import search_mycroft_core_location


def get_temp_path(*args):
Expand Down Expand Up @@ -61,18 +62,12 @@ def resolve_ovos_resource_file(res_name):
if os.path.isfile(filename):
return filename

# let's look in ovos_workshop if it's installed
try:
import ovos_workshop
pkg_dir = dirname(ovos_workshop.__file__)
filename = join(pkg_dir, "res", res_name)
if os.path.isfile(filename):
return filename
filename = join(pkg_dir, "res", "ui", res_name)
# let's look in mycroft/ovos-core if it's installed
path = search_mycroft_core_location()
if path:
filename = join(path, "mycroft", "res", res_name)
if os.path.isfile(filename):
return filename
except:
pass
return None # Resource cannot be resolved


Expand Down Expand Up @@ -125,21 +120,6 @@ def resolve_resource_file(res_name, root_path=None, config=None):
if found:
return found

# Finally look for it in the source package
paths = [
"/opt/venvs/mycroft-core/lib/python3.7/site-packages/", # mark1/2
"/opt/venvs/mycroft-core/lib/python3.4/site-packages/ ",
# old mark1 installs
"/home/pi/mycroft-core" # picroft
]
if root_path:
paths += [root_path]
for p in paths:
filename = os.path.join(p, 'mycroft', 'res', res_name)
filename = os.path.abspath(os.path.normpath(filename))
if os.path.isfile(filename):
return filename

return None # Resource cannot be resolved


Expand Down