forked from Flexget/Flexget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
39 lines (30 loc) · 1.02 KB
/
__init__.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
#!/usr/bin/python
from __future__ import unicode_literals, division, absolute_import, print_function
from ._version import __version__
import logging
import os
import sys
from flexget import logger, plugin
from flexget.manager import Manager
log = logging.getLogger('main')
def main(args=None):
"""Main entry point for Command Line Interface"""
logger.initialize()
try:
manager = Manager(args)
except (IOError, ValueError) as e:
print('Could not instantiate manager: %s' % e, file=sys.stderr)
sys.exit(1)
try:
if manager.options.profile:
try:
import cProfile as profile
except ImportError:
import profile
profile.runctx('manager.start()', globals(), locals(),
os.path.join(manager.config_base, manager.options.profile))
else:
manager.start()
except (IOError, ValueError) as e:
print('Could not start manager: %s' % e, file=sys.stderr)
sys.exit(1)