Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Bugfix: Move misc dirctory to /usr/share/rkd
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Nov 26, 2020
1 parent a8717be commit 6d087dd
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include rkd/misc *
1 change: 1 addition & 0 deletions rkd/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def create_unified_context(self, chdir: str = '', additional_imports: List[str]
paths = [
CURRENT_SCRIPT_PATH + '/internal',
'/usr/lib/rkd',
'/usr/share/rkd/internal',
os.path.expanduser('~/.rkd'),
os.getcwd() + '/.rkd'
]
Expand Down
Empty file removed rkd/internal/__init__.py
Empty file.
Empty file removed rkd/misc/__init__.py
Empty file.
File renamed without changes.
3 changes: 3 additions & 0 deletions rkd/standardlib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ def execute(self, ctx: ExecutionContext) -> bool:

template_structure_path = os.path.dirname(os.path.realpath(__file__)) + '/../misc/initial-structure'

if not os.path.isdir(template_structure_path):
template_structure_path = '/usr/lib/rkd/initial-structure/'

self.on_startup(ctx)

# 1) Create structure from template
Expand Down
3 changes: 2 additions & 1 deletion rkd/yaml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def get_lookup_paths(self, subdirectory: str) -> List[str]:
for path in global_paths:
paths.append(path + '/' + subdirectory)

paths.append(CURRENT_SCRIPT_PATH + '/internal/' + subdirectory)
paths.append(CURRENT_SCRIPT_PATH + '/misc/internal/' + subdirectory)
paths.append('/usr/share/rkd/internal')

return list(dict.fromkeys(paths))
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ keywords =
distutils

[files]
data-files = /usr/share/rkd = ./rkd/misc/*
packages_root = ./
packages =
rkd
Expand Down
2 changes: 1 addition & 1 deletion test/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_loads_internal_context(self) -> None:
"""Test if internal context (RKD by default has internal context) is loaded properly
"""
discovery = ContextFactory(NullSystemIO())
ctx = discovery._load_context_from_directory(CURRENT_SCRIPT_PATH + '/../rkd/internal')
ctx = discovery._load_context_from_directory(CURRENT_SCRIPT_PATH + '/../rkd/misc/internal')

self.assertTrue(isinstance(ctx, ApplicationContext))

Expand Down

0 comments on commit 6d087dd

Please sign in to comment.