/usr/lib/python3/dist-packages/ghost/bindings.py is in python3-ghost 0.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | # -*- coding: utf-8 -*-
import sys
PY3 = sys.version > '3'
if PY3:
unicode = str
long = int
bindings = ["PySide", "PyQt4"]
binding = None
for name in bindings:
try:
binding = __import__(name)
if name == 'PyQt4':
import sip
sip.setapi('QVariant', 2)
except ImportError:
continue
break
class LazyBinding(object):
class __metaclass__(type):
def __getattr__(self, name):
return self.__class__
def __getattr__(self, name):
return self.__class__
def _import(name):
if binding is None:
return LazyBinding()
name = "%s.%s" % (binding.__name__, name)
module = __import__(name)
for n in name.split(".")[1:]:
module = getattr(module, n)
return module
QtCore = _import("QtCore")
QSize = QtCore.QSize
QByteArray = QtCore.QByteArray
QUrl = QtCore.QUrl
QDateTime = QtCore.QDateTime
QtCriticalMsg = QtCore.QtCriticalMsg
QtDebugMsg = QtCore.QtDebugMsg
QtFatalMsg = QtCore.QtFatalMsg
QtWarningMsg = QtCore.QtWarningMsg
qInstallMsgHandler = QtCore.qInstallMsgHandler
QtGui = _import("QtGui")
QApplication = QtGui.QApplication
QImage = QtGui.QImage
QPainter = QtGui.QPainter
QPrinter = QtGui.QPrinter
QRegion = QtGui.QRegion
QtNetwork = _import("QtNetwork")
QNetworkRequest = QtNetwork.QNetworkRequest
QNetworkAccessManager = QtNetwork.QNetworkAccessManager
QNetworkCookieJar = QtNetwork.QNetworkCookieJar
QNetworkProxy = QtNetwork.QNetworkProxy
QNetworkCookie = QtNetwork.QNetworkCookie
QSslConfiguration = QtNetwork.QSslConfiguration
QSsl = QtNetwork.QSsl
QtWebKit = _import('QtWebKit')
|