src/eric7/MicroPython/MicroPythonCommandsInterface.py

branch
eric7
changeset 9748
df9520c864f2
parent 9747
b7976868d5b0
child 9749
5d409223cf3f
equal deleted inserted replaced
9747:b7976868d5b0 9748:df9520c864f2
1063 if err: 1063 if err:
1064 if b"NotImplementedError" in err: 1064 if b"NotImplementedError" in err:
1065 return "<unsupported> <unsupported>" 1065 return "<unsupported> <unsupported>"
1066 raise OSError(self.__shortError(err)) 1066 raise OSError(self.__shortError(err))
1067 return out.decode("utf-8").strip() 1067 return out.decode("utf-8").strip()
1068
1069 def getModules(self):
1070 """
1071 Public method to show a list of modules built into the firmware.
1072
1073 @return list of builtin modules
1074 @rtype list of str
1075 @exception OSError raised to indicate an issue with the device
1076 """
1077 commands = ["help('modules')"]
1078 out, err = self.execute(commands)
1079 if err:
1080 raise OSError(self.__shortError(err))
1081
1082 modules = []
1083 for line in out.decode("utf-8").splitlines()[:-1]:
1084 modules.extend(line.split())
1085 return modules

eric ide

mercurial