File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ exclude = [
23
23
"zulip_bots/zulip_bots/bots" ,
24
24
"zulip_bots/zulip_bots/bots_unmaintained" ,
25
25
# Excluded out of laziness:
26
- "zulip_bots/zulip_bots/terminal.py" ,
27
26
"zulip_bots/zulip_bots/simple_lib.py" ,
28
27
"zulip_bots/zulip_bots/tests/test_lib.py" ,
29
28
# Excluded because this is a self-contained script
Original file line number Diff line number Diff line change 9
9
current_dir = os .path .dirname (os .path .abspath (__file__ ))
10
10
11
11
12
- def parse_args ():
12
+ def parse_args () -> argparse . Namespace :
13
13
description = """
14
14
This tool allows you to test a bot using the terminal (and no Zulip server).
15
15
@@ -32,15 +32,21 @@ def parse_args():
32
32
return args
33
33
34
34
35
- def main ():
35
+ def main () -> None :
36
36
args = parse_args ()
37
37
38
- bot_path , bot_name = resolve_bot_path (args .bot )
38
+ # NOTE: Use of only this implies bots from eg. registry cannot be explored in this way
39
+ result = resolve_bot_path (args .bot )
40
+ if result is None :
41
+ print (f"Cannot find find and import bot '{ args .bot } '" )
42
+ sys .exit (1 )
43
+
44
+ bot_path , bot_name = result
39
45
bot_dir = os .path .dirname (bot_path )
40
46
sys .path .insert (0 , bot_dir )
41
47
42
48
try :
43
- lib_module = import_module_from_source (bot_path , bot_name )
49
+ lib_module = import_module_from_source (bot_path . as_posix () , bot_name )
44
50
if lib_module is None :
45
51
raise OSError
46
52
except OSError :
You can’t perform that action at this time.
0 commit comments