Skip to content

Commit

Permalink
Update cli.py to work with java sdk (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
devPalacio authored Jul 20, 2023
1 parent af56116 commit 02feff3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stone/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def main():
# The module should should contain an api variable that references a
# :class:`stone.api.Api` object.
try:
api_module = _load_module('api', args.api[0])
api_module = _load_module(args.api[0])
api = api_module.api # pylint: disable=redefined-outer-name
except ImportError as e:
print('error: Could not import API description due to:',
Expand Down Expand Up @@ -341,7 +341,7 @@ def main():
if new_python_path not in sys.path:
sys.path.append(new_python_path)
try:
backend_module = _load_module('user_backend', args.backend)
backend_module = _load_module(args.backend)
except Exception:
print("error: Importing backend '%s' module raised an exception:" %
args.backend, file=sys.stderr)
Expand All @@ -367,7 +367,7 @@ def main():
# easier to do debugging.
return api

def _load_module(name, path):
def _load_module(path):
file_name = os.path.basename(path)
module_name = file_name.replace('.', '_')

Expand All @@ -379,8 +379,8 @@ def _load_module(name, path):
loader = importlib.machinery.SourceFileLoader(module_name, path)
module = loader.load_module() # pylint: disable=deprecated-method,no-value-for-parameter

sys.modules[name] = module

sys.modules[module_name] = module
logging.info("Loading module: %s", module_name)
return module

if __name__ == '__main__':
Expand Down

0 comments on commit 02feff3

Please sign in to comment.