[d-feet/pygi] Don't reorder properties



commit 74f93b8cf6df10c5f018f6766c33a6dbecf08383
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date:   Mon Oct 15 09:34:36 2012 +0200

    Don't reorder properties

 dfeet/introspection.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/dfeet/introspection.py b/dfeet/introspection.py
index 1e3faa4..a30818b 100644
--- a/dfeet/introspection.py
+++ b/dfeet/introspection.py
@@ -123,8 +123,14 @@ class AddressInfo():
         un1 = model.get_value(iter1, 0)
         un2 = model.get_value(iter2, 0)
 
-        un1_depth = len(un1.split("/"))
-        un2_depth = len(un2.split("/"))
+        if un1.startswith("/"):
+            un1_depth = len(un1.split("/"))
+        else:
+            un1_depth = 1
+        if un2.startswith("/"):
+            un2_depth = len(un2.split("/"))
+        else:
+            un2_depth = 1
 
         if un1_depth > un2_depth:
             return 1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]