eric6/MicroPython/MicroPythonFileSystem.py

branch
micropython
changeset 7067
3fc4082fc6ba
child 7070
3368ce0e7879
diff -r e3d034e65afc -r 3fc4082fc6ba eric6/MicroPython/MicroPythonFileSystem.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/MicroPython/MicroPythonFileSystem.py	Thu Jul 18 20:30:03 2019 +0200
@@ -0,0 +1,101 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing some file system commands for MicroPython.
+"""
+
+from __future__ import unicode_literals
+
+from PyQt5.QtCore import QObject
+
+
+class MicroPythonFileSystem(QObject):
+    """
+    Class implementing some file system commands for MicroPython.
+    
+    Some FTP like commands are provided to perform operations on the file
+    system of a connected MicroPython device. Supported commands are:
+    <ul>
+    <li>ls: directory listing</li>
+    <li>lls: directory listing with meta data</li>
+    <li>cd: change directory</li>
+    <li>pwd: get the current directory</li>
+    <li>put: copy a file to the connected device</li>
+    <li>get: get a file from the connected device</li>
+    </ul>
+    """
+    def __init__(self, parent=None):
+        """
+        Constructor
+        
+        @param parent reference to the parent object
+        @type QObject
+        """
+        super(MicroPythonFileSystem, self).__init__(parent)
+    
+    def ls(self):
+        """
+        Public method to get a directory listing of the connected device.
+        
+        @return tuple containg the directory listing
+        @rtype tuple of str
+        """
+        # TODO: not implemented yet
+    
+    def lls(self):
+        """
+        Public method to get a long directory listing of the connected device
+        including meta data.
+        
+        @return tuple containg the the directory listing with tuple entries
+            containing the name, size, time and mode
+        @rtype tuple of str
+        """
+        # TODO: not implemented yet
+    
+    def cd(self, path):
+        """
+        Public method to change the current directory on the connected device.
+        
+        @param path directory to change to
+        @type str
+        """
+        # TODO: not implemented yet
+    
+    def pwd(self):
+        """
+        Public method to get the current directory of the connected device.
+        
+        @return current directory
+        @rtype str
+        """
+        # TODO: not implemented yet
+    
+    def put(self, hostFileName, deviceFileName):
+        """
+        Public method to copy a local file to the connected device.
+        
+        @param hostFileName name of the file to be copied
+        @type str
+        @param deviceFileName name of the file to copy to
+        @type str
+        @return flag indicating success
+        @rtype bool
+        """
+        # TODO: not implemented yet
+    
+    def get(self, deviceFileName, hostFileName):
+        """
+        Public method to copy a file from the connected device.
+        
+        @param deviceFileName name of the file to copy
+        @type str
+        @param hostFileName name of the file to copy to
+        @type str
+        @return flag indicating success
+        @rtype bool
+        """
+        # TODO: not implemented yet

eric ide

mercurial