Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
big refactor in namespace
  • Loading branch information
ralphbean committed Oct 19, 2010
1 parent 4c5c721 commit 2499135
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 45 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
@@ -1,3 +1,3 @@
recursive-include tw2/jquery_fg/static *
recursive-include tw2/jquery_fg/templates *
recursive-include tw2/jquery/plugins/fg/static *
recursive-include tw2/jquery/plugins/fg/templates *
include README.rst
16 changes: 8 additions & 8 deletions README.rst
@@ -1,5 +1,5 @@
tw2.jquery_fg
=============
tw2.jquery.plugins.fg
=====================

:Author: Ralph Bean <ralph.bean@gmail.com>

Expand All @@ -10,18 +10,18 @@ tw2.jquery_fg
.. _jQuery: http://jquery.com/
.. _filament group: http://www.filamentgroup.com/

tw2.jquery_fg is a `toscawidgets2 (tw2)`_ wrapper for a bunch of random widgets and tools from the awesome `filament group`_.
tw2.jquery.plugins.fg is a `toscawidgets2 (tw2)`_ wrapper for a bunch of random widgets and tools from the awesome `filament group`_.

Live Demo
---------
Peep the `live demonstration <http://craftsman.rc.rit.edu/module?module=tw2.jquery_fg>`_.
Peep the `live demonstration <http://craftsman.rc.rit.edu/module?module=tw2.jquery.plugins.fg>`_.

Links
-----
Get the `source from github <http://github.com/ralphbean/tw2.jquery_fg>`_.
Get the `source from github <http://github.com/ralphbean/tw2.jquery.plugins.fg>`_.

`PyPI page <http://pypi.python.org/pypi/tw2.jquery_fg>`_
and `bugs <http://github.com/ralphbean/tw2.jquery_fg/issues/>`_
`PyPI page <http://pypi.python.org/pypi/tw2.jquery.plugins.fg>`_
and `bugs <http://github.com/ralphbean/tw2.jquery.plugins.fg/issues/>`_

Description
-----------
Expand All @@ -36,4 +36,4 @@ The `filament group`_ designs engaging user interfaces for web
applications, mobile devices and touchscreen kiosks that are simple
and accessible to everyone.

This module, tw2.jquery_fg, provides `toscawidgets2 (tw2)`_ access to random `filament group`_ widgets.
This module, tw2.jquery.plugins.fg, provides `toscawidgets2 (tw2)`_ access to random `filament group`_ widgets.
24 changes: 15 additions & 9 deletions development-deps/develop-tw2-destroy-and-setup.sh
Expand Up @@ -13,20 +13,26 @@ source $venv/bin/activate
pushd $devbase

pip install genshi
pip install mako
pip install formencode

hg clone http://bitbucket.org/paj/tw2core || \
(pushd tw2core && hg pull && popd)
hg clone http://bitbucket.org/paj/tw2devtools || \
(pushd tw2devtools && hg pull && popd)
git clone git://github.com/ralphbean/tw2.jquery_core.git || \
(pushd tw2.jquery_core && git pull && popd)
git clone git://github.com/ralphbean/tw2.jquery_ui.git || \
(pushd tw2.jquery_ui && git pull && popd)

pushd tw2core ; python setup.py develop ; popd
pushd tw2devtools ; python setup.py develop ; popd
pushd tw2.jquery_core ; python setup.py develop ; popd
pushd tw2.jquery_ui ; python setup.py develop ; popd
hg clone http://bitbucket.org/paj/tw2forms || \
(pushd tw2forms && hg pull && popd)
hg clone http://bitbucket.org/toscawidgets/tw2jquery || \
(pushd tw2jquery && hg pull && popd)
git clone http://github.com/ralphbean/tw2.jquery.plugins.ui.git || \
(pushd tw2.jquery.plugins.ui && git pull && popd)
#hg clone https://ralphbean@bitbucket.org/toscawidgets/tw2jquery || \
# (pushd tw2jquery && hg pull && popd)

pushd tw2core ; python setup.py install ; popd
pushd tw2forms ; python setup.py install ; popd
pushd tw2devtools ; python setup.py install ; popd
pushd tw2jquery ; python setup.py install_lib install_egg_info ; popd
pushd tw2.jquery.plugins.ui ; python setup.py install_lib install_egg_info ; popd

popd # $devbase
2 changes: 1 addition & 1 deletion development-deps/develop-tw2-start.sh
Expand Up @@ -4,7 +4,7 @@ devbase=development-deps
venv=$devbase/virtualenv-tw2.jquery
source $venv/bin/activate

python setup.py develop && paster tw2.browser
python setup.py install_lib install_egg_info && paster tw2.browser



12 changes: 6 additions & 6 deletions setup.py
Expand Up @@ -6,18 +6,18 @@
f.close()

