[POS-commit] r97 - Kiwi2/Kiwi2

Lorenzo Gil Sanchez lgs at async.com.br
Thu Mar 10 14:07:26 BRT 2005


Author: lgs
Date: 2005-03-10 14:07:25 -0300 (Thu, 10 Mar 2005)
New Revision: 97

Modified:
   Kiwi2/Kiwi2/__init__.py
Log:
	* examples/* adapt examples to work with the new changes
	
	* Kiwi2/Controllers.py: don't use string module and ListType and
	TupleType.

	* Kiwi2/utils.py: put here some useful functions that are needed from 
	several different places.

	* Kiwi2/Widgets/List.py: 
	* Kiwi2/Widgets/Entry.py: 
	* Kiwi2/Widgets/Label.py: 
	* Kiwi2/Widgets/__init__.py: 
	* Kiwi2/Widgets/WidgetProxy.py: new module to keep the KiwiWidgets.
	These widgets inherit from a gtk widget and from WidgetProxyMixin,
	which provides the functionality to work together with the Proxy
	Kiwi Framework class.

	* Kiwi2/__init__.py: move some utility functions to utils.py and
	better API of gladepath

	* Kiwi2/Delegates.py: remove GladeDelegate and GladeSlaveDelegate and
	put more arguments to Delegate and SlaveDelegate so we keep the
	same functionality.

	* Kiwi2/Views.py: remove GladeView and GladeSlaveView. Rename 
	AbstractView to SlaveView so now we just have SlaveView and BaseView
	and they now how to handle glade files if the user gives them the
	apropiate constructor argument.
	Also, add add_proxy method to the views and make them work with
	proxies by composition.

	* Kiwi2/Proxies.py: change the VirtualProxy class to be the only Proxy
	class and work by composition of the View classes

Modified: Kiwi2/Kiwi2/__init__.py
===================================================================
--- Kiwi2/Kiwi2/__init__.py	2005-03-10 17:06:06 UTC (rev 96)
+++ Kiwi2/Kiwi2/__init__.py	2005-03-10 17:07:25 UTC (rev 97)
@@ -22,40 +22,26 @@
 # Author(s): Christian Reis <kiko at async.com.br>
 #
 
+USE_MX = False
+
 class ValueUnset:
     """To differentiate from places where None is a valid default. Used
     mainly in the Kiwi Proxy"""
     pass
 
-# this functions will live here until we find a better place
-def str2bool(value, default_value=True):
-    if value.upper() in ('TRUE', '1'):
-        return True
-    elif value.upper() in ('FALSE', '0'):
-        return False
-    else:
-        return default_value
+def get_decimal_separator():
+    return '.'
 
-def str2enum(value_name, enum_class):
-    for value, enum in enum_class.__enum_values__.items():
-        if value_name in (enum.value_name, enum.value_nick):
-            return enum
-
-def str2type(value, default_type=str):
-    type_map = {'str': str, 'int': int, 'float': float}
-    return type_map.get(value, default_type)
-
 from Kiwi2.initgtk import gtk
 #from Kiwi2.WidgetProxies import Entry, Text, CheckButton, OptionMenu
-#from Kiwi2.WidgetProxies.Base import ConversionError
 
 from Kiwi2.version import version
 kiwi_version = version
 
-from Kiwi2.List import List
+#from Kiwi2.Widgets import List, Entry
 
 standard_widgets = {
-    #gtk.Entry        : Entry.EntryProxy,
+#    gtk.Entry        : Entry,
     #gtk.Combo        : Entry.ComboProxy,
     #gtk.Label        : Entry.LabelProxy,
     #gtk.SpinButton   : Entry.SpinButtonProxy,
@@ -88,3 +74,7 @@
     """
     global gladepath
     gladepath = path
+
+def get_gladepath():
+    global gladepath
+    return gladepath



More information about the POS-commit mailing list