moksha/public
by John (J5) Palmieri
moksha/public/javascript/ui/moksha.ui.grid.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 637d895338cfe9e690fa1be9658a13b670160d4d
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Wed Jun 30 14:27:33 2010 -0400
remove trailing comma for ie8 support
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index f893be2..852f97a 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -200,7 +200,7 @@
start_row: start_row,
rows_per_page: rpp,
sort_key: o.sort_key,
- sort_order: o.sort_order,
+ sort_order: o.sort_order
}
// TODO: Only trigger refresh signal if we have a cache miss
@@ -486,7 +486,7 @@
$overlay.css({'opacity': .75,
'z-index': 99,
'background-color': 'white',
- 'position': 'absolute',
+ 'position': 'absolute'
}
)
@@ -595,7 +595,7 @@
processElement: function($el) {
// we don't do anything here as it is all handled by the event handler
- },
+ }
}
$.ui.mokshagrid.prototype.controls.info_display = {
@@ -658,7 +658,7 @@
return pager_obj.processElement.call(this.pager_types[type],
$el);
- },
+ }
};
$.ui.mokshagrid.prototype.controls.pager.pager_types.more_link = {
@@ -905,7 +905,7 @@ $.extend( $.template.helpers , {
filter: function(v, filter_cb) {
return window[filter_cb](v);
- },
+ }
}
);
13 years, 10 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/ui/moksha.ui.grid.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 4b3179653edc108d48726067e1425c190f3338b7
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Wed Jun 30 12:32:23 2010 -0400
fix typo which was giving us JS errors
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index ecbc64f..f893be2 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -50,7 +50,7 @@
var self = this;
var o = self.options;
- if (typeof(o.filters != 'object')) {
+ if (typeof(o.filters) != 'object') {
try {
self.options.filters = $.secureEvalJSON(o.filters);
} catch(e) {
13 years, 10 months
moksha/api moksha/public
by John (J5) Palmieri
moksha/api/widgets/global_resources/widget.py | 10 +++++++++-
moksha/public/javascript/moksha.js | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 77127d7d6d7223f54b05080984bf5140047e87e0
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Wed Jun 30 12:02:07 2010 -0400
convert moksha_csrf_trusted_domains from a js array to object
* makes lookup much faster
* fixes bug where we were calling indexOf on a js array
diff --git a/moksha/api/widgets/global_resources/widget.py b/moksha/api/widgets/global_resources/widget.py
index 3f50eeb..356f0aa 100644
--- a/moksha/api/widgets/global_resources/widget.py
+++ b/moksha/api/widgets/global_resources/widget.py
@@ -94,6 +94,14 @@ class GlobalResourceInjectionWidget(Widget):
if asbool(config.get('moksha.extensionpoints', False)):
self.javascript.append(moksha_extension_points_js)
+ trusted_domain_list = config.get('moksha.csrf.trusted_domains', '').split(',')
+ # turn into quick lookup hash
+ item_list = []
+ for domain in trusted_domain_list:
+ item_list.append('"%s": true' % domain)
+ trusted_domain_hash = '{%s}' % ','.join(item_list)
+ self.csrf_trusted_domains_hash = trusted_domain_hash
+
def update_params(self, d):
super(GlobalResourceInjectionWidget, self).update_params(d)
@@ -104,7 +112,7 @@ class GlobalResourceInjectionWidget(Widget):
if asbool(config['global_conf'].get('profile')):
d['profile'] = 'true'
- d['csrf_trusted_domains'] = config.get('moksha.csrf.trusted_domains', '').split(',')
+ d['csrf_trusted_domains'] = self.csrf_trusted_domains_hash
identity = request.environ.get('repoze.who.identity')
if identity:
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index d2a191f..380bbdf 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -689,7 +689,7 @@ moksha = {
moksha.csrf_rewrite_uri(purl);
} else {
- if (moksha_csrf_trusted_domains.indexOf(purl.host) != -1)
+ if (moksha_csrf_trusted_domains[purl.host])
moksha.csrf_rewrite_uri(purl);
}
13 years, 10 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/moksha.js | 8 +++-----
moksha/public/javascript/ui/moksha.ui.tabs.js | 6 +++---
2 files changed, 6 insertions(+), 8 deletions(-)
New commits:
commit e19396ed282dbf9672030a55370874fa0ef397eb
Author: John (J5) Palmieri <johnp(a)rawhide-virtualhost.localdomain>
Date: Tue Jun 29 14:36:57 2010 -0400
Fixes for IE8
* remove commas at the end of dictionaries. Most browsers can handle
dictionaries with a trailing comma:
{prop1:1, prop2:2,}
but IE can not parse that so it needs to look like:
{prop1:1, prop2:2}
* remove refrence to reserved word self (use _self where needed).
IE is very strict about using reserved words, even as members
of an object
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index 69b1337..d2a191f 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -559,8 +559,6 @@ moksha = {
},
ajax_load: function(path, params, callback, $overlay_div, data_type, loading_icon) {
- self = this;
-
if (typeof(params) == 'string') {
params = $.secureEvalJSON(params);
}
@@ -714,13 +712,13 @@ moksha = {
var defer_time = 1; // ms
var timeout = function () {
var closure = _moksha_deferred.shift();
- var self = closure[0];
+ var _self = closure[0];
var f = closure[1];
var args = closure[2];
if (!args)
args = [];
- f.apply(self, args);
+ f.apply(_self, args);
if (_moksha_deferred.length > 0)
setTimeout(timeout, defer_time);
}
@@ -791,7 +789,7 @@ moksha = {
_body: $.toJSON(body),
_header: {
delivery_properties: {
- routing_key: topic,
+ routing_key: topic
}
}
});
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index 9cf130a..cb64a27 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -42,7 +42,7 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
passPathRemainder:false,
// templates
- tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',
+ tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
},
_create: function() {
this._findParentNav();
@@ -164,7 +164,7 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
$overlay.css({'opacity': .75,
'z-index': 99,
'background-color': 'white',
- 'position': 'absolute',
+ 'position': 'absolute'
}
)
@@ -638,7 +638,7 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
self.element.dequeue("tabs");
return this;
- },
+ }
});
13 years, 10 months
moksha/__init__.py
by Luke Macken
moksha/__init__.py | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 928f5b69fb24bb4489518c330e9fca9e59eb71d1
Author: Luke Macken <luke(a)civx.us>
Date: Sun Jun 20 23:13:05 2010 -0400
Add a moksha.get_widgets() method
diff --git a/moksha/__init__.py b/moksha/__init__.py
index 91ec102..efda46c 100644
--- a/moksha/__init__.py
+++ b/moksha/__init__.py
@@ -44,6 +44,11 @@ def get_widget(name):
if _widgets:
return _widgets[name]['widget']
+def get_widgets():
+ """ Return a dictionary of all widgets """
+ from pkg_resources import iter_entry_points
+ return _widgets or [widget.load() for widget in iter_entry_points('moksha.widget')]
+
def get_app(name):
""" Get an app controller by name """
return _apps[name]['controller']
13 years, 11 months
6 commits - MANIFEST.in moksha/lib moksha/tests moksha/widgets
by Luke Macken
MANIFEST.in | 3 +++
moksha/lib/helpers.py | 9 +++++----
moksha/tests/functional/test_authentication.py | 14 +++++++++-----
moksha/tests/functional/test_csrf.py | 6 ++++--
moksha/tests/quickstarts/base.py | 7 ++-----
5 files changed, 23 insertions(+), 16 deletions(-)
New commits:
commit f6b583f8fd84d82b24a1c56212c4a365cc9cc292
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Jun 13 08:34:07 2010 -0400
Have our base quickstart tester not do crazy things with our path
diff --git a/moksha/tests/quickstarts/base.py b/moksha/tests/quickstarts/base.py
index 2629e6b..d34be9c 100644
--- a/moksha/tests/quickstarts/base.py
+++ b/moksha/tests/quickstarts/base.py
@@ -47,11 +47,9 @@ def setup_quickstart(template, templates, template_vars, args):
template_vars)
command.command()
- global old_cwd
- old_cwd = os.getcwd()
- os.chdir(proj_dir)
subprocess.Popen('paver egg_info', shell=True, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()
+ stderr=subprocess.PIPE,
+ cwd=proj_dir).communicate()
pkg_resources.working_set.add_entry(proj_dir)
reload(pkg_resources)
@@ -62,7 +60,6 @@ def setup_quickstart(template, templates, template_vars, args):
def teardown_quickstart():
shutil.rmtree(testDataPath, ignore_errors=True)
- os.chdir(old_cwd)
class QuickstartTester(object):
commit c6a73ed3fc0bf617db7580ad01f7a18638c425d9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Jun 13 08:33:48 2010 -0400
Make our get_moksha_dev_config() work in more scenarios
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py
index cae8539..f0b771c 100644
--- a/moksha/lib/helpers.py
+++ b/moksha/lib/helpers.py
@@ -791,10 +791,11 @@ def get_moksha_config_path():
# raise MokshaConfigNotFound('Cannot find moksha configuration file!')
def get_moksha_dev_config():
- cfg = os.path.join(os.path.abspath(__file__ + '/../../../'), 'development.ini')
- if os.path.isfile(cfg):
- return cfg
- log.warn("Cannot find %r" % cfg)
+ cfgs = [os.path.join(os.path.abspath(__file__ + '/../../../'), 'development.ini'), os.path.join(os.path.abspath(__file__ + '/../../../../'), 'development.ini'), os.path.join(os.getcwd(), 'development.ini')]
+ for cfg in cfgs:
+ if os.path.isfile(cfg):
+ return cfg
+ log.warn("Cannot find configuration in %r" % cfgs)
def get_moksha_appconfig():
commit a62ba57bd918c3bc7fcf03f7f11e2940264ca325
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Jun 13 08:33:34 2010 -0400
Update our manifest to pull in some config files
diff --git a/MANIFEST.in b/MANIFEST.in
index e2f9e0a..408fd1f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -12,3 +12,6 @@ include LICENSE
include README
include AUTHORS
include COPYING
+include development.ini
+include test.ini
+include *.py
commit b0e40925b886b4e6d339a29eef3a8fcfc14f3c5c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Jun 12 17:54:41 2010 -0400
Make our container widget tests a Python module, so older versions of nose find it
diff --git a/moksha/widgets/container/tests/__init__.py b/moksha/widgets/container/tests/__init__.py
new file mode 100644
index 0000000..e69de29
commit be2d735e84e69588bcacfd485fb0f91e1d0735e5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Jun 12 15:29:31 2010 -0400
Get more tests working with different versions of repoze
diff --git a/moksha/tests/functional/test_authentication.py b/moksha/tests/functional/test_authentication.py
index 5d5557c..7aa0a0d 100644
--- a/moksha/tests/functional/test_authentication.py
+++ b/moksha/tests/functional/test_authentication.py
@@ -53,7 +53,7 @@ class TestAuthentication(TestController):
# Requesting a protected area
resp = self.app.get('/moksha_admin/', status=302)
assert resp.location.startswith('http://localhost/login') or \
- repo.location.startswith('/login')
+ resp.location.startswith('/login')
# Getting the login form:
resp = resp.follow(status=200)
form = resp.form
@@ -62,7 +62,8 @@ class TestAuthentication(TestController):
form['password'] = u'managepass'
post_login = form.submit(status=302)
# Being redirected to the initially requested page:
- assert post_login.location.startswith('http://localhost/post_login')
+ assert post_login.location.startswith('http://localhost/post_login') or \
+ post_login.location.startswith('/post_login')
initial_page = post_login.follow(status=302)
assert 'authtkt' in initial_page.request.cookies, \
"Session cookie wasn't defined: %s" % initial_page.request.cookies
@@ -97,10 +98,10 @@ class TestAuthentication(TestController):
# Logging out:
resp = self.app.get('/logout_handler', status=302)
assert resp.location.startswith('http://localhost/post_logout') or \
- repo.location.startswith('/post_logout')
+ resp.location.startswith('/post_logout')
# Finally, redirected to the home page:
home_page = resp.follow(status=302)
authtkt = home_page.request.cookies.get('authtkt')
assert authtkt in ('', 'INVALID'), \
'Session cookie was not deleted: %s' % home_page.request.cookies
- assert home_page.location == 'http://localhost/', home_page.location
+ assert home_page.location == 'http://localhost/', repr(home_page.location)
commit 255e9bb5e9d6b07ae90d45d87081662ab93bad17
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Jun 12 15:25:54 2010 -0400
Get more of our auth related unit tests working across different versions of
the repoze who/what stack
diff --git a/moksha/tests/functional/test_authentication.py b/moksha/tests/functional/test_authentication.py
index becdc5c..5d5557c 100644
--- a/moksha/tests/functional/test_authentication.py
+++ b/moksha/tests/functional/test_authentication.py
@@ -52,7 +52,8 @@ class TestAuthentication(TestController):
"""
# Requesting a protected area
resp = self.app.get('/moksha_admin/', status=302)
- assert resp.location.startswith('http://localhost/login')
+ assert resp.location.startswith('http://localhost/login') or \
+ repo.location.startswith('/login')
# Getting the login form:
resp = resp.follow(status=200)
form = resp.form
@@ -78,7 +79,8 @@ class TestAuthentication(TestController):
form['password'] = 'managepass'
post_login = form.submit(status=302)
# Being redirected to the home page:
- assert post_login.location.startswith('http://localhost/post_login'), post_login.location
+ assert post_login.location.startswith('http://localhost/post_login') or\
+ post_login.location.startswith('/post_login')
home_page = post_login.follow(status=302)
assert 'authtkt' in home_page.request.cookies, \
'Session cookie was not defined: %s' % home_page.request.cookies
@@ -94,7 +96,8 @@ class TestAuthentication(TestController):
'Session cookie was not defined: %s' % resp.request.cookies
# Logging out:
resp = self.app.get('/logout_handler', status=302)
- assert resp.location.startswith('http://localhost/post_logout')
+ assert resp.location.startswith('http://localhost/post_logout') or \
+ repo.location.startswith('/post_logout')
# Finally, redirected to the home page:
home_page = resp.follow(status=302)
authtkt = home_page.request.cookies.get('authtkt')
diff --git a/moksha/tests/functional/test_csrf.py b/moksha/tests/functional/test_csrf.py
index 3cab8f7..dbee5c2 100644
--- a/moksha/tests/functional/test_csrf.py
+++ b/moksha/tests/functional/test_csrf.py
@@ -37,7 +37,8 @@ class TestCSRFProtection(TestController):
# Requesting a protected area
resp = self.app.get('/moksha_admin/', status=302)
- assert resp.location.startswith('http://localhost/login')
+ assert resp.location.startswith('http://localhost/login') or \
+ resp.location.startswith('/login'), resp.location
# Getting the login form:
resp = resp.follow(status=200)
@@ -49,7 +50,8 @@ class TestCSRFProtection(TestController):
post_login = form.submit(status=302)
# Being redirected to the initially requested page:
- assert post_login.location.startswith('http://localhost/post_login')
+ assert post_login.location.startswith('http://localhost/post_login') or\
+ post_login.location.startswith('/post_login')
initial_page = post_login.follow(status=302)
assert 'authtkt' in initial_page.request.cookies, \
"Session cookie wasn't defined: %s" % initial_page.request.cookies
13 years, 11 months
2 commits - moksha/middleware moksha/tests
by Luke Macken
moksha/middleware/middleware.py | 93 ++++++++++++++++++-----------------
moksha/tests/functional/test_csrf.py | 9 ++-
2 files changed, 54 insertions(+), 48 deletions(-)
New commits:
commit 234e47421b72aae838e680b5a03cf57fb70688bd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Jun 4 18:21:26 2010 -0400
Get our CSRF tests working with the TurboGears 2.1 stack
diff --git a/moksha/tests/functional/test_csrf.py b/moksha/tests/functional/test_csrf.py
index d3c62ed..3cab8f7 100644
--- a/moksha/tests/functional/test_csrf.py
+++ b/moksha/tests/functional/test_csrf.py
@@ -76,11 +76,13 @@ class TestCSRFProtection(TestController):
# Make sure we can't get back to the page without the token
resp = self.app.get('/moksha_admin/', status=302)
assert 'The resource was found at /post_logout' in resp or \
- 'The resource was found at /login' in resp, resp
+ 'The resource was found at /login' in resp or \
+ 'The resource was found at http://localhost/login' in resp
# Make sure that we can't get back after we got rejected once
resp = self.app.post('/moksha_admin/', {'_csrf_token': token}, status=302)
- assert 'The resource was found at /login' in resp, resp
+ assert 'The resource was found at /login' in resp or \
+ 'The resource was found at http://localhost/login' in resp
# Ensure the token gets removed
resp = self.app.get('/', status=200)
@@ -104,4 +106,5 @@ class TestCSRFProtection(TestController):
# Now, make sure we reject invalid tokens
resp = self.app.post('/moksha_admin/', {'_csrf_token': token + ' '}, status=302)
- assert 'The resource was found at /post_logout' in resp, resp
+ assert 'The resource was found at /post_logout' in resp or \
+ 'The resource was found at http://localhost/post_logout' in resp
commit e658ef86925c8144303c4f6de76dbcea624634a0
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Jun 4 18:14:36 2010 -0400
Get our middleware working with TG2.1!
diff --git a/moksha/middleware/middleware.py b/moksha/middleware/middleware.py
index 8aca064..315e313 100644
--- a/moksha/middleware/middleware.py
+++ b/moksha/middleware/middleware.py
@@ -202,54 +202,57 @@ class MokshaMiddleware(object):
"""
from mako.template import Template
from mako.lookup import TemplateLookup
- try: # TG2b6 and later
- from tg.dottednamesupport import DottedTemplateLookup
- except: # TG2b5 and earlier
- from tg.util import get_dotted_filename
-
- class DottedTemplateLookup(object):
- """this is an emulation of the Mako template lookup
- that will handle get_template and support dotted names
- in python path notation to support zipped eggs
- """
- def __init__(self, input_encoding, output_encoding,
- imports, default_filters):
- self.input_encoding = input_encoding
- self.output_encoding = output_encoding
- self.imports = imports
- self.default_filters = default_filters
-
- def adjust_uri(self, uri, relativeto):
- """this method is used by mako for filesystem based reasons.
- In dotted lookup land we don't adjust uri so se just return
- the value we are given without any change
+ try: # TG2.1
+ from tg.dottednames.mako_lookup import DottedTemplateLookup
+ except ImportError:
+ try: # TG2b6
+ from tg.dottednamesupport import DottedTemplateLookup
+ except: # TG2b5 and earlier
+ from tg.util import get_dotted_filename
+
+ class DottedTemplateLookup(object):
+ """this is an emulation of the Mako template lookup
+ that will handle get_template and support dotted names
+ in python path notation to support zipped eggs
"""
- if '.' in uri:
- """we are in the DottedTemplateLookup system so dots in
- names should be treated as a python path.
- Since this method is called by template inheritance we must
- support dotted names also in the inheritance.
+ def __init__(self, input_encoding, output_encoding,
+ imports, default_filters):
+ self.input_encoding = input_encoding
+ self.output_encoding = output_encoding
+ self.imports = imports
+ self.default_filters = default_filters
+
+ def adjust_uri(self, uri, relativeto):
+ """this method is used by mako for filesystem based reasons.
+ In dotted lookup land we don't adjust uri so se just return
+ the value we are given without any change
"""
- result = get_dotted_filename(template_name=uri,
- template_extension='.mak')
-
- else:
- """no dot detected, just return plain name
+ if '.' in uri:
+ """we are in the DottedTemplateLookup system so dots in
+ names should be treated as a python path.
+ Since this method is called by template inheritance we must
+ support dotted names also in the inheritance.
+ """
+ result = get_dotted_filename(template_name=uri,
+ template_extension='.mak')
+
+ else:
+ """no dot detected, just return plain name
+ """
+ result = uri
+
+ return result
+
+ def get_template(self, template_name):
+ """this is the emulated method that must return a template
+ instance based on a given template name
"""
- result = uri
-
- return result
-
- def get_template(self, template_name):
- """this is the emulated method that must return a template
- instance based on a given template name
- """
- return Template(open(template_name).read(),
- input_encoding=self.input_encoding,
- output_encoding=self.output_encoding,
- default_filters=self.default_filters,
- imports=self.imports,
- lookup=self)
+ return Template(open(template_name).read(),
+ input_encoding=self.input_encoding,
+ output_encoding=self.output_encoding,
+ default_filters=self.default_filters,
+ imports=self.imports,
+ lookup=self)
if config.get('use_dotted_templatenames', True):
# support dotted names by injecting a slightly different template
13 years, 11 months
2 commits - moksha/__init__.py setup.py start-moksha
by Luke Macken
moksha/__init__.py | 3 ++-
setup.py | 4 ++--
start-moksha | 14 ++++++++------
3 files changed, 12 insertions(+), 9 deletions(-)
New commits:
commit 759697609564acdefe2d4b019d735923ae1ce756
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Jun 4 16:19:48 2010 -0400
Get our virtualenv setup working again! w00t.
diff --git a/setup.py b/setup.py
index 9deaaa1..5ff80cd 100644
--- a/setup.py
+++ b/setup.py
@@ -26,12 +26,12 @@ setup(
url='http://moksha.fedorahosted.org',
install_requires=[
"TurboGears2",
- "ToscaWidgets >= 0.9.1",
+ "ToscaWidgets>=0.9.9",
"zope.sqlalchemy",
#"Shove",
"feedcache",
"feedparser",
- "tw.jquery",
+ "tw.jquery>=0.9.9",
"orbited",
#"Twisted",
"stomper",
diff --git a/start-moksha b/start-moksha
index 73e6345..e6a07e2 100755
--- a/start-moksha
+++ b/start-moksha
@@ -9,10 +9,12 @@ if [ ! $VIRTUAL_ENV ]; then
#fi
#python tg2-bootstrap.py --no-site-packages tg2env
- virtualenv --no-site-packages tg2env
+ virtualenv --distribute --no-site-packages tg2env
source tg2env/bin/activate
#easy_install -i http://www.turbogears.org/2.1/downloads/current/index tg.devtools
+ # HACK: http://groups.google.com/group/turbogears/browse_thread/thread/0176623b98...
+ easy_install Extremes
easy_install -i http://www.turbogears.org/2.0/downloads/current/index tg.devtools
# Hack around Shove's hard SQLAlchemy requirement :(
@@ -21,19 +23,19 @@ if [ ! $VIRTUAL_ENV ]; then
easy_install -U SQLAlchemy
easy_install Paver
easy_install Twisted
- easy_install pysqlite
+ #easy_install pysqlite
easy_install -U ToscaWidgets
easy_install "tw.jquery>=0.9.9"
- easy_install -U SQLAlchemy
- easy_install -U FormEncode
- easy_install -U Beaker
+ #easy_install -U SQLAlchemy
+ #easy_install -U FormEncode
+ #easy_install -U Beaker
# `install` instead of `develop` to avoid weird directory vs. egg
# namespace issues
- #echo "Installing Moksha"
echo "Installing Moksha"
#rm -fr dist
python setup.py install
+
#python setup.py bdist_egg
#easy_install -Z dist/*.egg
commit de0910f42270192fc6b46879c872c4555d77326a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Jun 4 16:09:54 2010 -0400
Make our moksha.get_widget method more robust.
(Before this, it would cause `paster tginfo` to traceback)
diff --git a/moksha/__init__.py b/moksha/__init__.py
index c0c1d82..91ec102 100644
--- a/moksha/__init__.py
+++ b/moksha/__init__.py
@@ -41,7 +41,8 @@ livewidgets = StackedObjectProxy(name="livewidgets")
def get_widget(name):
""" Get a widget instance by name """
- return _widgets[name]['widget']
+ if _widgets:
+ return _widgets[name]['widget']
def get_app(name):
""" Get an app controller by name """
13 years, 11 months