eric6/MicroPython/MicroPythonCommandsInterface.py

branch
micropython
changeset 7113
04ac3f9a87e6
parent 7112
701cdc76f887
child 7115
fe89c98430b6
--- a/eric6/MicroPython/MicroPythonCommandsInterface.py	Thu Aug 01 20:25:51 2019 +0200
+++ b/eric6/MicroPython/MicroPythonCommandsInterface.py	Fri Aug 02 19:20:07 2019 +0200
@@ -13,13 +13,18 @@
 import time
 import os
 
-from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObject, QThread, QTimer, QCoreApplication, QEventLoop
+from PyQt5.QtCore import (
+    pyqtSlot, pyqtSignal, QObject, QThread, QTimer, QCoreApplication,
+    QEventLoop
+)
 
 from .MicroPythonSerialPort import MicroPythonSerialPort
 
 import Preferences
 
 
+# TODO: change code sent to the boards to functions and retrieve them using
+#       inspect.getsource() or inspect.getsourcelines()
 class MicroPythonCommandsInterface(QObject):
     """
     Class implementing some file system commands for MicroPython.
@@ -318,8 +323,7 @@
             "import os as __os_",
             "\n".join([
                 "def is_visible(filename):",
-                "    return (not filename.startswith('.') and"
-                " not filename.endswith('~'))",
+                "    return filename[0] != '.' and filename[-1] != '~'",
             ]),
             "\n".join([
                 "def stat(filename):",

eric ide

mercurial