2016-06-20 10:42:06 +02:00
|
|
|
from PyObjCTools import AppHelper
|
|
|
|
from twisted.internet.cfreactor import install
|
|
|
|
install(runner=AppHelper.runEventLoop)
|
|
|
|
from twisted.internet import reactor
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
2016-10-23 07:33:29 +02:00
|
|
|
from lbrynet import conf
|
|
|
|
from lbrynet.core import log_support
|
2016-06-20 10:42:06 +02:00
|
|
|
from LBRYApp import LBRYDaemonApp
|
|
|
|
|
|
|
|
|
2016-10-23 07:33:29 +02:00
|
|
|
log = logging.getLogger()
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2016-10-31 22:19:19 +01:00
|
|
|
conf.update_settings_from_file()
|
2016-11-01 19:26:03 +01:00
|
|
|
log_file = conf.settings.get_log_filename()
|
2016-11-01 16:57:07 +01:00
|
|
|
log_support.configure_logging(log_file, console=True)
|
2016-06-20 10:42:06 +02:00
|
|
|
app = LBRYDaemonApp.sharedApplication()
|
2016-11-03 22:57:29 +01:00
|
|
|
reactor.addSystemEventTrigger("after", "shutdown", shutdown)
|
2016-06-20 10:42:06 +02:00
|
|
|
reactor.run()
|
|
|
|
|
2016-10-23 07:33:29 +02:00
|
|
|
|
2016-11-03 22:57:29 +01:00
|
|
|
def shutdown():
|
|
|
|
log.info('Stopping event loop')
|
|
|
|
AppHelper.stopEventLoop()
|
|
|
|
|
|
|
|
|
2016-06-20 10:42:06 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|