setup(
name='tw2.jquery_fg',
name='tw2.jquery.plugins.fg',
version='2.0a6',
description='toscawidgets2 wrapper for random filament group tools',
long_description=long_description,
author='Ralph Bean',
author_email='ralph.bean@gmail.com',
license='MIT',
url='http://github.com/ralphbean/tw2.jquery_fg',
url='http://github.com/ralphbean/tw2.jquery.plugins.fg',
install_requires=[
"tw2.core>=2.0b2",
"tw2.jquery_core",
"tw2.jquery_ui",
#"tw2.core>=2.0b2",
#"tw2.jquery_core",
#"tw2.jquery_ui",
"genshi",
"mako",
],
Expand All @@ -29,7 +29,7 @@
entry_points="""
[tw2.widgets]
# Register your widgets so they can be listed in the WidgetBrowser
widgets = tw2.jquery_fg
widgets = tw2.jquery.plugins.fg
""",
keywords = [
'toscawidgets.widgets',
Expand Down
7 changes: 3 additions & 4 deletions tests/test_widgets.py
@@ -1,4 +1,3 @@
from tw2.jquery_core.widgets import JQueryWidget
from webob import Request
from webob.multidict import NestedMultiDict
from tw2.core.testbase import assert_in_xml, assert_eq_xml, WidgetTest
Expand All @@ -14,14 +13,14 @@
else:
from webob.multidict import NestedMultiDict

import tw2.jquery_ui
import tw2.jquery_fg.widgets as w
import tw2.jquery.plugins.ui
import tw2.jquery.plugins.fg.widgets as w

class TestMenuWidget(WidgetTest):
widget = w.MenuWidget
attrs = {'id' : 'foo'}
params = {
'child' : tw2.jquery_ui.ButtonWidget(id='blahah'),
'child' : tw2.jquery.plugins.ui.ButtonWidget(id='blahah'),
'items' : [
{'name' : "Breaking News",
'children' : [
Expand Down
1 change: 1 addition & 0 deletions tw2/jquery/__init__.py
@@ -0,0 +1 @@
from tw2.jquery.widgets import *
1 change: 1 addition & 0 deletions tw2/jquery/plugins/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
File renamed without changes.
12 changes: 5 additions & 7 deletions tw2/jquery_fg/base.py → tw2/jquery/plugins/fg/base.py
Expand Up @@ -3,20 +3,18 @@
import tw2.core as twc
from tw2.core.resources import encoder

# tw2.jquery_core imports
from tw2.jquery_core import JQueryWidget
from tw2.jquery_core.base import jQueryJSLink
from tw2.jquery_core.base import jQueryPluginLinkMixin
from tw2.jquery_core.version import JSLinkMixin
# tw2.jquery core imports
from tw2.jquery.base import jQueryJSLink, jQueryPluginLinkMixin
from tw2.jquery.version import JSLinkMixin

# import from *this* package
from tw2.jquery_fg import defaults
from tw2.jquery.plugins.fg import defaults

### Links, etc...
class jQueryFGMixin(jQueryPluginLinkMixin):
dirname = defaults._fg_dirname_
basename='fg.menu'
modname = 'tw2.jquery_fg'
modname = 'tw2.jquery.plugins.fg'

class jQueryFGJSLink(twc.JSLink, jQueryFGMixin):
subdir = 'js'
Expand Down
@@ -1,3 +1,2 @@
#jQuery.ui
_fg_dirname_ = 'jquery/fg/%(subdir)s'
_fg_basename_ = 'jquery_fg'
4 changes: 2 additions & 2 deletions tw2/jquery_fg/samples.py → tw2/jquery/plugins/fg/samples.py
Expand Up @@ -6,7 +6,7 @@
See http://toscawidgets.org/documentation/WidgetBrowser for more information
"""

import tw2.jquery_ui
import tw2.jquery.plugins.ui
from widgets import MenuWidget

some_items = [
Expand Down Expand Up @@ -177,7 +177,7 @@ class DemoMenuWidget(MenuWidget):
'maxHeight' : 300,
'width' : 250,
}
child = tw2.jquery_ui.ButtonWidget(
child = tw2.jquery.plugins.ui.ButtonWidget(
options={
'label' : 'A Menu',
'icons' : {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions tw2/jquery_fg/widgets.py → tw2/jquery/plugins/fg/widgets.py
Expand Up @@ -4,9 +4,9 @@
from tw2.core.resources import encoder

# imports from this package
from tw2.jquery_ui import base as uibase
from tw2.jquery_fg import base as fgbase
import tw2.jquery_ui
from tw2.jquery.plugins.ui import base as uibase
from tw2.jquery.plugins.fg import base as fgbase
import tw2.jquery.plugins.ui

class MenuWidget(uibase.JQueryUIWidget, twc.DisplayOnlyWidget):
"""
Expand Down Expand Up @@ -72,12 +72,12 @@ class MenuWidget(uibase.JQueryUIWidget, twc.DisplayOnlyWidget):
]


template = "tw2.jquery_fg.templates.menu"
template = "tw2.jquery.plugins.fg.templates.menu"
jqmethod = 'fgmenu'

items = twc.Param('A recursive dictionary of menu entries', default=[])
child = twc.Param(
'A label for the menu (an instance of tw2.jquery_ui.ButtonWidget)',
'A label for the menu (an instance of tw2.jquery.plugins.ui.ButtonWidget)',
)
def prepare(self):
super(MenuWidget, self).prepare()
Expand Down

0 comments on commit 2499135

Please sign in to comment.