Pārlūkot izejas kodu

Add function to extract basename from url

Andrej 4 gadi atpakaļ
vecāks
revīzija
ae00b7e243
1 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 10 1
      labkeyFileBrowser.py

+ 10 - 1
labkeyFileBrowser.py

@@ -101,4 +101,13 @@ class labkeyFileBrowser:
     def mkdir(self,url):
         self.net.mkcol(url)
 
-        
+
+#listing helping functions
+    def baseDir(self,remotePath):
+        #strip potential trailing slash
+        if remotePath[-1]=='/':
+            remotePath=remotePath[:-1]
+        #find last slash
+        if remotePath.rfind('/')>-1:
+            remotePath=remotePath[remotePath.rfind('/')+1:]
+        return remotePath