Esempio n. 1
0
    def parseUpdateReply(cls, repstr):
        def platform_str():
            try:
                import platform
            except:
                raise Exception("Error importing platform module")

            if sys.platform == "linux":
                if platform.architecture()[0] == "64bit":
                    return "linux_amd64"
                else:
                    return "linux_x86"
            elif sys.platform == "win32":
                return "win%s" % platform.architecture()[0][:2]
            else:
                return "mac"

        try:
            obj = json.loads(repstr)

            if obj["tag_name"] == "v%s" % pytson.getVersion():
                QMessageBox.information(
                    None, cls._tr("pyTSon Update Check"),
                    cls._tr("You are running the latest "
                            "pyTSon release"))
            else:
                for a in obj["assets"]:
                    if a["name"] == "pyTSon_%s.ts3_plugin" % platform_str():
                        msg = cls._tr("There is an update of pyTSon for your "
                                      "platform. Get it from <a href='{url}'>"
                                      "here</a>").format(url=obj["html_url"])
                        QMessageBox.information(None,
                                                cls._tr("pyTSon Update Check"),
                                                msg)
                        return

                QMessageBox.information(
                    None, cls._tr("pyTSon Update Check"),
                    cls._tr("You are running the latest "
                            "pyTSon release (at least for "
                            "your platform)"))
        except:
            logprint(
                cls._tr("Error parsing reply from update check: {trace}"
                        ).format(trace=traceback.format_exc()),
                ts3defines.LogLevel.LogLevel_ERROR,
                "pyTSon.PluginHost.parseUpdateReply")
Esempio n. 2
0
    def parseUpdateReply(cls, repstr):
        def platform_str():
            try:
                import platform
            except:
                raise Exception("Error importing platform module")

            if sys.platform == "linux":
                if platform.architecture()[0] == "64bit":
                    return "linux_amd64"
                else:
                    return "linux_x86"
            elif sys.platform == "win32":
                return "win%s" % platform.architecture()[0][:2]
            else:
                return "mac"

        try:
            obj = json.loads(repstr)

            if obj["tag_name"] == "v%s" % pytson.getVersion():
                QMessageBox.information(None, cls._tr("pyTSon Update Check"),
                                        cls._tr("You are running the latest "
                                        "pyTSon release"))
            else:
                for a in obj["assets"]:
                    if a["name"] == "pyTSon_%s.ts3_plugin" % platform_str():
                        msg = cls._tr("There is an update of pyTSon for your "
                                      "platform. Get it from <a href='{url}'>"
                                      "here</a>").format(url=obj["html_url"])
                        QMessageBox.information(None,
                                                cls._tr("pyTSon Update Check"),
                                                msg)
                        return

                QMessageBox.information(None, cls._tr("pyTSon Update Check"),
                                        cls._tr("You are running the latest "
                                                "pyTSon release (at least for "
                                                "your platform)"))
        except:
            logprint(cls._tr("Error parsing reply from update check: {trace}").
                     format(trace=traceback.format_exc()),
                     ts3defines.LogLevel.LogLevel_ERROR,
                     "pyTSon.PluginHost.parseUpdateReply")
Esempio n. 3
0
iconpack.open()
timer = QTimer()
timer.setTimerType(2)
schid = getCurrentServerConnectionHandlerID()
last = ""
(_e, ownid) = getClientID(schid)
clid = ownid
ownID = ownid
(_e, owncid) = getChannelOfClient(schid, ownid)
cid = owncid
ownCID = owncid
#if "aaa_ts3Ext" in PluginHost.active: ts3host = PluginHost.active["aaa_ts3Ext"].ts3host
#else: ts3host = ts3Ext.ts3SessionHost(next(iter(PluginHost.active.values())))

print('(pyTSon v{} on {} | Console started at: {:%Y-%m-%d %H:%M:%S})'.format(
    pytson.getVersion(), pytson.platformstr(), datetime.now()))
print("Client curAPI: {} | LibVer: {} | LibVerNum: {}".format(
    pytson.getCurrentApiVersion(), ts3lib.getClientLibVersion(),
    ts3lib.getClientLibVersionNumber()))
print("Python {} {} API: {}".format(sys.platform, sys.version,
                                    sys.api_version))
print("sys.executable: %s" % sys.executable)
print("ts3lib.getAppPath(): %s" % ts3lib.getAppPath())
print("ts3lib.getConfigPath(): %s" % ts3lib.getConfigPath())
print("ts3lib.getResourcesPath(): %s" % ts3lib.getResourcesPath())
print("ts3lib.getPluginPath(): %s" % ts3lib.getPluginPath())
print("pytson.getConfigPath(): %s" % pytson.getConfigPath())
print("pytson.getPluginPath(): %s" % pytson.getPluginPath())
print("bluscream.getScriptPath(): %s" % getScriptPath("console"))
i = 0
for item in sys.path:
Esempio n. 4
0
    #             sendPluginCommand(schid, cmd, c, [clid])
    #             return
    #         elif c == 3:
    #             print("Sent command "+cmd+" to PluginCommandTarget_CURRENT_CHANNEL_SUBSCRIBED_CLIENTS")
    #         elif c == 4:
    #             print("Sent command "+cmd+" to PluginCommandTarget_MAX")
    #         sendPluginCommand(schid, cmd, c, [])

self = QApplication.instance()
schid = getCurrentServerConnectionHandlerID()
(_e, ownid) = getClientID(schid)
(_e, owncid) = getChannelOfClient(schid, ownid)
if "aaa_ts3Ext" in PluginHost.active: ts3host = PluginHost.active["aaa_ts3Ext"].ts3host
else: ts3host = ts3Ext.ts3SessionHost(next(iter(PluginHost.active.values())))

print('(pyTSon v{} on {} | Console started at: {:%Y-%m-%d %H:%M:%S})'.format(pytson.getVersion(),pytson.platformstr(),datetime.now()))
print("Client curAPI: {} | LibVer: {} | LibVerNum: {}".format(pytson.getCurrentApiVersion(),ts3lib.getClientLibVersion(),ts3lib.getClientLibVersionNumber()))
print("Python {} {} API: {}".format(sys.platform, sys.version, sys.api_version))
print("sys.executable: %s"%sys.executable)
print("ts3lib.getAppPath(): %s"%ts3lib.getAppPath())
print("ts3lib.getConfigPath(): %s"%ts3lib.getConfigPath())
print("ts3lib.getResourcesPath(): %s"%ts3lib.getResourcesPath())
print("ts3lib.getPluginPath(): %s"%ts3lib.getPluginPath())
print("pytson.getConfigPath(): %s"%pytson.getConfigPath())
print("pytson.getPluginPath(): %s"%pytson.getPluginPath())
i = 0
for item in sys.path:
    print('sys.path[{}]"{}"'.format(i, item))
    i+=1
print("")
print(sys.flags)