Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 2 and Version 3 of WidgetsProposal

01/26/06 05:57:07 (13 years ago)
David Bernard <dwayne@…>

add proposal (v1)


  • WidgetsProposal

    v2 v3  
    1 I started a proof of concept about another way to create and customize Widget. 
    2 It's a work in progress, but feedback will be appreciated. 
     1I started a proof of concept about another way to create and customize Widget. It's a work in progress, but feedback (goals/approach, style, tips,...) will be appreciated. The P.O.C include an API definition and implementation of part of it. 
    4 ''You also could comments the style (I've got lot of background in java, and I'm a newbee in python)'' 
     3The result are Python packages (part are attached) and proposition about TG Widgets' futur (some proposition were based on idea found in mailing-list (Michele Cella,...)) : 
    6 I also, start a concret implementation of the API with every existing widgets and more. 
     5= Proposition = 
     7 * define the simplest api that allow integration of widget with TG : 
     8    * the name of the method/attribute to retreive css js for a widget 
     9    * Resource and children class (don't need to be full widget) 
     10    * the methode to call to register static directory 
     11    * the signature/API of the method to display a value (value could be a dict) 
     12    * the signature/API of the method to validate/update values and error   
     14 * instead of render, source, sample, register, define an entry_points (like for template engine) use by Toolbox. 
     16    class WidgetFamilySamples: 
     17        """ Global description of the widget family """ 
     19        def list(): 
     20            """return the list of samples'name (string)""" 
     21            pass 
     23        def display(sample_name): 
     24            """return the sample (like a call to widget.insert(...) or widget.display(...) (in my widgetit)""" 
     25            pass 
     27        def description(sample_name): 
     28            """return the description of the sample as string (ReST format ?)""" 
     29            pass 
     31        def categories(sample_name): 
     32            """return the list of categories (string)""" 
     33            pass 
     35   The advantages are: 
     36    * provide sample are optionnal for widget developer 
     37    * several samples could be provide to illustrate usage of a widget 
     38    * sample could illustrate usage of a group/assemblage of widget 
     40 * don't force the internal implementation of widgets (with attribute like template, or method like creat_dict())