Merged default in svghmi branch svghmi
authorEdouard Tisserant
Tue, 22 Dec 2020 14:57:59 +0100
branchsvghmi
changeset 3096 fc5a0b1ece10
parent 3095 dbb9d1898874 (current diff)
parent 2702 f0a70f0246da (diff)
child 3097 a098b2dd9dff
Merged default in svghmi branch
ConfigTreeNode.py
modbus/web_settings.py
py_ext/PythonFileCTNMixin.py
--- a/runtime/PLCObject.py	Mon Dec 21 11:10:27 2020 +0100
+++ b/runtime/PLCObject.py	Tue Dec 22 14:57:59 2020 +0100
@@ -555,12 +555,15 @@
             os.close(fd)
         self._init_blobs()
 
-    def _BlobAsFile(self, blobID, newpath):
+    def BlobAsFile(self, blobID, newpath):
         blob = self.blobs.pop(blobID, None)
 
         if blob is None:
             raise Exception(_("Missing data to create file: {}").format(newpath))
 
+        self._BlobAsFile(blob, newpath)
+
+    def _BlobAsFile(self, blob, newpath):
         fd, path, _md5sum = blob
         fobj = os.fdopen(fd)
         fobj.flush()
@@ -619,13 +622,13 @@
 
             try:
                 # Create new PLC file
-                self._BlobAsFile(plc_object, new_PLC_filename)
+                self.BlobAsFile(plc_object, new_PLC_filename)
 
                 # Then write the files
                 log = open(extra_files_log, "w")
                 for fname, blobID in extrafiles:
                     fpath = os.path.join(self.workingdir, fname)
-                    self._BlobAsFile(blobID, fpath)
+                    self.BlobAsFile(blobID, fpath)
                     log.write(fname+'\n')
 
                 # Store new PLC filename based on md5 key