Commits

Ralph Bean committed 1803a8e

Miscellaneous.

Comments (0)

Files changed (5)

 from setuptools import setup, find_packages
 
+import multiprocessing, logging
+
 f = open('README.rst')
 long_description = f.read().strip()
 long_description = long_description.split('split here', 1)[1]
         "tw2.dynforms",
         "BeautifulSoup",
         ],
+    test_suite='nose.collector',
+    tests_require = [
+        'nose',
+        'formencode',
+        'strainer',
+        'webtest',
+    ],
     packages=find_packages(exclude=['ez_setup']),
     namespace_packages = ['tw2'],
     zip_safe=False,

tests/test_widgets.py

             { 'label': 'date B', 'values': [30, 10, 45, 10] }
         ]
     }
-    expected = """<div style="text-align:center; overflow:hidden; background-color:#3a3a3a; width: 500; height: 500;" id="foo"></div>"""
+    expected = """<div style="text-align:center; overflow:hidden; background-color:#3a3a3a; width: 750; height: 750;" id="foo"></div>"""
+
+class test_JS(object):
+    def test_js_call(self):
+        import tw2.jit.samples
+        w = tw2.jit.samples.DemoAreaChart(id='foo')
+        w.display()

tw2/jit/samples/chart.py

     base_url = '/area_chart_data/'
 
 import tw2.core as twc
-twc.core.request_local()['middleware'].controllers.register(DemoAreaChart,
-                                                            'area_chart_data')
+twc.register_controller(DemoAreaChart, 'area_chart_data')
 
 from tw2.jit.widgets import BarChart
 from tw2.jit.samples.samples_data import BarChartJSONSampleData

tw2/jit/samples/sqla.py

     }
 
 import tw2.core as twc
-mw = twc.core.request_local()['middleware']
-mw.controllers.register(DemoSQLARadialGraph, 'db_radialgraph_demo')
+twc.register_controller(DemoSQLARadialGraph, 'db_radialgraph_demo')

tw2/jit/widgets/core.py

 
 import tw2.core as twc
 from tw2.core.resources import JSLink, CSSLink
-from tw2.core.resources import JSSymbol, JSFuncCall
+from tw2.core.resources import JSSymbol, _JSFuncCall as JSFuncCall
 from tw2.core.resources import JSSource
 from tw2.core.resources import encoder
 from tw2.core.widgets import WidgetMeta
             exec_delay=self.init_delay,
             setupcall=setupcall,
             loadcall=loadcall,
-            postcall=postcall)
+            postcall=postcall,
+        )
 
         self.resources.append(composite_js_call)