Procházet zdrojové kódy

Add function to extract basename from url

Andrej před 4 roky
rodič
revize
ae00b7e243
1 změnil soubory, kde provedl 10 přidání a 1 odebrání
  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