diff -r d51af006fa6b -r 64d8f52bc8c8 svgui/svgui.py --- a/svgui/svgui.py Fri Aug 11 15:18:19 2017 +0300 +++ b/svgui/svgui.py Mon Aug 14 19:13:01 2017 +0300 @@ -35,7 +35,7 @@ class SVGUILibrary(POULibrary): def GetLibraryPath(self): - return paths.AbsNeighbourFile(__file__, "pous.xml") + return paths.AbsNeighbourFile(__file__, "pous.xml") class SVGUI(PythonFileCTNMixin): @@ -70,18 +70,18 @@ def CTNGenerate_C(self, buildpath, locations): """ - Return C code generated by iec2c compiler + Return C code generated by iec2c compiler when _generate_softPLC have been called @param locations: ignored @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND """ - + current_location = self.GetCurrentLocation() # define a unique name for the generated C file location_str = "_".join(map(lambda x:str(x), current_location)) - + res = ([], "", False) - + svgfile=self._getSVGpath() if os.path.exists(svgfile): res += (("gui.svg", file(svgfile,"rb")),) @@ -103,25 +103,25 @@ svguilibfile.close() jsmodules = {"LiveSVGPage": "svguilib.js"} res += (("svguilib.js", file(svguilibpath,"rb")),) - + runtimefile_path = os.path.join(buildpath, "runtime_%s.py"%location_str) runtimefile = open(runtimefile_path, 'w') runtimefile.write(svguiservercode % {"svgfile" : "gui.svg"}) runtimefile.write(""" def _runtime_%(location)s_start(): website.LoadHMI(%(svgui_class)s, %(jsmodules)s) - + def _runtime_%(location)s_stop(): website.UnLoadHMI() - + """ % {"location": location_str, "svgui_class": "SVGUI_HMI", "jsmodules" : str(jsmodules), }) runtimefile.close() - + res += (("runtime_%s.py"%location_str, file(runtimefile_path,"rb")),) - + return res def _ImportSVG(self): @@ -132,7 +132,7 @@ shutil.copy(svgpath, self._getSVGpath()) else: self.GetCTRoot().logger.write_error(_("No such SVG file: %s\n")%svgpath) - dialog.Destroy() + dialog.Destroy() def _StartInkscape(self): svgfile = self._getSVGpath()