362 Copy content of a directory to an other, omit hidden files |
362 Copy content of a directory to an other, omit hidden files |
363 @param src: source directory |
363 @param src: source directory |
364 @param dst: destination directory |
364 @param dst: destination directory |
365 """ |
365 """ |
366 for i in os.listdir(src): |
366 for i in os.listdir(src): |
367 if not i.startswith('.'): |
367 if not i.startswith('.') and i != "pous.xml": |
368 srcpath = os.path.join(src,i) |
368 srcpath = os.path.join(src,i) |
369 dstpath = os.path.join(dst,i) |
369 dstpath = os.path.join(dst,i) |
370 if os.path.isdir(srcpath): |
370 if os.path.isdir(srcpath): |
371 if os.path.exists(dstpath): |
371 if os.path.exists(dstpath): |
372 shutil.rmtree(dstpath) |
372 shutil.rmtree(dstpath) |
403 "shown" : False, |
403 "shown" : False, |
404 "tooltip" : _("Transfer PLC"), |
404 "tooltip" : _("Transfer PLC"), |
405 "method" : "_Transfer"}, |
405 "method" : "_Transfer"}, |
406 ] |
406 ] |
407 |
407 |
408 def __init__(self, frame, logger): |
408 def __init__(self, frame, logger, buildpath): |
|
409 self.OrigBuildPath = buildpath |
|
410 |
409 PluginsRoot.__init__(self, frame, logger) |
411 PluginsRoot.__init__(self, frame, logger) |
410 |
412 |
411 self.PlugChildsTypes += [("LPCBus", LPCBus, "LPC bus")] |
413 self.PlugChildsTypes += [("LPCBus", LPCBus, "LPC bus")] |
412 |
414 self.PlugType = "LPC" |
|
415 |
413 self.OnlineMode = "OFF" |
416 self.OnlineMode = "OFF" |
414 self.LPCConnector = None |
417 self.LPCConnector = None |
415 |
418 |
416 self.CurrentMode = None |
419 self.CurrentMode = None |
417 self.previous_mode = None |
420 self.previous_mode = None |
418 |
421 |
419 self.SimulationBuildPath = None |
422 self.SimulationBuildPath = None |
420 |
423 |
421 self.AbortTransferTimer = None |
424 self.AbortTransferTimer = None |
422 |
425 |
|
426 def PluginLibraryFilePath(self): |
|
427 if self.OrigBuildPath is not None: |
|
428 return os.path.join(self.OrigBuildPath, "pous.xml") |
|
429 else: |
|
430 return PluginsRoot.PluginLibraryFilePath(self) |
|
431 |
423 def GetProjectName(self): |
432 def GetProjectName(self): |
424 return self.Project.getname() |
433 return self.Project.getname() |
425 |
434 |
426 def GetDefaultTargetName(self): |
435 def GetDefaultTargetName(self): |
427 if self.CurrentMode == SIMULATION_MODE: |
436 if self.CurrentMode == SIMULATION_MODE: |
566 |
575 |
567 # Keep track of the root plugin (i.e. project path) |
576 # Keep track of the root plugin (i.e. project path) |
568 self.ProjectPath = ProjectPath |
577 self.ProjectPath = ProjectPath |
569 |
578 |
570 self.BuildPath = self._getBuildPath() |
579 self.BuildPath = self._getBuildPath() |
571 self.OrigBuildPath = BuildPath |
580 if self.OrigBuildPath is not None: |
572 if BuildPath is not None: |
581 mycopytree(self.OrigBuildPath, self.BuildPath) |
573 mycopytree(BuildPath, self.BuildPath) |
|
574 |
582 |
575 # If dir have already be made, and file exist |
583 # If dir have already be made, and file exist |
576 if os.path.isdir(self.PlugPath()) and os.path.isfile(self.PluginXmlFilePath()): |
584 if os.path.isdir(self.PlugPath()) and os.path.isfile(self.PluginXmlFilePath()): |
577 #Load the plugin.xml file into parameters members |
585 #Load the plugin.xml file into parameters members |
578 result = self.LoadXMLParams() |
586 result = self.LoadXMLParams() |
1525 lpcberemiz_cmd = LPCBeremiz_Cmd(PluginRoot, Log) |
1533 lpcberemiz_cmd = LPCBeremiz_Cmd(PluginRoot, Log) |
1526 lpcberemiz_cmd.cmdloop() |
1534 lpcberemiz_cmd.cmdloop() |
1527 |
1535 |
1528 Log = StdoutPseudoFile(port) |
1536 Log = StdoutPseudoFile(port) |
1529 |
1537 |
1530 PluginRoot = LPCPluginsRoot(None, Log) |
1538 PluginRoot = LPCPluginsRoot(None, Log, buildpath) |
1531 if projectOpen is not None and os.path.isdir(projectOpen): |
1539 if projectOpen is not None and os.path.isdir(projectOpen): |
1532 result = PluginRoot.LoadProject(projectOpen, buildpath) |
1540 result = PluginRoot.LoadProject(projectOpen) |
1533 if result: |
1541 if result: |
1534 Log.write("Error: Invalid project directory", result) |
1542 Log.write("Error: Invalid project directory", result) |
1535 else: |
1543 else: |
1536 Log.write("Error: No such file or directory") |
1544 Log.write("Error: No such file or directory") |
1537 |
1545 |