plugger.py
changeset 190 be969d4694c7
parent 178 2390b409eb93
child 199 aa5f43bafad4
equal deleted inserted replaced
189:48ba1ae12ffd 190:be969d4694c7
   772     def LoadProject(self, ProjectPath, logger):
   772     def LoadProject(self, ProjectPath, logger):
   773         """
   773         """
   774         Load a project contained in a folder
   774         Load a project contained in a folder
   775         @param ProjectPath: path of the project folder
   775         @param ProjectPath: path of the project folder
   776         """
   776         """
       
   777         if os.path.basename(ProjectPath) == "":
       
   778             ProjectPath = os.path.dirname(ProjectPath)
   777         # Verify that project contains a PLCOpen program
   779         # Verify that project contains a PLCOpen program
   778         plc_file = os.path.join(ProjectPath, "plc.xml")
   780         plc_file = os.path.join(ProjectPath, "plc.xml")
   779         if not os.path.isfile(plc_file):
   781         if not os.path.isfile(plc_file):
   780             return "Folder choosen doesn't contain a program. It's not a valid project!"
   782             return "Folder choosen doesn't contain a program. It's not a valid project!"
   781         # Load PLCOpen file
   783         # Load PLCOpen file