pld-ftp-admin: modules/ftptree.py - use str.count (thx atler)

glen glen at pld-linux.org
Sun Jan 9 16:55:31 CET 2011


Author: glen                         Date: Sun Jan  9 15:55:31 2011 GMT
Module: pld-ftp-admin                 Tag: HEAD
---- Log message:
- use str.count (thx atler)

---- Files affected:
pld-ftp-admin/modules:
   ftptree.py (1.46 -> 1.47) 

---- Diffs:

================================================================
Index: pld-ftp-admin/modules/ftptree.py
diff -u pld-ftp-admin/modules/ftptree.py:1.46 pld-ftp-admin/modules/ftptree.py:1.47
--- pld-ftp-admin/modules/ftptree.py:1.46	Sun Jan  9 16:25:39 2011
+++ pld-ftp-admin/modules/ftptree.py	Sun Jan  9 16:55:26 2011
@@ -101,9 +101,7 @@
         0.%{subver}.%{rel}, %{rel} = 1 -> 0.20010.1 -> True
         0.%{subver}.%{rel}, %{rel} = 0.1 -> 0.20010.0.1 -> False
         """
-        # count elements by splitting by dot
-        parts = self.release.split('.')
-        return len(parts) % 2 == 1
+        return self.release.count('.') % 2 == 0
 
     def mark4moving(self):
         if not self.marked4moving:
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-ftp-admin/modules/ftptree.py?r1=1.46&r2=1.47&f=u



More information about the pld-cvs-commit mailing list