fix package to work on pip installs
parent
6226b75fc2
commit
1f843d5468
|
@ -1,6 +1,31 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .librefi import LibreFi
|
||||
import sys
|
||||
|
||||
__all__ = ['LibreFi']
|
||||
from .librefi import LibreFi
|
||||
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')
|
||||
|
||||
|
||||
__all__ = [
|
||||
'LibreFi',
|
||||
'main',
|
||||
'_real_main',
|
||||
]
|
||||
|
|
|
@ -9,10 +9,7 @@ if __package__ is None and not hasattr(sys, 'frozen'):
|
|||
path = os.path.realpath(os.path.abspath(__file__))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(path)))
|
||||
|
||||
from librefi import LibreFi
|
||||
from .logger import _Logger, LOG_LEVELS
|
||||
|
||||
librefi = LibreFi(logger=_Logger, log_level=LOG_LEVELS.DEBUG)
|
||||
from librefi import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
librefi._periodical_check()
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue