-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathchain.py
executable file
·49 lines (35 loc) · 1.31 KB
/
chain.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
40
41
42
43
44
45
46
47
48
49
"""
This application transmits a collection of raw video material through configurable networks and stores the
obtained results.
"""
__author__ = 'Alexander Dethof'
from chainApp.processingChain import ProcessingChain
# True if the error warnings should be displayed more detailed; False if the error messages should be just shown and
# the application should exit by displaying it. By default the debug mode is set to false!
DEBUG_MODE = False
def __execute_chain():
"""
Creates a new processing chain and executes it
"""
processing_chain = ProcessingChain()
try:
from atexit import register
register(processing_chain.cleanup)
processing_chain.execute()
except KeyboardInterrupt:
processing_chain.cleanup()
if __name__ == '__main__':
# announce application name + version!
app_text = ' %s %s ' % (ProcessingChain.APPLICATION_NAME, ProcessingChain.VERSION_NAME)
print
print ' \x1b[41m\033[1m%s\033[0m' % (' ' * len(app_text))
print ' \x1b[41m\033[1m%s\033[0m' % app_text
print ' \x1b[41m\033[1m%s\033[0m' % (' ' * len(app_text))
print
if DEBUG_MODE:
__execute_chain()
else:
try:
__execute_chain()
except BaseException, e:
exit('\033[1m\033[91m%s:\033[0m %s' % (e.__class__.__name__, str(e)))