Skip to content

Commit a3d5ee7

Browse files
committed
Add data directory to search paths on WizardLoader
1 parent 5c85f99 commit a3d5ee7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

awsshell/app.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import logging
1010
import sys
1111

12+
import botocore.session
13+
1214
from prompt_toolkit.document import Document
1315
from prompt_toolkit.shortcuts import create_eventloop
1416
from prompt_toolkit.buffer import Buffer
@@ -154,7 +156,17 @@ def __init__(self, output=sys.stdout, err=sys.stderr, loader=None):
154156
self._err = err
155157
self._wizard_loader = loader
156158
if self._wizard_loader is None:
157-
self._wizard_loader = WizardLoader()
159+
session = self._initalize_session()
160+
self._wizard_loader = WizardLoader(session=session)
161+
162+
def _initalize_session(self):
163+
"""Get a session and append the data directory to search paths."""
164+
session = botocore.session.get_session()
165+
data_loader = session.get_component('data_loader')
166+
shell_root_dir = os.path.dirname(os.path.abspath(__file__))
167+
data_path = os.path.join(shell_root_dir, 'data')
168+
data_loader.search_paths.append(data_path)
169+
return session
158170

159171
def run(self, command, application):
160172
"""Run the specified wizard.

0 commit comments

Comments
 (0)