#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2010-2011 Emmanuel Blot <*****@*****.**> # Copyright (c) 2010-2011 Neotion # Copyright (c) 2012-2013 Vladimir Lazarenko <*****@*****.**> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import sys from pybootd.daemons import main if __name__ == "__main__": main()
LOG.error(context.get("message")) ex = context.get("exception") if ex: LOG.exception(ex) def _run_async_loop(loop): LOG.debug("run_async_loop") threading.current_thread().name = "AsyncLoopThread" pythoncom.CoInitialize() trollius.set_event_loop(loop) try: loop.run_forever() except Exception as ex: LOG.exception(ex) finally: loop.close() if __name__ == "__main__": if len(sys.argv) > 1 and sys.argv[1] == 'pybootd': del sys.argv[1] pybootd_daemons.main() else: if len(sys.argv) == 3 and sys.argv[1] == 'openurl': main(sys.argv[2]) else: main()