Beispiel #1
0
            import site # @Reimport# @Reimport
            QApplication.addLibraryPath(os.path.dirname(site.getsitepackages()[0]) + "/PyQt5/qt_plugins")
    except Exception:
        pass
        
from artisanlib import main
import numpy # @UnusedImport
from multiprocessing import freeze_support

if system() == "Windows" and (hasattr(sys, "frozen") # new py2exe
                            or hasattr(sys, "importers") # old py2exe
#                            or imp.is_frozen("__main__")): # tools/freeze
                            or getattr(sys, 'frozen', False)): # tools/freeze
    from multiprocessing import set_executable
    executable = os.path.join(os.path.dirname(sys.executable), 'artisan.exe')
    set_executable(executable)    
    del executable

if __name__ == '__main__':
    freeze_support()
    if os.environ.get('TRAVIS'):
        # Hack to exit inside Travis CI
        # Ideally we would use pytest-qt.
        import threading
        t = threading.Timer(30, lambda: os._exit(0))
        t.start()
    main.main()


# EOF
Beispiel #2
0
#!/usr/bin/env python
"""
Start the application.
"""

from artisanlib import main
from multiprocessing import freeze_support
from platform import system
import imp
import sys
import os

if system() == "Windows" and (hasattr(sys, "frozen") # new py2exe
                            or hasattr(sys, "importers") # old py2exe
                            or imp.is_frozen("__main__")): # tools/freeze
    from multiprocessing import set_executable
    executable = os.path.join(os.path.dirname(sys.executable), 'artisan.exe')
    set_executable(executable)    
    del executable
#    set_executable(os.path.join(sys.exec_prefix, 'artisan.exe'))


if __name__ == '__main__':
    freeze_support()
    main.main()


# EOF