From 232ffbd8b5749c70a67e65fbe5f88a8ee0f262cd Mon Sep 17 00:00:00 2001 From: Eevee Date: Mon, 3 May 2010 22:20:23 -0700 Subject: [PATCH 1/1] Initial skeleton commit. --- .gitignore | 7 ++++++ migration/README | 4 ++++ migration/__init__.py | 0 migration/manage.py | 4 ++++ migration/migrate.cfg | 20 +++++++++++++++++ migration/versions/__init__.py | 0 setup.py | 19 ++++++++++++++++ spline/__init__.py | 1 + spline/plugins/__init__.py | 1 + spline/plugins/forum/__init__.py | 32 +++++++++++++++++++++++++++ spline/plugins/forum/controllers/__init__.py | 0 spline/plugins/forum/controllers/forum.py | 21 ++++++++++++++++++ spline/plugins/forum/model/__init__.py | 7 ++++++ spline/plugins/forum/templates/css/forum.mako | 0 14 files changed, 116 insertions(+) create mode 100644 .gitignore create mode 100644 migration/README create mode 100755 migration/__init__.py create mode 100644 migration/manage.py create mode 100644 migration/migrate.cfg create mode 100755 migration/versions/__init__.py create mode 100644 setup.py create mode 100644 spline/__init__.py create mode 100644 spline/plugins/__init__.py create mode 100644 spline/plugins/forum/__init__.py create mode 100644 spline/plugins/forum/controllers/__init__.py create mode 100644 spline/plugins/forum/controllers/forum.py create mode 100644 spline/plugins/forum/model/__init__.py create mode 100644 spline/plugins/forum/templates/css/forum.mako diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6df398f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.swp +*.pyc + +*.egg-info/ +/*.db +/data +/migration.py diff --git a/migration/README b/migration/README new file mode 100644 index 0000000..6218f8c --- /dev/null +++ b/migration/README @@ -0,0 +1,4 @@ +This is a database migration repository. + +More information at +http://code.google.com/p/sqlalchemy-migrate/ diff --git a/migration/__init__.py b/migration/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/migration/manage.py b/migration/manage.py new file mode 100644 index 0000000..0add9c2 --- /dev/null +++ b/migration/manage.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python +from migrate.versioning.shell import main + +main(repository='migration') diff --git a/migration/migrate.cfg b/migration/migrate.cfg new file mode 100644 index 0000000..fb4dcc0 --- /dev/null +++ b/migration/migrate.cfg @@ -0,0 +1,20 @@ +[db_settings] +# Used to identify which repository this database is versioned under. +# You can use the name of your project. +repository_id=spline-forun + +# The name of the database table used to track the schema version. +# This name shouldn't already be used by your project. +# If this is changed once a database is under version control, you'll need to +# change the table name in each database too. +version_table=migrate_version + +# When committing a change script, Migrate will attempt to generate the +# sql for all supported databases; normally, if one of them fails - probably +# because you don't have that database installed - it is ignored and the +# commit continues, perhaps ending successfully. +# Databases in this list MUST compile successfully during a commit, or the +# entire commit will fail. List the databases your application will actually +# be using to ensure your updates to that database work properly. +# This must be a list; example: ['postgres','sqlite'] +required_dbs=[] diff --git a/migration/versions/__init__.py b/migration/versions/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5e736f3 --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +from setuptools import setup, find_packages +setup( + name = 'spline-forum', + version = '0.1', + packages = find_packages(), + + install_requires = [ + 'spline', + 'spline-users', + ], + + include_package_data = True, + + zip_safe = False, + + entry_points = {'spline.plugins': 'forum = spline.plugins.forum:ForumPlugin'}, + + namespace_packages = ['spline', 'spline.plugins'], +) diff --git a/spline/__init__.py b/spline/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/spline/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/spline/plugins/__init__.py b/spline/plugins/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/spline/plugins/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/spline/plugins/forum/__init__.py b/spline/plugins/forum/__init__.py new file mode 100644 index 0000000..a3f259e --- /dev/null +++ b/spline/plugins/forum/__init__.py @@ -0,0 +1,32 @@ +from pkg_resources import resource_filename + +from pylons import c, session + +from spline.lib.plugin import PluginBase +from spline.lib.plugin import PluginBase, PluginLink, Priority +import spline.model as model +import spline.model.meta as meta + +import spline.plugins.forum.controllers.forum +import spline.plugins.forum.model + +def add_routes_hook(map, *args, **kwargs): + """Hook to inject some of our behavior into the routes configuration.""" + map.connect('/forum', controller='forum', action='index') + + +class ForumPlugin(PluginBase): + def controllers(self): + return dict( + forum = spline.plugins.forum.controllers.forum.ForumController, + ) + + def template_dirs(self): + return [ + (resource_filename(__name__, 'templates'), Priority.NORMAL) + ] + + def hooks(self): + return [ + ('routes_mapping', Priority.NORMAL, add_routes_hook), + ] diff --git a/spline/plugins/forum/controllers/__init__.py b/spline/plugins/forum/controllers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/spline/plugins/forum/controllers/forum.py b/spline/plugins/forum/controllers/forum.py new file mode 100644 index 0000000..6d577fb --- /dev/null +++ b/spline/plugins/forum/controllers/forum.py @@ -0,0 +1,21 @@ +import logging + +from pylons import config, request, response, session, tmpl_context as c, url +from pylons.controllers.util import abort, redirect_to +from routes import request_config +from sqlalchemy.orm.exc import NoResultFound + +from spline import model +from spline.model import meta +from spline.lib import helpers as h +from spline.lib.base import BaseController, render + +log = logging.getLogger(__name__) + +class ForumController(BaseController): + + def index(self): + # Return a rendered template + # return render('/template.mako') + # or, Return a response + return 'stub' diff --git a/spline/plugins/forum/model/__init__.py b/spline/plugins/forum/model/__init__.py new file mode 100644 index 0000000..f7d8a14 --- /dev/null +++ b/spline/plugins/forum/model/__init__.py @@ -0,0 +1,7 @@ +from sqlalchemy import Column, ForeignKey +from sqlalchemy.orm import relation +from sqlalchemy.types import Integer, Unicode + +from spline.model.meta import TableBase + +pass diff --git a/spline/plugins/forum/templates/css/forum.mako b/spline/plugins/forum/templates/css/forum.mako new file mode 100644 index 0000000..e69de29 -- 2.7.4