Example #1
0
    def __init__(self, currVersion):
        global instance
        instance = self
        self.currVersion = currVersion
        self.cV = "".join(self.currVersion.split("."))
        if len(self.cV) < 4:
            self.cV = self.cV[0] + self.cV[1] + "0" + self.cV[2]

        try:
            if Config.instance.cfgEnableUpdater == 1:
                conn = http.client.HTTPSConnection("raw.githubusercontent.com", 443)
                conn.request("GET", "/Turnermator13/ArduinoRacingDash/master/version.txt")
                versionStr = re.findall(r"\'(.+?)\'", str(conn.getresponse().read()))[0].split("|")
                self.remoteVersion = versionStr[0]
                self.reqArduinoUpdate = versionStr[1]
                self.changeLog = versionStr[2]
                self.statsURL = versionStr[3]
                conn.close()
        except Exception as e:
            Log.error("Couldn't get Version Information: %s" % e)
            self.updaterError = True
        logStats("Login")

        self.rV = "".join(self.remoteVersion.split("."))
        if len(self.rV) < 4:
            self.rV = self.rV[0] + self.rV[1] + "0" + self.rV[2]

        if (self.remoteVersion != 0) and (self.remoteVersion != Config.instance.cfgRemoteVersion)\
                and (int(self.rV) > int(self.cV)):
            self.isOpen = True
            if self.reqArduinoUpdate == "1":
                Log.info("New acSLI Version Available: v" + self.remoteVersion + ". Requires Arduino Sketch Update")
            else:
                Log.info("New acSLI Version Available: v" + self.remoteVersion)

            self.appWindow = Window("acSLI Updater", 400, 120).setVisible(1).setPos(760, 350)\
                .setBackgroundTexture("apps/python/acSLI/image/backUpdater.png")
            self.btnYes = Button(self.appWindow.app, bFunc_Yes, 110, 20, 20, 90, "Update")\
                .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnUpdater.png")
            self.btnNo = Button(self.appWindow.app, bFunc_No, 110, 20, 145, 90, "Not Now")\
                .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnUpdater.png")
            self.btnIgnore = Button(self.appWindow.app, bFunc_Ignore, 110, 20, 270, 90, "Ignore Version")\
                .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnUpdater.png")

            self.lblVersionTxt = Label(self.appWindow.app, "New acSLI Version Available: v" + self.remoteVersion, 20, 30)\
                .setSize(360, 10).setAlign("center").setFontSize(20).setColor(Utils.rgb(Utils.colours["red"]))
            self.lblLog = Label(self.appWindow.app, self.changeLog, 20, 60)\
                .setSize(360, 10).setAlign("center").setColor(Utils.rgb(Utils.colours["green"]))
        else:
            if self.updaterError:
                Log.info("Updater Encounter an Error. Version Check Incomplete")
            elif Config.instance.cfgEnableUpdater == 1:
                Log.info("Running Latest Version (v%s)" % self.remoteVersion)
Example #2
0
    def __init__(self):
        self.simInfo = Info()
        self.appWindow = Window("acSLI", 250, 260).setBackgroundTexture("apps/python/acSLI/image/backMain.png")

        self.lblPort = Label(self.appWindow.app, "Connected COM Port: {}".format(Config.instance.cfgPort), 15, 40)\
            .setSize(220, 10).setAlign("center").setColor(Utils.rgb(Utils.colours["red"]))
        self.btnUnits = Button(self.appWindow.app, bFunc_SpeedUnits, 200, 20, 25, 90, "Speed Units: {}".format(Config.instance.cfgSpeedUnit))\
                .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnLarge.png")
        self.btnFuel = Button(self.appWindow.app, bFunc_FuelDisp, 200, 20, 25, 120, "Fuel Display: {}".format(Config.instance.cfgFuelDisp))\
                .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnLarge.png")

        self.spnStartPage = Spinner(self.appWindow.app, sFunc_StartPage, 220, 20, 15, 165, "Startup Page", 0, 7, Config.instance.cfgStartPage)
        self.spnIntensity = Spinner(self.appWindow.app, sFunc_Intensity, 220, 20, 15, 215, "Display Intensity", 0, 7, Config.instance.cfgIntensity)
Example #3
0
    def __init__(self, msg):
        global instance
        instance = self

        self.appWindow = Window("acSLI Error", 800, 100).setVisible(1).setPos(560, 360)\
            .setBackgroundTexture("apps/python/acSLI/image/backError.png")
        self.btnOkay = Button(self.appWindow.app, bFunc_Okay, 240, 20, 280, 70,
                              "Okay").setAlign("center")
        self.lblVersionTxt = Label(self.appWindow.app, msg, 30, 30)\
            .setSize(760, 10).setAlign("center").setFontSize(18)
Example #4
0
 def dispButton(self):
     global instance
     self.btnClose = Button(self.appWindow.app, bFunc_Close, 110, 20, 345, 70, "Okay")\
             .setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnAuto.png")