-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyji.py
37 lines (27 loc) · 1001 Bytes
/
pyji.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
#! /usr/bin/env python
import sys
import util.opt_parser as parser
from util.toolkit import log, generate_guid, ab_path_to_class, ab_subclass_path_from_action, start_busy_indicator, \
stop_busy_indicator
bi = None
try:
# Begin the Busy indicator
if not parser.options.disableProgress:
bi = start_busy_indicator("")
# Print execution command
log.debug("Executed command '" + " ".join(sys.argv) + "'")
# Generate a unique execution id
guid = generate_guid()
log.debug("Unique PyJi execution ID generated: '" + guid + "'")
# Instantiate specified ActionBundle class (from string)
ab = ab_path_to_class(ab_subclass_path_from_action(parser.action), parser)
except (Exception, KeyboardInterrupt):
# Show error
log.error(str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
raise
finally:
# End the busy indicator
if not parser.options.disableProgress:
stop_busy_indicator(bi)
# Salute!
log.info("Bye bye! :-)")