eric6/MicroPython/MicrobitDevices.py

branch
micropython
changeset 7126
376deb7fefe7
parent 7123
94948e2aa0a5
child 7134
21d23ca51680
equal deleted inserted replaced
7125:2028553ee58c 7126:376deb7fefe7
43 """ 43 """
44 Public method to enable the supported action buttons. 44 Public method to enable the supported action buttons.
45 """ 45 """
46 super(MicrobitDevice, self).setButtons() 46 super(MicrobitDevice, self).setButtons()
47 self.microPython.setActionButtons( 47 self.microPython.setActionButtons(
48 repl=True, chart=HAS_QTCHART) 48 run=True, repl=True, files=True, chart=HAS_QTCHART)
49 49
50 def forceInterrupt(self): 50 def forceInterrupt(self):
51 """ 51 """
52 Public method to determine the need for an interrupt when opening the 52 Public method to determine the need for an interrupt when opening the
53 serial connection. 53 serial connection.
54 54
55 @return flag indicating an interrupt is needed 55 @return flag indicating an interrupt is needed
56 @rtype bool 56 @rtype bool
57 """ 57 """
58 return True 58 return True
59
60 def deviceName(self):
61 """
62 Public method to get the name of the device.
63
64 @return name of the device
65 @rtype str
66 """
67 return self.tr("BBC micro:bit")
59 68
60 def canStartRepl(self): 69 def canStartRepl(self):
61 """ 70 """
62 Public method to determine, if a REPL can be started. 71 Public method to determine, if a REPL can be started.
63 72
75 Plotter and a reason why it cannot. 84 Plotter and a reason why it cannot.
76 @rtype tuple of (bool, str) 85 @rtype tuple of (bool, str)
77 """ 86 """
78 return True, "" 87 return True, ""
79 88
89 def canRunScript(self):
90 """
91 Public method to determine, if a script can be executed.
92
93 @return tuple containing a flag indicating it is safe to start a
94 Plotter and a reason why it cannot.
95 @rtype tuple of (bool, str)
96 """
97 return True, ""
98
99 def runScript(self, script):
100 """
101 Public method to run the given Python script.
102
103 @param script script to be executed
104 @type str
105 """
106 pythonScript = script.split("\n")
107 self.sendCommands(pythonScript)
108
80 def canStartFileManager(self): 109 def canStartFileManager(self):
81 """ 110 """
82 Public method to determine, if a File Manager can be started. 111 Public method to determine, if a File Manager can be started.
83 112
84 @return tuple containing a flag indicating it is safe to start a 113 @return tuple containing a flag indicating it is safe to start a
85 File Manager and a reason why it cannot. 114 File Manager and a reason why it cannot.
86 @rtype tuple of (bool, str) 115 @rtype tuple of (bool, str)
87 """ 116 """
88 return False, "" 117 return True, ""
89 118
90 def getWorkspace(self): 119 def getWorkspace(self):
91 """ 120 """
92 Public method to get the workspace directory. 121 Public method to get the workspace directory.
93 122

eric ide

mercurial