development.ini | 17 -------------
docs/main/Blueprint.rst | 34 +++++++++++++++++++++++++++
moksha.spec | 2 +
moksha/apps/chat/development.ini | 27 +++++++++++++++++++++
moksha/lib/paver_tasks.py | 12 +++++++++
moksha/middleware/middleware.py | 49 +++++++++++++++++++++------------------
pavement.py | 2 -
production/apache/moksha.conf | 2 +
8 files changed, 104 insertions(+), 41 deletions(-)
New commits:
commit 47c5ef2493f48a4378faf7cda0cba6014ec74453
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:28:40 2009 -0400
Update our middleware to support loading app configs from
/etc/moksha/conf.d/$appname/{development,production}.ini
diff --git a/moksha/middleware/middleware.py b/moksha/middleware/middleware.py
index 30c661d..7c44f32 100644
--- a/moksha/middleware/middleware.py
+++ b/moksha/middleware/middleware.py
@@ -290,37 +290,40 @@ class MokshaMiddleware(object):
where it is being run as WSGI middleware in a different environment.
"""
- moksha_config_path = get_moksha_config_path()
apps = []
+ loaded_configs = []
+ conf_d = '/etc/moksha/conf.d/%s/'
+
+ moksha_config_path = get_moksha_config_path()
if moksha_config_path:
moksha_config_path = os.path.dirname(moksha_config_path)
apps = [{'path': moksha_config_path}]
main_app_config_path = os.path.dirname(get_main_app_config_path())
- loaded_configs = []
apps += moksha._apps.values()
for app in apps:
for configfile in ('production.ini', 'development.ini'):
- confpath = os.path.join(app['path'], configfile)
- if os.path.exists(confpath):
- conf = appconfig('config:' + confpath)
- if app.get('name'):
- moksha._apps[app['name']]['config'] = conf
- if app['path'] == main_app_config_path or \
- confpath in loaded_configs:
- continue
- log.info('Loading configuration: %s' % confpath)
- for entry in conf.global_conf:
- if entry.startswith('_'):
- continue
- if entry in config:
- log.warning('Conflicting variable: %s' % entry)
+ for path in (app['path'], conf_d %
app.get('project_name')):
+ confpath = os.path.join(path, configfile)
+ if os.path.exists(confpath):
+ conf = appconfig('config:' + confpath)
+ if app.get('name'):
+ moksha._apps[app['name']]['config'] = conf
+ if app['path'] == main_app_config_path or \
+ confpath in loaded_configs:
continue
- else:
- config[entry] = conf.global_conf[entry]
- log.debug('Set `%s` in global config' % entry)
- loaded_configs.append(confpath)
- break
+ log.info('Loading configuration: %s' % confpath)
+ for entry in conf.global_conf:
+ if entry.startswith('_'):
+ continue
+ if entry in config:
+ log.warning('Conflicting variable: %s' % entry)
+ continue
+ else:
+ config[entry] = conf.global_conf[entry]
+ log.debug('Set `%s` in global config' % entry)
+ loaded_configs.append(confpath)
+ break
def load_models(self):
""" Setup the SQLAlchemy database models for all moksha
applications.
commit 9f86d268e042bb8927ddfc528353a08833c2ac84
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:28:21 2009 -0400
Move the rest of the chat-specific config into the chat app
diff --git a/development.ini b/development.ini
index 2e87f07..4c7e39b 100644
--- a/development.ini
+++ b/development.ini
@@ -63,23 +63,6 @@ stomp_pass = guest
docs_dir = docs
# docs_dir = /srv/moksha/docs
-# Moksha chat configuration
-
-# Use a built-in IRC server
-#chat.backend = irc://localhost:9999
-#chat.builtin = true
-chat.backend = irc://irc.freenode.net:6667
-chat.rooms = default
-chat.default.staticRoomName = moksha
-chat.default.roomAssignmentMode = static
-chat.default.display.greeting = Moksha Chat
-#chat.default.display.floating = true
-#chat.default.display.floatingToggle = false
-#chat.default.display.width = 400
-#chat.default.display.height = 300
-#chat.default.display.theme = simple
-#chat.default.display.resizable = true
-
[server:main]
use = egg:Paste#http
host = localhost
diff --git a/moksha/apps/chat/development.ini b/moksha/apps/chat/development.ini
new file mode 100644
index 0000000..b404d9e
--- /dev/null
+++ b/moksha/apps/chat/development.ini
@@ -0,0 +1,27 @@
+# Moksha chat configuration
+
+# Using this composite to hack around paste's appconfig requirements
+# We're not actually using this urlmap for anything...
+[composite:main]
+use = egg:Paste#urlmap
+/apps/moksha.chat = moksha.chat
+
+#[app:main]
+#use = egg:moksha.chat
+
+[DEFAULT]
+chat.backend = irc://irc.freenode.net:6667
+chat.rooms = default
+chat.default.staticRoomName = moksha
+chat.default.roomAssignmentMode = static
+chat.default.display.greeting = Moksha Chat
+
+# Use a built-in IRC server
+#chat.backend = irc://localhost:9999
+#chat.builtin = true
+#chat.default.display.floating = true
+#chat.default.display.floatingToggle = false
+#chat.default.display.width = 400
+#chat.default.display.height = 300
+#chat.default.display.theme = simple
+#chat.default.display.resizable = true
commit 701241d8ba4591eee9eebe6873f2eb4854f49f44
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:27:51 2009 -0400
Remove a stray comma
diff --git a/moksha/middleware/middleware.py b/moksha/middleware/middleware.py
index 5e5acaa..30c661d 100644
--- a/moksha/middleware/middleware.py
+++ b/moksha/middleware/middleware.py
@@ -124,7 +124,7 @@ class MokshaMiddleware(object):
log.info('Loading %s application' % app_entry.name)
app_class = app_entry.load()
app_path = app_entry.dist.location
- app_name = getattr(app_class, 'name', app_entry.name),
+ app_name = getattr(app_class, 'name', app_entry.name)
if isclass(app_class):
app_class = app_class()
moksha._apps[app_entry.name].update({
commit a6d9f0934f826f432589d57e014db25c96875fed
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:27:39 2009 -0400
Store the egg project_name for apps/widgets
diff --git a/moksha/middleware/middleware.py b/moksha/middleware/middleware.py
index f518a21..5e5acaa 100644
--- a/moksha/middleware/middleware.py
+++ b/moksha/middleware/middleware.py
@@ -104,6 +104,7 @@ class MokshaMiddleware(object):
app_path = app_entry.dist.location
moksha._apps[app_entry.name] = {
'name': app_entry.name,
+ 'project_name': app_entry.dist.project_name,
'path': app_path,
}
for widget_entry in pkg_resources.iter_entry_points('moksha.widget'):
@@ -113,6 +114,7 @@ class MokshaMiddleware(object):
widget_path = widget_entry.dist.location
moksha._widgets[widget_entry.name] = {
'name': widget_entry.name,
+ 'project_name': widget_entry.dist.project_name,
'path': widget_path,
}
commit 6ed3d973b4096d5a085170e54a0f476d212f4083
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:26:52 2009 -0400
Override the default install method for our apps
diff --git a/moksha/lib/paver_tasks.py b/moksha/lib/paver_tasks.py
index fcde954..bf40b5f 100644
--- a/moksha/lib/paver_tasks.py
+++ b/moksha/lib/paver_tasks.py
@@ -46,6 +46,7 @@ paver install -O1 --skip-build --root %%{buildroot}
%%files
%%defattr(-,root,root,-)
+%%config(noreplace) %%{_sysconfdir}/moksha/conf.d/%%{modname}/
%%{python_sitelib}/%%{modname}-%%{version}-py%%{pyver}-nspkg.pth
%%{python_sitelib}/%%{modname}-%%{version}-py%%{pyver}.egg-info/
%%{python_sitelib}/moksha/apps/*
@@ -64,3 +65,14 @@ paver install -O1 --skip-build --root %%{buildroot}
@needs(['rpm'])
def reinstall():
sh('sudo rpm -ivh --replacefiles --replacepkgs
~/rpmbuild/RPMS/noarch/%s-%s-%s.*noarch.rpm' % (options.rpm_name, options.version,
options.release))
+
+@task
+(a)needs('setuptools.command.install')
+def install():
+ """Overrides install to make sure that our setup.py is
generated."""
+ conf_d = path('etc') / 'moksha' / 'conf.d' / options.name
+ os.makedirs(path(options.install.root) / conf_d)
+ for cfg in path('.').glob('*.ini'):
+ if os.path.exists(cfg):
+ dest = path(options.install.root) / conf_d / cfg[2:]
+ sh('cp %s %s' % (cfg, dest))
commit 4d609c30d7c9139fff341b60c3c2dad65265d8dc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 27 05:25:49 2009 -0400
Create a /etc/moksha/conf.d for our app configs
diff --git a/moksha.spec b/moksha.spec
index 7776bce..f095a7d 100644
--- a/moksha.spec
+++ b/moksha.spec
@@ -89,6 +89,7 @@ make -C docs html
%{__mkdir_p} -m 0700 %{buildroot}/%{_localstatedir}/lib/%{name}
%{__mkdir_p} -m 0755 %{buildroot}%{_sysconfdir}/httpd/conf.d
%{__mkdir_p} -m 0755 %{buildroot}/%{_sysconfdir}/%{name}/
+%{__mkdir_p} -m 0755 %{buildroot}/%{_sysconfdir}/%{name}/conf.d
%{__install} production/*.* %{buildroot}%{_datadir}/%{name}/production/
%{__install} production/apache/* %{buildroot}%{_datadir}/%{name}/production/apache
@@ -124,6 +125,7 @@ make -C docs html
%changelog
* Mon Aug 24 2009 Luke Macken <lmacken(a)redhat.com> - 0.3.3-1
- Include our orbited configuration file in the moksha-server subpackage
+- Create a /etc/moksha/conf.d for our app configs
* Sat Aug 22 2009 Luke Macken <lmacken(a)redhat.com> - 0.3.2-1
- Update to 0.3.2
commit 8fa2f9fc679128953d2b3adbe03341a917fb5a1b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 26 17:11:20 2009 -0400
Clean up our nosetests usage
diff --git a/pavement.py b/pavement.py
index beadd07..4beab3a 100644
--- a/pavement.py
+++ b/pavement.py
@@ -172,9 +172,7 @@ def license():
@task
def test():
- from os import system
sh("nosetests")
- system("nosetests")
@task
def reinstall():
commit 4e0c60d045bbcf642a3b9edb7e00044119d3b4ee
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 25 21:17:28 2009 -0400
Add a mod_wsgi tip for when things go bad.
diff --git a/production/apache/moksha.conf b/production/apache/moksha.conf
index 3921113..1126ad3 100644
--- a/production/apache/moksha.conf
+++ b/production/apache/moksha.conf
@@ -26,6 +26,8 @@ CustomLog logs/moksha_access_log combined
WSGIScriptAlias / /usr/share/moksha/production/apache/moksha.wsgi
<Directory /usr/share/moksha/production/apache/>
+# If weird segfaults occur sometimes, give this a shot
+#WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
commit 3766127c1fef698f848de8e3074ae3c9d57ee656
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 25 21:16:08 2009 -0400
Add some blueprint documentation
diff --git a/docs/main/Blueprint.rst b/docs/main/Blueprint.rst
new file mode 100644
index 0000000..52a04c7
--- /dev/null
+++ b/docs/main/Blueprint.rst
@@ -0,0 +1,34 @@
+=========
+Blueprint
+=========
+
+"`Blueprint <
http://blueprintcss.org>`_ is a CSS framework, which aims to cut
+down on your development time. It gives you a solid foundation to build your
+project on top of, with an easy-to-use grid, sensible typography, useful
+plugins, and even a stylesheet for printing."
+
+Moksha comes with `Blueprint <
http://www.blueprintcss.org>`_ support out of the
+box. To enable blueprint, and various plugins, in your application, simply add
+it to your apps entry-points.
+
+.. code-block:: python
+
+ [moksha.global]
+
+ blueprint_ie_css = moksha.widgets.blueprint:blueprint_ie_css
+ blueprint_screen_css = moksha.widgets.blueprint:blueprint_screen_css
+ blueprint_print_css = moksha.widgets.blueprint:blueprint_print_css
+
+ ## Moksha comes with various Blueprint plugins as well
+
+ # Gives you classes to use if you'd like some extra fancy typography.
+ blueprint_fancytype_css = moksha.widgets.blueprint:blueprint_plugin_fancytype_css
+
+ # Gives you some great pure-CSS buttons.
+ blueprint_plugin_buttons_css = moksha.widgets.blueprint:blueprint_plugin_buttons_css
+
+ # Icons for links based on protocol or file type.
+ blueprint_plugin_linkicons_css =
moksha.widgets.blueprint:blueprint_plugin_linkicons_css
+
+ # Mirrors Blueprint, so it can be used with Right-to-Left languages.
+ blueprint_plugin_rtl_css = moksha.widgets.blueprint:blueprint_plugin_rtl_css