[POS-commit] Kiwi/Kiwi List.py,1.87,1.88 Validators.py,1.15,1.16 Views.py,1.109,1.110 __init__.py,1.42,1.43

Christian Robottom Reis kiko at async.com.br
Sat Oct 25 01:19:52 BRDT 2003


Update of /cvs/Kiwi/Kiwi
In directory anthem:/tmp/cvs-serv23197

Modified Files:
	List.py Validators.py Views.py __init__.py 
Log Message:
Unused import


Index: __init__.py
===================================================================
RCS file: /cvs/Kiwi/Kiwi/__init__.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- __init__.py	30 May 2003 23:46:45 -0000	1.42
+++ __init__.py	25 Oct 2003 00:19:50 -0000	1.43
@@ -30,22 +30,19 @@
 # Wanted:
 # - Entry Validation
 # - Check for dependencies on installation and adjust pygtk.require?
-# - Use callable() where appropriate
-# - Use Widget() to specify widgets, more flexible
 #
 # - Right-aligned Entry (jdahlin) -> gtkhacks
 #
+# - Use Widget() to specify widgets, more flexible
 # - Proxy: make it work through Composition
 # - Try and clean up the hack in Proxies for _connect() et al.
-# - Allow creating a Proxy with an empty model
-# - Proxy: warn if Model doesn't inherit from FrameWork.model and
+# - Proxy: warn if Model doesn't inherit from FrameWork.Model and
 #   multiple Views are attached
 #
 # - CListDelegate display handler/filter
 # - Make CList and CTree share some functions through a common base
 #   class
 # - Allow cycling alignment in CList without breaking the arrow boxes
-# - Combo signal attaching for list items
 # - Kiwi Menu factories
 #
 # Janitorial:

Index: Validators.py
===================================================================
RCS file: /cvs/Kiwi/Kiwi/Validators.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Validators.py	26 Sep 2003 16:02:52 -0000	1.15
+++ Validators.py	25 Oct 2003 00:19:50 -0000	1.16
@@ -22,8 +22,6 @@
 # Author(s): Guilherme Salgado <salgado at async.com.br>
 #
 
-import string
-
 from initgtk import gtk, _warn, TRUE, FALSE
 
 from Proxies import _attrwarn, ValueUnset, kgetattr

Index: Views.py
===================================================================
RCS file: /cvs/Kiwi/Kiwi/Views.py,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- Views.py	26 Sep 2003 16:05:33 -0000	1.109
+++ Views.py	25 Oct 2003 00:19:50 -0000	1.110
@@ -29,7 +29,7 @@
 """
 
 import os, string, re, sys
-from types import StringType, ListType, TupleType, FunctionType
+from types import StringType, ListType, TupleType
 
 from initgtk import _warn, _non_interactive, ktype, TRUE, FALSE
 import gtk, libglade, GDK
@@ -483,7 +483,7 @@
 
         dict = {}
         for name, method in methods.items():
-            if type(method) == FunctionType:
+            if callable(method):
                 dict[name] = method
         self.tree.signal_autoconnect(dict)
 

Index: List.py
===================================================================
RCS file: /cvs/Kiwi/Kiwi/List.py,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- List.py	25 Oct 2003 00:06:42 -0000	1.87
+++ List.py	25 Oct 2003 00:19:50 -0000	1.88
@@ -26,8 +26,8 @@
 """Defines enhanced versions of CTree and CList"""
 
 import string
-from types import TypeType, TupleType, FunctionType,\
-     FloatType, IntType, ListType, MethodType, NoneType, StringType
+from types import TypeType, TupleType, FloatType, IntType, ListType, \
+                  StringType, NoneType
 
 import initgtk
 from initgtk import _warn, ktype, USE_MX, TRUE, FALSE
@@ -593,7 +593,7 @@
                 raise IndexError, "list index out of range" 
             tp = type(items)
             if tp not in (TupleType, ListType):
-                raise TypeError, "Argument to __setitem__ must be a list"
+                raise TypeError, "Argument to __setitem__ must be a sequence"
             # This is a bit of a hack designed to permit both forms:
             #   clist[3] = ["aaa", "bbb" ]
             #   clist[3] = [ ["aaa", "bbb"], row_data ]
@@ -1090,7 +1090,7 @@
             # if sort is already enabled, no need to redo
             return TRUE
         if callback:
-            if type(callback) not in (MethodType, FunctionType):
+            if not callable(callback):
                 msg = "second attribute must be callable, found %s"
                 raise TypeError, msg % callback
             self.sort_callback = callback
@@ -1103,9 +1103,9 @@
         # sort_with_type.
         if typelist:
             for t in typelist:
-                if type(t) is NoneType:
+                if t is NoneType:
                     raise TypeError, "Types in list may *not* be of NoneType"
-                if type(t) is not StringType:
+                if t is not StringType:
                     # The first non-string occurence indicates we need
                     # kiwi's special sorting.
                     self.typelist = typelist



More information about the POS-commit mailing list