]> git.ipfire.org Git - ipfire-3.x.git/blame - make.sh
naoki: Refactor logging.
[ipfire-3.x.git] / make.sh
CommitLineData
a6dccbc0
MT
1#!/usr/bin/python
2
66be9e18 3import logging
a6dccbc0 4import sys
66be9e18 5
a6dccbc0
MT
6import naoki
7
0c294e96
MT
8# silence Python 2.6 buggy warnings about Exception.message
9if sys.version_info[:2] == (2, 6):
10 import warnings
11 warnings.filterwarnings(
12 action="ignore",
13 message="BaseException.message has been deprecated as of Python 2.6",
14 category=DeprecationWarning)
15
928cd119
MT
16# Initialize system
17n = naoki.Naoki()
a6dccbc0
MT
18
19try:
928cd119
MT
20 # Run...
21 n.run()
0c294e96 22 exitStatus = 0
a6dccbc0
MT
23
24except (SystemExit,):
25 raise
26
27except (KeyboardInterrupt,):
28 exitStatus = 7
66be9e18 29 logging.error("Exiting on user interrupt, <CTRL>-C")
a6dccbc0
MT
30
31sys.exit(exitStatus)