librefi/librefi/__init__.py

32 lines
706 B
Python
Raw Normal View History

2020-11-29 01:14:58 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2020-12-03 08:25:22 +01:00
import sys
2020-11-29 01:14:58 +01:00
from .librefi import LibreFi
2020-12-03 08:25:22 +01:00
from .logger import _Logger, LOG_LEVELS
from .utils import LFiError, FxckerError
def _real_main(argv=None):
librefi = LibreFi(logger=_Logger, log_level=LOG_LEVELS.DEBUG)
librefi._periodical_check()
def main(argv=None):
try:
_real_main(argv)
except LFiError:
sys.exit('ERROR (core): report this to librefi@selfisekai.rocks')
except FxckerError:
sys.exit('ERROR (fxcker): report this to librefi@selfisekai.rocks')
except KeyboardInterrupt:
sys.exit('\nERROR: Interrupted by user')
2020-11-29 01:14:58 +01:00
2020-12-03 08:25:22 +01:00
__all__ = [
'LibreFi',
'main',
'_real_main',
]