src/eric7/MicroPython/Devices/MicrobitDevices.py

branch
mpy_network
changeset 9827
21803aa6c3e2
parent 9820
67597e003373
child 9829
cafb132fe3bb
equal deleted inserted replaced
9826:9340ce7fb12f 9827:21803aa6c3e2
65 @type bool 65 @type bool
66 """ 66 """
67 super().setConnected(connected) 67 super().setConnected(connected)
68 68
69 if self.hasCircuitPython(): 69 if self.hasCircuitPython():
70 self.submitMode = "paste" 70 self._submitMode = "paste"
71 71
72 def setButtons(self): 72 def setButtons(self):
73 """ 73 """
74 Public method to enable the supported action buttons. 74 Public method to enable the supported action buttons.
75 """ 75 """
615 command = """ 615 command = """
616 import os as __os_ 616 import os as __os_
617 print(__os_.listdir()) 617 print(__os_.listdir())
618 del __os_ 618 del __os_
619 """ 619 """
620 out, err = self._interface.execute(command, mode=self.submitMode) 620 out, err = self._interface.execute(command, mode=self._submitMode)
621 if err: 621 if err:
622 raise OSError(self._shortError(err)) 622 raise OSError(self._shortError(err))
623 return ast.literal_eval(out.decode("utf-8")) 623 return ast.literal_eval(out.decode("utf-8"))
624 624
625 def lls(self, dirname="", fullstat=False, showHidden=False): 625 def lls(self, dirname="", fullstat=False, showHidden=False):
663 print(listdir_stat({0})) 663 print(listdir_stat({0}))
664 del __os_, stat, listdir_stat, is_visible 664 del __os_, stat, listdir_stat, is_visible
665 """.format( 665 """.format(
666 showHidden 666 showHidden
667 ) 667 )
668 out, err = self._interface.execute(command, mode=self.submitMode) 668 out, err = self._interface.execute(command, mode=self._submitMode)
669 if err: 669 if err:
670 raise OSError(self._shortError(err)) 670 raise OSError(self._shortError(err))
671 fileslist = ast.literal_eval(out.decode("utf-8")) 671 fileslist = ast.literal_eval(out.decode("utf-8"))
672 if fileslist is None: 672 if fileslist is None:
673 return None 673 return None

eric ide

mercurial