-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
unprompted_dry.py
39 lines (29 loc) · 1.24 KB
/
unprompted_dry.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Unprompted by Therefore Games. All Rights Reserved.
# https://patreon.com/thereforegames
# https://github.com/ThereforeGames/unprompted
# This assumes Unprompted is in the same directory as this script (see below for an alternative import method)
from lib_unprompted.shared import Unprompted
# Main object
Unprompted = Unprompted()
# Note! If Unprompted is located elsewhere (e.g. as a package), you should be able to import it like this instead:
# import inspect, os, sys
# import unprompted.lib_unprompted.shared
# module_path = os.path.dirname(os.path.dirname(inspect.getfile(unprompted.lib_unprompted.shared.Unprompted)))
# Ensure that Unprompted imports are available at all times:
# sys.path.insert(0, f"{module_path}")
# Unprompted = unprompted.lib_unprompted.shared.Unprompted(module_path)
def do_unprompted(string):
# Reset vars
Unprompted.shortcode_user_vars = {}
# TODO: We may want to declare our own log level for the result message
Unprompted.log.info(Unprompted.start(string))
# Cleanup routines
Unprompted.cleanup()
Unprompted.goodbye()
# Allows user input indefinitely
while True:
try:
command = input("(INPUT) Unprompted string:")
do_unprompted(command)
except Exception as e:
Unprompted.log.exception("Exception occurred.")