Author: andar

Revision: 5805

Log:
        Add support for forward slashes in config setting

Diff:
Modified: trunk/deluge/ui/console/commands/config.py
===================================================================
--- trunk/deluge/ui/console/commands/config.py  2009-10-03 22:10:38 UTC (rev 
5804)
+++ trunk/deluge/ui/console/commands/config.py  2009-10-03 22:53:21 UTC (rev 
5805)
@@ -60,6 +60,21 @@
         return tuple(out)
     elif token[0] is tokenize.STRING:
         return token[1][1:-1].decode("string-escape")
+    elif token[1] == "/":
+        count = token[-1].count("/")
+        # Check for a trailing / since it messes things up
+        trail = False
+        if token[-1][-1] == "/":
+            count -= 1
+            trail = True
+        for i in xrange(count * 2 - 1):
+            token = next()
+        # Check for trailing / and remove it
+        path = token[-1].decode("string-escape")
+        if trail:
+            path = path[0:-1]
+            token = next()
+        return path
     elif token[0] is tokenize.NUMBER:
         try:
             return int(token[1], 0)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to