|
Revision 165, 1.7 kB
(checked in by jajcus, 2 years ago)
|
- addresses updated
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
import sys |
|---|
| 21 |
import os.path |
|---|
| 22 |
import logging |
|---|
| 23 |
|
|---|
| 24 |
from jjigw.common import JJIGWFatalError |
|---|
| 25 |
from jjigw.config import Config |
|---|
| 26 |
from jjigw.component import Component |
|---|
| 27 |
|
|---|
| 28 |
def main(profile=False): |
|---|
| 29 |
config_dir,data_dir=".","." |
|---|
| 30 |
|
|---|
| 31 |
try: |
|---|
| 32 |
logger=logging.getLogger() |
|---|
| 33 |
logger.addHandler(logging.StreamHandler()) |
|---|
| 34 |
logger.setLevel(logging.DEBUG) |
|---|
| 35 |
try: |
|---|
| 36 |
config=Config(config_dir,data_dir) |
|---|
| 37 |
except: |
|---|
| 38 |
print >>sys.stderr,"Couldn't load config file:",str(sys.exc_value) |
|---|
| 39 |
sys.exit(1) |
|---|
| 40 |
|
|---|
| 41 |
print "creating component..." |
|---|
| 42 |
c=Component(config,profile=profile) |
|---|
| 43 |
|
|---|
| 44 |
print "starting..." |
|---|
| 45 |
c.run(1) |
|---|
| 46 |
except JJIGWFatalError,e: |
|---|
| 47 |
print e |
|---|
| 48 |
print "Aborting." |
|---|
| 49 |
sys.exit(1) |
|---|
| 50 |
|
|---|
| 51 |
if '--profile' in sys.argv: |
|---|
| 52 |
import profile |
|---|
| 53 |
sys.argv.remove('--profile') |
|---|
| 54 |
profile.run("main(profile=True)","jjigw.prof") |
|---|
| 55 |
else: |
|---|
| 56 |
main() |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|