pavement.py setup.py
by Luke Macken
pavement.py | 2 +-
setup.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit f7084e3dc651b218fab9555709f5cc47cbdc7430
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Sep 30 12:21:43 2010 -0400
Prep for 0.5.0
diff --git a/pavement.py b/pavement.py
index 5b07572..8f51454 100644
--- a/pavement.py
+++ b/pavement.py
@@ -28,7 +28,7 @@ import paver.virtual
from paver.setuputils import install_distutils_tasks
install_distutils_tasks()
-VERSION = '0.4.4'
+VERSION = '0.5.0'
HEADER = """This file is part of Moksha.
Copyright (C) 2008-2010 Red Hat, Inc.
diff --git a/setup.py b/setup.py
index 8d474ef..1ce16a3 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ from paver.setuputils import find_package_data
setup(
name='moksha',
- version='0.4.4',
+ version='0.5.0',
description='',
author='',
author_email='',
13 years, 8 months
moksha.spec
by Luke Macken
moksha.spec | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
New commits:
commit 582cf63da2d7e1249835cdb87559b91a8a156e16
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Sep 22 14:26:02 2010 -0400
Update our spec to remove some unnecessary deps, and tweak the summary
diff --git a/moksha.spec b/moksha.spec
index 67c6fe5..bbff666 100644
--- a/moksha.spec
+++ b/moksha.spec
@@ -4,7 +4,7 @@
Name: moksha
Version: 0.4.4
Release: 1%{?dist}
-Summary: A flexable platform for creating live collaborative web applications
+Summary: A platform for creating live collaborative web applications
Group: Applications/Internet
License: AGPLv3
URL: https://fedorahosted.org/moksha
@@ -29,8 +29,6 @@ Requires: python-shove
Requires: python-feedcache
Requires: python-feedparser
Requires: python-tw-jquery >= 0.9.4.1
-#Requires: python-repoze-squeeze
-#Requires: python-repoze-profile
Requires: orbited
Requires: python-sphinx
Requires: python-paver
13 years, 9 months
moksha/templates
by Luke Macken
moksha/templates/login.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit d1ad30484e3c5c162033f97765cd70aa7f8d413c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Sep 13 09:58:00 2010 -0400
Update our login handler to the latest TG2.1 quickstart
diff --git a/moksha/templates/login.mak b/moksha/templates/login.mak
index e300267..154f667 100644
--- a/moksha/templates/login.mak
+++ b/moksha/templates/login.mak
@@ -1,5 +1,5 @@
<div id="loginform">
-<form action="${tg.url('/login_handler', came_from = came_from.encode('utf-8'), __logins = login_counter.encode('utf-8'))}" method="POST" class="loginfields">
+<form action="${tg.url('/login_handler', params=dict(came_from=came_from.encode('utf-8'), __logins=login_counter.encode('utf-8')))}" method="POST" class="loginfields">
<h2><span>Login</span></h2>
<label for="login">Username:</label><input type="text" id="login" name="login" class="text"></input><br/>
<label for="password">Password:</label><input type="password" id="password" name="password" class="text"></input>
13 years, 9 months
2 commits - moksha/commands moksha/model
by Luke Macken
moksha/commands/cli.py | 32 ++++++-
moksha/model/auth.py | 220 +++++++++++++++++++++++++++----------------------
2 files changed, 156 insertions(+), 96 deletions(-)
New commits:
commit 0c944abfce69ebf31e82fac43ec1cbb9141a0dab
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Sep 12 03:13:02 2010 -0400
Get 'moksha --list' working
diff --git a/moksha/commands/cli.py b/moksha/commands/cli.py
index 23b3a1f..e510cc7 100644
--- a/moksha/commands/cli.py
+++ b/moksha/commands/cli.py
@@ -4,8 +4,11 @@
import os
import sys
import signal
+import pkg_resources
+from optparse import OptionParser
from subprocess import Popen, PIPE
+from setuptools.command import easy_install
from twisted.internet import protocol
from twisted.internet import reactor
@@ -57,6 +60,14 @@ class MokshaCLI(object):
def list(self):
""" List all available apps, widgets, producers and consumers """
+ entry_points = ('widget', 'application', 'wsgiapp',
+ 'producer', 'consumer')
+ for entry in entry_points:
+ print "[moksha.%s]" % entry
+ for obj_entry in pkg_resources.iter_entry_points('moksha.' + entry):
+ print " * %s" % obj_entry.name
+ print
+
def install(self):
""" Install a Moksha component """
@@ -69,9 +80,22 @@ class MokshaCLI(object):
# If no arguments given, run `paster moksha --help`
+def get_parser():
+ usage = 'usage: %prog [command]'
+ parser = OptionParser(usage)
+ parser.add_option('', '--start', action='store_true', dest='start',
+ help='Start Moksha')
+ parser.add_option('', '--list', action='store_true', dest='list',
+ help='List all installed Moksha components')
+ return parser
+
+
def main():
+ parser = get_parser()
+ opts, args = parser.parse_args()
moksha = MokshaCLI()
- if sys.argv[1] == 'start':
+
+ if opts.start:
print "Starting Moksha..."
moksha.start()
try:
@@ -79,3 +103,9 @@ def main():
except Exception, e:
print "Caught exception: %s" % str(e)
moksha.stop()
+ elif opts.list:
+ moksha.list()
+
+
+if __name__ == '__main__':
+ main()
commit 7afb20e0f6a144c21eaecbb0aa284ad8403e9cfb
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Sep 12 00:47:45 2010 -0400
Update our auth model from the latest TG2.1 quickstart
diff --git a/moksha/model/auth.py b/moksha/model/auth.py
index 8bf50e6..9d2ffff 100644
--- a/moksha/model/auth.py
+++ b/moksha/model/auth.py
@@ -1,104 +1,148 @@
+# -*- coding: utf-8 -*-
# This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
-#
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
-#
+#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+Auth* related model.
+
+This is where the models used by :mod:`repoze.who` and :mod:`repoze.what` are
+defined.
+"""
import os
-import md5
-import sha
from datetime import datetime
+import sys
try:
from hashlib import sha1
except ImportError:
- from sha import sha as sha1
+ sys.exit('ImportError: No module named hashlib\n'
+ 'If you are on python2.4 this library is not part of python. '
+ 'Please install it. Example: easy_install hashlib')
-from tg import config
from sqlalchemy import Table, ForeignKey, Column
-from sqlalchemy.types import String, Unicode, UnicodeText, Integer, DateTime, \
- Boolean, Float
-from sqlalchemy.orm import relation, backref, synonym
+from sqlalchemy.types import Unicode, Integer, DateTime
+from sqlalchemy.orm import relation, synonym
from moksha.model import DeclarativeBase, metadata, DBSession
+__all__ = ['User', 'Group', 'Permission']
+
+
+#{ Association tables
+
# This is the association table for the many-to-many relationship between
-# groups and permissions.
+# groups and permissions. This is required by repoze.what.
group_permission_table = Table('tg_group_permission', metadata,
Column('group_id', Integer, ForeignKey('tg_group.group_id',
- onupdate="CASCADE", ondelete="CASCADE")),
+ onupdate="CASCADE", ondelete="CASCADE"), primary_key=True),
Column('permission_id', Integer, ForeignKey('tg_permission.permission_id',
- onupdate="CASCADE", ondelete="CASCADE"))
+ onupdate="CASCADE", ondelete="CASCADE"), primary_key=True)
)
# This is the association table for the many-to-many relationship between
-# groups and members - this is, the memberships.
+# groups and members - this is, the memberships. It's required by repoze.what.
user_group_table = Table('tg_user_group', metadata,
Column('user_id', Integer, ForeignKey('tg_user.user_id',
- onupdate="CASCADE", ondelete="CASCADE")),
+ onupdate="CASCADE", ondelete="CASCADE"), primary_key=True),
Column('group_id', Integer, ForeignKey('tg_group.group_id',
- onupdate="CASCADE", ondelete="CASCADE"))
+ onupdate="CASCADE", ondelete="CASCADE"), primary_key=True)
)
-# auth model
+
+#{ The auth* model itself
+
class Group(DeclarativeBase):
- """An ultra-simple group definition.
"""
+ Group definition for :mod:`repoze.what`.
+
+ Only the ``group_name`` column is required by :mod:`repoze.what`.
+
+ """
+
__tablename__ = 'tg_group'
+ #{ Columns
+
group_id = Column(Integer, autoincrement=True, primary_key=True)
+
group_name = Column(Unicode(16), unique=True, nullable=False)
+
display_name = Column(Unicode(255))
+
created = Column(DateTime, default=datetime.now)
+
+ #{ Relations
+
users = relation('User', secondary=user_group_table, backref='groups')
+ #{ Special methods
+
def __repr__(self):
- return '<Group: name=%s>' % self.group_name
+ return '<Group: name=%r>' % self.group_name
def __unicode__(self):
return self.group_name
+ #}
+
-#
# The 'info' argument we're passing to the email_address and password columns
# contain metadata that Rum (http://python-rum.org/) can use generate an
# admin interface for your models.
-#
class User(DeclarativeBase):
- """Reasonably basic User definition. Probably would want additional
- attributes.
+ """
+ User definition.
+
+ This is the user definition used by :mod:`repoze.who`, which requires at
+ least the ``user_name`` column.
+
"""
__tablename__ = 'tg_user'
+ #{ Columns
+
user_id = Column(Integer, autoincrement=True, primary_key=True)
+
user_name = Column(Unicode(16), unique=True, nullable=False)
+
email_address = Column(Unicode(255), unique=True, nullable=False,
info={'rum': {'field':'Email'}})
+
display_name = Column(Unicode(255))
+
_password = Column('password', Unicode(80),
info={'rum': {'field':'Password'}})
+
created = Column(DateTime, default=datetime.now)
+ #{ Special methods
+
def __repr__(self):
- return '<User: email="%s", display name="%s">' % (
- self.email_address, self.display_name)
+ return '<User: name=%r, email=%r, display=%r>' % (
+ self.user_name, self.email_address, self.display_name)
def __unicode__(self):
return self.display_name or self.user_name
+ #{ Getters and setters
+
@property
def permissions(self):
+ """Return a set with all permissions granted to the user."""
perms = set()
for g in self.groups:
perms = perms | set(g.permissions)
@@ -106,104 +150,90 @@ class User(DeclarativeBase):
@classmethod
def by_email_address(cls, email):
- """A class method that can be used to search users
- based on their email addresses since it is unique.
- """
- return DBSession.query(cls).filter(cls.email_address==email).first()
+ """Return the user object whose email address is ``email``."""
+ return DBSession.query(cls).filter(cls.email_address == email).first()
@classmethod
def by_user_name(cls, username):
- """A class method that permits to search users
- based on their user_name attribute.
- """
- return DBSession.query(cls).filter(cls.user_name==username).first()
+ """Return the user object whose user name is ``username``."""
+ return DBSession.query(cls).filter(cls.user_name == username).first()
def _set_password(self, password):
- """encrypts password on the fly using the encryption
- algo defined in the configuration
- """
- algorithm = self.get_encryption_method()
- self._password = self.__encrypt_password(algorithm, password)
+ """Hash ``password`` on the fly and store its hashed version."""
+ # Make sure password is a str because we cannot hash unicode objects
+ if isinstance(password, unicode):
+ password = password.encode('utf-8')
+ salt = sha1()
+ salt.update(os.urandom(60))
+ hash = sha1()
+ hash.update(password + salt.hexdigest())
+ password = salt.hexdigest() + hash.hexdigest()
+ # Make sure the hashed password is a unicode object at the end of the
+ # process because SQLAlchemy _wants_ unicode objects for Unicode cols
+ if not isinstance(password, unicode):
+ password = password.decode('utf-8')
+ self._password = password
def _get_password(self):
- """returns password
- """
+ """Return the hashed version of the password."""
return self._password
password = synonym('_password', descriptor=property(_get_password,
_set_password))
- def __encrypt_password(self, algorithm, password):
- """Hash the given password with the specified algorithm. Valid values
- for algorithm are 'md5' and 'sha1'. All other algorithm values will
- be essentially a no-op."""
- hashed_password = password
+ #}
- if isinstance(password, unicode):
- password_8bit = password.encode('UTF-8')
- else:
- password_8bit = password
-
- if "md5" == algorithm:
- hashed_password = md5.new(password_8bit).hexdigest()
- elif "sha1" == algorithm:
- hashed_password = sha.new(password_8bit).hexdigest()
- elif "salted_sha1" == algorithm:
- salt = sha1()
- salt.update(os.urandom(60))
- hash = sha1()
- hash.update(password_8bit + salt.hexdigest())
- hashed_password = salt.hexdigest() + hash.hexdigest()
-
- # make sure the hased password is an UTF-8 object at the end of the
- # process because SQLAlchemy _wants_ a unicode object for Unicode columns
- if not isinstance(hashed_password, unicode):
- hashed_password = hashed_password.decode('UTF-8')
-
- return hashed_password
-
- def get_encryption_method(self):
- """returns the encryption method from the config
- If None is set, or auth is disabled this will return None
+ def validate_password(self, password):
"""
- auth_system = config.get('sa_auth', None)
- if auth_system is None:
- # if auth is not activated in the config we should warn
- # the admin through the logs... and return None
- return None
+ Check the password against existing credentials.
- return auth_system.get('password_encryption_method', None)
+ :param password: the password that was provided by the user to
+ try and authenticate. This is the clear text version that we will
+ need to match against the hashed one in the database.
+ :type password: unicode object.
+ :return: Whether the password is valid.
+ :rtype: bool
- def validate_password(self, password):
- """Check the password against existing credentials.
- this method _MUST_ return a boolean.
-
- @param password: the password that was provided by the user to
- try and authenticate. This is the clear text version that we will
- need to match against the (possibly) encrypted one in the database.
- @type password: unicode object
"""
- algorithm = self.get_encryption_method()
- if "salted_sha1" == algorithm:
- hashed_pass = sha1()
- hashed_pass.update(password + self.password[:40])
+ hash = sha1()
+ if isinstance(password, unicode):
+ password = password.encode('utf-8')
+ hash.update(password + str(self.password[:40]))
+ return self.password[40:] == hash.hexdigest()
- return self.password[40:] == hashed_pass.hexdigest()
- else:
- return self.password == self.__encrypt_password(algorithm, password)
+class Permission(DeclarativeBase):
+ """
+ Permission definition for :mod:`repoze.what`.
+ Only the ``permission_name`` column is required by :mod:`repoze.what`.
-class Permission(DeclarativeBase):
- """A relationship that determines what each Group can do
"""
+
__tablename__ = 'tg_permission'
+ #{ Columns
+
permission_id = Column(Integer, autoincrement=True, primary_key=True)
- permission_name = Column(Unicode(16), unique=True, nullable=False)
+
+ permission_name = Column(Unicode(63), unique=True, nullable=False)
+
description = Column(Unicode(255))
+
+ #{ Relations
+
groups = relation(Group, secondary=group_permission_table,
backref='permissions')
+ #{ Special methods
+
+ def __repr__(self):
+ return '<Permission: name=%r>' % self.permission_name
+
def __unicode__(self):
return self.permission_name
+
+ #}
+
+
+#}
13 years, 9 months
2 commits - moksha/commands moksha/lib moksha.spec setup.py
by Luke Macken
moksha.spec | 1
moksha/commands/cli.py | 81 ++++++++++++++++++++++++++++++++++++++++++++++
moksha/lib/paver_tasks.py | 26 +++++++++++---
setup.py | 1
4 files changed, 104 insertions(+), 5 deletions(-)
New commits:
commit b0a6bf9e8c039d17983a0abbad68a87e7d05f8a9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Sep 12 00:38:11 2010 -0400
Get the appropriate RPM top dir from rpm instead of guessing
diff --git a/moksha/lib/paver_tasks.py b/moksha/lib/paver_tasks.py
index ff7c6cc..1a0213c 100644
--- a/moksha/lib/paver_tasks.py
+++ b/moksha/lib/paver_tasks.py
@@ -1,6 +1,10 @@
import os
from paver.easy import *
+def rpm_topdir():
+ """ Return the RPM top dir """
+ return sh("rpm --eval='%{_topdir}'", capture=True).strip()
+
@task
def rpm():
specfile = '%s.spec' % options.rpm_name
@@ -53,17 +57,29 @@ paver install -O1 --skip-build --root %%{buildroot} --record INSTALLED_FILES
'url': options.url, 'rpm_name': options.rpm_name})
spec_file.close()
+ topdir = rpm_topdir()
+ if not topdir:
+ print "Error: No RPM build directory found. Try installing the "
+ print "fedora-packager package and running `rpmdev-setuptree`?"
+ sys.exit(-1)
+
sh('paver sdist --format=bztar')
- sh('mv dist/* ~/rpmbuild/SOURCES/')
- sh('cp %s.spec ~/rpmbuild/SPECS/' % options.rpm_name)
- sh('rpmbuild -ba ~/rpmbuild/SPECS/%s.spec' % options.rpm_name)
+ sh('mv dist/* %s/SOURCES/' % topdir)
+ sh('cp %s.spec %s/SPECS/' % (options.rpm_name, topdir))
+ sh('rpmbuild -ba %s/SPECS/%s.spec' % (topdir, options.rpm_name))
@task
@needs(['rpm'])
def reinstall():
+ topdir = rpm_topdir()
+ if not topdir:
+ print "Error: No RPM build directory found. Try installing the "
+ print "fedora-packager package and running `rpmdev-setuptree`?"
+ sys.exit(-1)
+
sh('sudo rpm -e %s' % options.rpm_name, ignore_error=True)
- sh('sudo rpm -ivh ~/rpmbuild/RPMS/noarch/%s-%s-%s.*noarch.rpm' % (
- options.rpm_name, options.version, options.release))
+ sh('sudo rpm -ivh %s/RPMS/noarch/%s-%s-%s.*noarch.rpm' % (
+ topdir, options.rpm_name, options.version, options.release))
@task
@needs('setuptools.command.install')
commit 90fc06ad7ad14a68060d902c84bcd597447274fa
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Sep 12 00:37:40 2010 -0400
Add the beginning of a `moksha` command-line tool.
Currently, only `moksha start` is implemented.
diff --git a/moksha.spec b/moksha.spec
index aa13e45..67c6fe5 100644
--- a/moksha.spec
+++ b/moksha.spec
@@ -127,6 +127,7 @@ restorecon -Rv /var/cache/moksha
%files
%defattr(-,root,root,-)
%doc README AUTHORS LICENSE COPYING
+%{_bindir}/moksha
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}-%{version}-py%{pyver}.egg-info/
%attr(-,apache,apache) %dir %{_localstatedir}/lib/%{name}
diff --git a/moksha/commands/cli.py b/moksha/commands/cli.py
new file mode 100644
index 0000000..23b3a1f
--- /dev/null
+++ b/moksha/commands/cli.py
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+""" The Moksha Command-line Interface """
+
+import os
+import sys
+import signal
+
+from subprocess import Popen, PIPE
+from twisted.internet import protocol
+from twisted.internet import reactor
+
+pids = []
+
+class MokshaProcessProtocol(protocol.ProcessProtocol):
+ def __init__(self, name):
+ self.name = name
+ def connectionMade(self):
+ pass
+ def outReceived(self, data):
+ sys.stdout.write(data)
+ def errReceived(self, data):
+ sys.stderr.write(data)
+ def inConnectionLost(self):
+ pass
+ def outConnectionLost(self):
+ pass
+ def errConnectionLost(self):
+ pass
+ def processEnded(self, status_object):
+ print "Process %r quit with status %d" % (
+ self.name, status_object.value.exitCode)
+ reactor.stop()
+ for pid in pids:
+ try:
+ os.kill(pid, signal.SIGTERM)
+ except OSError:
+ pass
+
+
+class MokshaCLI(object):
+
+ def _exec(self, process, *args, **kw):
+ args = args and [process] + list(args) or [process]
+ print "Running %s %s" % (process, ' '.join(args))
+ pp = MokshaProcessProtocol(name=process)
+ orbited = reactor.spawnProcess(pp, process, args, **kw)
+ pids.append(orbited.pid)
+
+ def start(self):
+ """ Start all of the Moksha components """
+ # Try to import moksha. If you can, move on.
+ # If not, setup a virtualenv if one doesn't already exist
+
+ self._exec('orbited')
+ self._exec('paster', 'serve', 'development.ini')
+ self._exec('moksha-hub')
+
+ def list(self):
+ """ List all available apps, widgets, producers and consumers """
+
+ def install(self):
+ """ Install a Moksha component """
+
+ def uninstall(self):
+ """ Uninstall a Moksha component """
+
+ def quickstart(self):
+ """ Create a new Moksha component """
+ # If no arguments given, run `paster moksha --help`
+
+
+def main():
+ moksha = MokshaCLI()
+ if sys.argv[1] == 'start':
+ print "Starting Moksha..."
+ moksha.start()
+ try:
+ reactor.run()
+ except Exception, e:
+ print "Caught exception: %s" % str(e)
+ moksha.stop()
diff --git a/setup.py b/setup.py
index e4b6e94..8d474ef 100644
--- a/setup.py
+++ b/setup.py
@@ -70,6 +70,7 @@ setup(
entry_points="""
[console_scripts]
moksha-hub = moksha.hub.hub:main
+ moksha = moksha.commands.cli:main
[paste.app_factory]
main = moksha.config.middleware:make_app
13 years, 9 months
4 commits - docs/main moksha/apps moksha/controllers moksha/middleware moksha/widgets
by Luke Macken
docs/main/VirtualenvInstallation.rst | 2 +-
moksha/apps/menus/moksha/apps/menus/controllers/menu.py | 2 +-
moksha/controllers/widgets.py | 2 +-
moksha/middleware/middleware.py | 5 +++--
moksha/widgets/container/container.py | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
New commits:
commit d5cbb9b67d80701469c612b2b5be0509c1c8229f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Sep 11 18:49:10 2010 -0400
Make our feed store & cache more configurable
diff --git a/moksha/middleware/middleware.py b/moksha/middleware/middleware.py
index 315e313..92d0639 100644
--- a/moksha/middleware/middleware.py
+++ b/moksha/middleware/middleware.py
@@ -72,8 +72,9 @@ class MokshaMiddleware(object):
self.load_menus()
try:
- moksha.feed_storage = Shove(config.get('feed_cache',
- 'sqlite:///%(here)s/feeds.db'), compress=True)
+ moksha.feed_storage = Shove(config.get('feed_store', 'simple://'),
+ config.get('feed_cache', 'simple://'),
+ compress=True)
moksha.feed_cache = Cache(moksha.feed_storage)
except Exception, e:
log.exception(e)
commit b81b9402806bad9e05f23614f52c36e2cbac6b79
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Sep 11 18:48:35 2010 -0400
Rename our default methods to _default, per new TG2 standard
diff --git a/moksha/apps/menus/moksha/apps/menus/controllers/menu.py b/moksha/apps/menus/moksha/apps/menus/controllers/menu.py
index f2c4e62..bd40fe9 100644
--- a/moksha/apps/menus/moksha/apps/menus/controllers/menu.py
+++ b/moksha/apps/menus/moksha/apps/menus/controllers/menu.py
@@ -23,7 +23,7 @@ class MokshaMenuController(Controller):
name = 'Moksha Menus'
@expose()
- def default(self, menuId, *args, **kw):
+ def _default(self, menuId, *args, **kw):
""" For the selected `menuId`, return the menu HTML.
The `menuId` is the name of the portion of the menu that was clicked
diff --git a/moksha/controllers/widgets.py b/moksha/controllers/widgets.py
index 00542e9..07cca6f 100644
--- a/moksha/controllers/widgets.py
+++ b/moksha/controllers/widgets.py
@@ -41,7 +41,7 @@ class WidgetController(Controller):
'module': validators.StringBool(),
'iframe': validators.StringBool(),
})
- def default(self, widget, chrome=False, live=False, source=False,
+ def _default(self, widget, chrome=False, live=False, source=False,
module=False, iframe=False, **kw):
""" Display a single widget.
commit ce94925c7813a77c686927b1e68f1e052505e2d1
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Sep 11 18:48:06 2010 -0400
Make our Container widget robust enough to handle different ToscaWidget versions
diff --git a/moksha/widgets/container/container.py b/moksha/widgets/container/container.py
index 5a11dde..69563db 100644
--- a/moksha/widgets/container/container.py
+++ b/moksha/widgets/container/container.py
@@ -69,7 +69,7 @@ class MokshaContainer(Widget):
if isinstance(d.content, Widget):
d.widget_name = d.content.__class__.__name__
- content_args = d.content_args or {}
+ content_args = getattr(d, 'content_args', {})
if isinstance(d.content, LiveWidget):
topics = d.content.get_topics()
commit 1004643fa08021c8bbdfceeda984fa232b6ae2d1
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Sep 11 18:24:02 2010 -0400
Add openssl-devel to getting started docs
diff --git a/docs/main/VirtualenvInstallation.rst b/docs/main/VirtualenvInstallation.rst
index 89370a0..7d9d282 100644
--- a/docs/main/VirtualenvInstallation.rst
+++ b/docs/main/VirtualenvInstallation.rst
@@ -18,7 +18,7 @@ You'll need the `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ package.
.. code-block:: bash
- # yum -y install python-virtualenv gcc
+ # yum -y install python-virtualenv gcc openssl-devel
# yum-builddep -y python-lxml pyOpenSSL python-sqlite2
13 years, 9 months