Changeset 2270

Show
Ignore:
Timestamp:
12/23/06 07:03:07 (2 years ago)
Author:
alberto
Message:

Removing MochiKit? from ToscaWidgets?. Soon packaging it as twMochiKit.
Created a new namespace for tw widgets: toscawidgets.widgets.
Renamed toscawidgets.js_interface to toscawidgets.js as PEP 8 module naming conventions suggest.

*WARNING* For a couple revisions ToscaWidgets? and ToscaWidgetsForms? will be most probably broken.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/ToscaWidgets/trunk

    • Property svn:externals changed from
      ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup
      thirdparty/MochiKit http://svn.mochikit.com/mochikit/trunk
      to
      ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup
  • projects/ToscaWidgets/trunk/examples/tgsample/tgsample/controllers.py

    r2135 r2270  
    77from turbogears import controllers, expose, validate, redirect, error_handler 
    88 
    9 from toscawidgets.forms import DataGrid 
     9from toscawidgets.widgets.forms import DataGrid 
    1010 
    1111from tgsample import json 
  • projects/ToscaWidgets/trunk/examples/TWSampleWidgets/setup.py

    r2238 r2270  
    66    install_requires = [ 
    77        "ToscaWidgets>=0.1a0dev_r2238", 
    8         "ToscaWidgetsForms>=ToscaWidgetsForms-0.1a0dev_r2237", 
     8        "twForms>=ToscaWidgetsForms-0.1a0dev_r2237", 
    99        ], 
    1010    dependency_links=[ 
  • projects/ToscaWidgets/trunk/examples/TWSampleWidgets/tw_samples/js_forms.py

    r2218 r2270  
    33 
    44from toscawidgets.api import WidgetsList, CSSSource, JSSource 
    5 from toscawidgets.js_interface import js_function_adapter, js_function, \ 
    6                                       dynamic_resources 
    7 from toscawidgets.forms import * 
     5from toscawidgets.js import js_function_adapter, js_function, \ 
     6                            dynamic_resources 
     7from toscawidgets.widgets.forms import * 
    88 
    99 
  • projects/ToscaWidgets/trunk/setup.cfg

    r2236 r2270  
    77organization = ToscaWidgets 
    88theme = pythonpaste.org 
    9 modules = toscawidgets.core toscawidgets.meta toscawidgets.forms 
     9modules = toscawidgets.core toscawidgets.meta toscawidgets.widgets.forms 
    1010          toscawidgets.js_interface toscawidgets toscawidgets.exceptions 
    1111          toscawidgets.resources toscawidgets.util toscawidgets.api 
  • projects/ToscaWidgets/trunk/setup.py

    r2238 r2270  
    2929    return ''.join(lines) 
    3030 
    31 PACKAGES = ['toscawidgets', 'toscawidgets.js_interface', 'toscawidgets.mods'] 
     31PACKAGES = [ 
     32    'toscawidgets',  
     33    'toscawidgets.js',  
     34    'toscawidgets.mods', 
     35    'toscawidgets.widgets', 
     36    ] 
     37 
     38# Requirements to install buffet plugins and engines 
     39_extra_cheetah = ["Cheetah>=1.0", "TurboCheetah>=0.9.5"] 
     40_extra_genshi = ["Genshi >= 0.3.5"] 
     41_extra_kid = ["kid>=0.9.4", "TurboKid>=0.9.9"] 
     42 
     43# Requierements to run all tests 
     44_extra_tests = _extra_cheetah + _extra_genshi + _extra_kid 
    3245 
    3346setup( 
     
    4255        ], 
    4356    extras_require = { 
    44         'cheetah':["Cheetah>=1.0", "TurboCheetah>=0.9.5"], 
    45         'kid':["kid>=0.9.4", "TurboKid>=0.9.9"], 
    46         'genshi':["Genshi >= 0.3.5"], 
     57        'cheetah': _extra_cheetah, 
     58        'kid': _extra_kid, 
     59        'genshi': _extra_genshi, 
     60        'testing': _extra_tests, 
    4761        'build_docs':["pudge==dev", "buildutils==dev"], 
    4862        }, 
     
    5771    test_suite = 'tests', 
    5872    packages = PACKAGES, 
    59     namespace_packages = ['toscawidgets', 'toscawidgets.mods'], 
     73    namespace_packages = ['toscawidgets.widgets', 'toscawidgets.mods'], 
    6074    include_package_data=True, 
    6175    exclude_package_data={"thirdparty" : ["*"]}, 
  • projects/ToscaWidgets/trunk/tests/test_base.py

    r2218 r2270  
    11from toscawidgets.core import Widget, WidgetRepeater, WidgetsList, Child 
    22from toscawidgets.util import RequestLocalDescriptor 
    3 from toscawidgets.testutil import WidgetTestCase 
     3from toscawidgets.testutil import WidgetTestCase, WidgetRequireTestCase 
    44from unittest import TestCase 
    55 
     
    1414 
    1515 
    16 class TestMutableTemplateVarsNotClobbered(WidgetTestCase): 
     16class TestMutableTemplateVarsNotClobbered(WidgetRequireTestCase): 
     17    require = ["Genshi"] 
    1718    class TestWidget(Widget): 
    1819        params = "lst dct".split() 
     
    8586 
    8687 
    87 class TestCallableParams(WidgetTestCase): 
     88class TestCallableParams(WidgetRequireTestCase): 
     89    require = ["Genshi"] 
    8890    class TestWidget(Widget): 
    8991        params = ["foo1", "foo2"] 
     
    138140 
    139141 
    140 class TestWidgetRepeaterNestedRepeated(WidgetTestCase): 
     142class TestWidgetRepeaterNestedRepeated(WidgetRequireTestCase): 
     143    require = ["Genshi"] 
    141144    class TestWidget(Widget): 
    142145        template = """ 
     
    255258        self.assertInOutput(['Fieldset-%d'%i for i in xrange(5)], **child_args) 
    256259 
    257 class TestArgsForChilds(WidgetTestCase): 
     260class TestArgsForChilds(WidgetRequireTestCase): 
     261    require = ["Genshi"] 
    258262    class TestWidget(Widget): 
    259263        class Inner(Widget): 
     
    278282 
    279283 
    280 class TestValueForChilds(WidgetTestCase): 
     284class TestValueForChilds(WidgetRequireTestCase): 
     285    require = ["Genshi"] 
    281286    class TestWidget(Widget): 
    282287        class Inner(Widget): 
  • projects/ToscaWidgets/trunk/tests/test_js_interface.txt

    r2172 r2270  
    11Test that we can define javascript function adapters 
    22 
    3 >>> from toscawidgets.js_interface import js_function_adapter 
     3>>> from toscawidgets.js import js_function_adapter 
    44>>> def say_foo(bar): 
    55...     return (repr(bar),) 
  • projects/ToscaWidgets/trunk/tests/test_view.txt

    r2121 r2270  
    44>>> engines = view.EngineManager() 
    55>>> engines.load_all() 
    6 >>> 'genshi' in engines 
     6>>> 'toscawidgets' in engines 
    77True 
    88 
     
    1010 
    1111>>> template = "<h1>${msg}</h1>" 
    12 >>> name = 'genshi
     12>>> name = 'toscawidgets
    1313>>> tpl = engines.load_template(template, name) 
    1414>>> engines[name].render({'msg':'Hello!'}, template=tpl) 
  • projects/ToscaWidgets/trunk/toscawidgets/js/core.py

    r2182 r2270  
    11from toscawidgets.api import pre_init, post_init, default_rule 
    2 from toscawidgets.js_interface import connect, JSFunctionCalls 
     2from toscawidgets.js import connect, JSFunctionCalls 
    33 
    44__all__ = ["EventAware"] 
  • projects/ToscaWidgets/trunk/toscawidgets/js/__init__.py

    r2119 r2270  
    1 from toscawidgets.js_interface.functions import * 
    2 from toscawidgets.js_interface.widgets import * 
    3 from toscawidgets.js_interface.core import * 
     1from toscawidgets.js.functions import * 
     2from toscawidgets.js.widgets import * 
     3from toscawidgets.js.core import * 
  • projects/ToscaWidgets/trunk/toscawidgets/js/widgets.py

    r2235 r2270  
    44from toscawidgets.api import Widget, locations 
    55from toscawidgets.resources import JSSource, JSLink 
    6 from toscawidgets.js_interface import connect 
     6from toscawidgets.js import connect 
    77 
    8 __all__ = ["dynamic_resources", "JSFunctionCalls", "mochikit"
     8__all__ = ["dynamic_resources", "JSFunctionCalls"
    99 
    1010log = logging.getLogger(__name__) 
    11  
    12 class MochiKit(JSLink): 
    13    filename = 'static/MochiKit.js' 
    14  
    15 mochikit = MochiKit() 
    1611 
    1712class JSFunctionCalls(JSSource): 
     
    4843dynamic_connections = JSDynamicFunctionCalls( 
    4944    'connections', call_list_name="toscawidgets_dynamic_connections", 
    50     javascript = [mochikit], 
    5145    ) 
    5246 
  • projects/ToscaWidgets/trunk/toscawidgets/testutil.py

    r2221 r2270  
    88import pkg_resources 
    99 
    10 __all__ = ["RequireMixin", "WidgetMixin", "WidgetTestCase", "get_doctest_suite"] 
     10__all__ = [ 
     11    "RequireMixin",  
     12    "WidgetMixin",  
     13    "WidgetTestCase",  
     14    "WidgetRequireTestCase", 
     15    "get_doctest_suite", 
     16    ] 
    1117 
    1218class RequireMixin(object): 
     
    6874    pass 
    6975 
     76class WidgetRequireTestCase(RequireMixin, WidgetTestCase): 
     77    pass 
     78 
    7079def get_doctest_suite(doctest_files, doctest_modules): 
    7180    doctest_files = chain(*(imap(glob, doctest_files)))