def main(): sys.argv[1:1] = ['--startgui', '--no-dbus', '--no-hal'] import exaile exaile.main()
def main(): import logging logging.basicConfig(level=logging.INFO, datefmt="%H:%M:%S", format="%(levelname)-8s: %(message)s") aio_message = "\r\n\r\nPlease run the 'All-In-One PyGI/PyGObject for Windows Installer' and ensure that the following are selected:" + \ "\r\n\r\n" + \ "* GTK+ 3.x\r\n" + \ "* GStreamer 1.4.5 and the gst-plugins package(s)\r\n" + \ "\r\n" + \ "The 'All-In-One PyGI/PyGObject for Windows Installer' can be downloaded at\r\nhttp://sourceforge.net/projects/pygobjectwin32/\r\n\r\n" + \ "See README.Windows for more information." try: import gi except: error("PyGObject not found", "PyGObject could not be imported. " + aio_message) else: logging.info("PyGObject works") try: from gi.repository import Gtk except: error("GTK not found", "GTK could not be imported. " + aio_message) else: logging.info("GTK works") try: from gi.repository import Gst except: error("GStreamer not found", "GStreamer could not be imported. " + aio_message) else: logging.info("GStreamer works") try: import mutagen except Exception: error("Mutagen not found", "The Python module Mutagen could not be imported. It can be downloaded from http://code.google.com/p/mutagen\r\n\r\n" + "See README.Windows for more information.") else: logging.info("Mutagen works") # disable the logging before starting exaile.. otherwise it gets # configured twice and we get double the log messages! logging = None del sys.modules['logging'] try: sys.argv[1:1] = ['--startgui', '--no-dbus', '--no-hal'] import exaile exaile.main() except Exception: import traceback traceback.print_exc() raw_input()
def main(): import logging logging.basicConfig(level=logging.INFO, datefmt="%H:%M:%S", format="%(levelname)-8s: %(message)s") aio_message = ( "\r\n\r\nPlease run the 'All-In-One PyGI/PyGObject for " "Windows Installer' and ensure that the following are selected:" "\r\n\r\n" "* GTK+ 3.x\r\n" "* GStreamer 1.x and the gst-plugins package(s)\r\n" "\r\n" "The 'All-In-One PyGI/PyGObject for Windows Installer' " "can be downloaded at\r\n" "https://sourceforge.net/projects/pygobjectwin32/\r\n\r\n" "See README.Windows for more information.") try: import gi except Exception: error("PyGObject not found", "PyGObject could not be imported. " + aio_message) else: logging.info("PyGObject works") try: gi.require_version('Gtk', '3.0') from gi.repository import Gtk except Exception: error("GTK+ not found", "GTK+ could not be imported. " + aio_message) else: logging.info("GTK+ works") try: gi.require_version('Gst', '1.0') from gi.repository import Gst except Exception: error("GStreamer not found", "GStreamer could not be imported. " + aio_message) else: logging.info("GStreamer works") try: import mutagen except Exception: error( "Mutagen not found", "The Python module Mutagen could not be imported. For download " "and installation instructions see " "https://mutagen.readthedocs.io/en/latest/\r\n\r\n" "See README.Windows for more information.", ) else: logging.info("Mutagen works") # disable the logging before starting exaile.. otherwise it gets # configured twice and we get double the log messages! logging = None del sys.modules['logging'] try: sys.argv[1:1] = ['--startgui', '--no-dbus', '--no-hal'] import exaile exaile.main() except Exception: import traceback traceback.print_exc() raw_input()
def main(): import logging logging.basicConfig( level=logging.INFO, datefmt="%H:%M:%S", format="%(levelname)-8s: %(message)s" ) aio_message = ( "\r\n\r\nPlease run the 'All-In-One PyGI/PyGObject for " "Windows Installer' and ensure that the following are selected:" "\r\n\r\n" "* GTK+ 3.x\r\n" "* GStreamer 1.x and the gst-plugins package(s)\r\n" "\r\n" "The 'All-In-One PyGI/PyGObject for Windows Installer' " "can be downloaded at\r\n" "https://sourceforge.net/projects/pygobjectwin32/\r\n\r\n" "See README.Windows for more information." ) try: import gi except Exception: error("PyGObject not found", "PyGObject could not be imported. " + aio_message) else: logging.info("PyGObject works") try: gi.require_version('Gtk', '3.0') from gi.repository import Gtk except Exception: error("GTK+ not found", "GTK+ could not be imported. " + aio_message) else: logging.info("GTK+ works") try: gi.require_version('Gst', '1.0') from gi.repository import Gst except Exception: error("GStreamer not found", "GStreamer could not be imported. " + aio_message) else: logging.info("GStreamer works") try: import mutagen except Exception: error( "Mutagen not found", "The Python module Mutagen could not be imported. For download " "and installation instructions see " "https://mutagen.readthedocs.io/en/latest/\r\n\r\n" "See README.Windows for more information.", ) else: logging.info("Mutagen works") # disable the logging before starting exaile.. otherwise it gets # configured twice and we get double the log messages! logging = None del sys.modules['logging'] try: sys.argv[1:1] = ['--startgui', '--no-dbus', '--no-hal'] import exaile exaile.main() except Exception: import traceback traceback.print_exc() raw_input()
def main(): # The first time GStreamer is imported, it hijacks standard args like # '--help'. To prevent this, we hide non-gst args and restore them later. argv = sys.argv sys.argv = [argv[0]] sys.argv.extend(a for a in argv if a == '--help-gst' or a.startswith('--gst-')) try: import pygst pygst.require('0.10') import gst except Exception: import struct is64bit = len(struct.pack(b'P', 0)) == 8 logging.info("Python arch: %d-bit" % (64 if is64bit else 32)) gstroot = os.environ.get('GSTREAMER_SDK_ROOT_X86_64', r'C:\gstreamer-sdk\0.10\x86_64') \ if is64bit \ else os.environ.get('GSTREAMER_SDK_ROOT_X86', r'C:\gstreamer-sdk\0.10\x86') if not os.path.exists(gstroot): error("GStreamer not found", "GStreamer was not found. It can be downloaded from http://www.gstreamer.com/\r\n\r\n" + "See README.Windows for more information.") os.environ['PATH'] = gstroot + r'\bin;' + os.environ['PATH'] gstpypath = gstroot + r'\lib\python2.7\site-packages' sys.path.insert(1, gstpypath) os.environ['PYTHONPATH'] = gstpypath try: import pygst pygst.require('0.10') import gst except Exception: error("GStreamer Python bindings not found", "The Python bindings for GStreamer could not be imported. Please re-run the GStreamer installer and ensure that \"GStreamer python bindings\" is selected for installation (it should be selected by default).\r\n\r\n" + "GStreamer can be downloaded from http://www.gstreamer.com/\r\n\r\n" + "See README.Windows for more information.") else: logging.info("GStreamer: %s" % gstroot) else: logging.info("GStreamer works out of the box") finally: sys.argv = argv try: import pygtk pygtk.require('2.0') import gtk except Exception: error("GTK/PyGTK not found", "PyGTK 2.x could not be imported. Please re-run the GStreamer installer and ensure that \"Gtk toolkit\" and \"Gtk python bindings\" are selected (they should be selected by default). Note that the PyGTK library from pygtk.org is NOT compatible with the GStreamer library from gstreamer.com.\r\n\r\n" + "GStreamer can be downloaded from http://www.gstreamer.com/\r\n\r\n" + "See README.Windows for more information.") else: logging.info("PyGTK works") try: import mutagen except Exception: error("Mutagen not found", "The Python module Mutagen could not be imported. It can be downloaded from http://code.google.com/p/mutagen\r\n\r\n" + "See README.Windows for more information.") else: logging.info("Mutagen works") try: sys.argv[1:1] = ['--startgui', '--no-dbus', '--no-hal'] import exaile exaile.main() except Exception: import traceback traceback.print_exc() raw_input()