diff --git a/.idea/revpipycontrol.iml b/.idea/revpipycontrol.iml index 0cc7af7..7809b64 100644 --- a/.idea/revpipycontrol.iml +++ b/.idea/revpipycontrol.iml @@ -3,11 +3,10 @@ + + - - \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 54de927..720fe12 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,4 +4,3 @@ recursive-include data * recursive-include revpipycontrol * global-exclude *.pyc include LICENSE.txt - diff --git a/make.bat b/make.bat new file mode 100644 index 0000000..948043c --- /dev/null +++ b/make.bat @@ -0,0 +1,5 @@ +@echo off +pyinstaller --clean -D --windowed ^ + --add-data="data\revpipycontrol.ico;." ^ + --icon=data\\revpipycontrol.ico ^ + revpipycontrol\revpipycontrol.py diff --git a/revpipycontrol/revpipycontrol.py b/revpipycontrol/revpipycontrol.py index 770c423..6d0d3c7 100755 --- a/revpipycontrol/revpipycontrol.py +++ b/revpipycontrol/revpipycontrol.py @@ -40,6 +40,7 @@ class RevPiPyControl(tkinter.Frame): self.cli = None self.dict_conn = revpiplclist.get_connections() self.errcount = 0 + self.revpiaddress = None self.revpiname = None self.revpipyversion = [0, 0, 0] self.xmlfuncs = [] @@ -192,6 +193,10 @@ class RevPiPyControl(tkinter.Frame): label=_("PLC developer..."), command=self.plcdevelop) self.mplc.add_separator() + self.mplc.add_command( + label=_("piCtory configuration"), command=self.plcpictory) + self.mplc.add_separator() + self.mplc.add_command( label=_("Disconnect"), command=self.serverdisconnect) self.mbar.add_cascade(label="PLC", menu=self.mplc, state="disabled") @@ -219,7 +224,7 @@ class RevPiPyControl(tkinter.Frame): self.xmlfuncs = sp.system.listMethods() self.xmlmode = sp.xmlmodus() self.revpipyversion = list(map(int, sp.version().split("."))) - except Exception: + except Exception as e: self.servererror() else: self._closeall() @@ -229,6 +234,7 @@ class RevPiPyControl(tkinter.Frame): self.dict_conn[text][0], int(self.dict_conn[text][1]) ) ) + self.revpiaddress = self.dict_conn[text][0] self.revpiname = text self.var_conn.set("{0} - {1}:{2}".format( text, self.dict_conn[text][0], int(self.dict_conn[text][1]) @@ -253,10 +259,10 @@ class RevPiPyControl(tkinter.Frame): if "psstart" not in self.xmlfuncs: tkmsg.showwarning( _("Warning"), - _("The watch mode ist not supported in version {0} " - "of RevPiPyLoad on your RevPi! You need at least version " - "0.5.3! Maybe the python3-revpimodio2 module is not " - "installed on your RevPi at least version 2.0.0." + _("There is no piCtory configuration on your Revlution Pi! \n\n" + "Create a piCtory configuraiton. \n\nIf you already have, " + "make sure RevPiPyload is at least version 0.5.3 and " + "python3-revpimodio2 is installed at least version 2.5.0." "").format(self.cli.version()), parent=self.master ) @@ -382,6 +388,10 @@ class RevPiPyControl(tkinter.Frame): if self.debugframe is not None: self.cli.psstart() + def plcpictory(self): + u"""Öffnet piCtory Konfiguraiton.""" + webbrowser.open("http://{0}/".format(self.revpiaddress)) + def plcprogram(self): u"""Startet das Programmfenster.""" if self.xmlmode < 2: