--- /dev/null
+README.txt
+setup.py
+start-beweb.py
+Bugs_Everywhere_Web.egg-info/PKG-INFO
+Bugs_Everywhere_Web.egg-info/SOURCES.txt
+Bugs_Everywhere_Web.egg-info/dependency_links.txt
+Bugs_Everywhere_Web.egg-info/not-zip-safe
+Bugs_Everywhere_Web.egg-info/paster_plugins.txt
+Bugs_Everywhere_Web.egg-info/requires.txt
+Bugs_Everywhere_Web.egg-info/sqlobject.txt
+Bugs_Everywhere_Web.egg-info/top_level.txt
+Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/SOURCES.txt
+Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/not-zip-safe
+Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/requires.txt
+Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/sqlobject.txt
+Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/top_level.txt
+beweb/__init__.py
+beweb/config.py
+beweb/controllers.py
+beweb/formatting.py
+beweb/json.py
+beweb/model.py
+beweb/prest.py
+beweb/release.py
+beweb/config/__init__.py
+beweb/templates/__init__.py
+beweb/tests/__init__.py
+beweb/tests/test_controllers.py
+beweb/tests/test_model.py
+libbe/__init__.py
+libbe/arch.py
+libbe/bugdir.py
+libbe/bzr.py
+libbe/cmdutil.py
+libbe/config.py
+libbe/diff.py
+libbe/mapfile.py
+libbe/names.py
+libbe/no_rcs.py
+libbe/plugin.py
+libbe/rcs.py
+libbe/restconvert.py
+libbe/tests.py
+libbe/utility.py
-TurboGears >= 0.8a4
\ No newline at end of file
+TurboGears >= 1.0b1
\ No newline at end of file
--- /dev/null
+[global]
+# The settings in this file should not vary depending on the deployment
+# environment. dev.cfg and prod.cfg are the locations for
+# the different deployment settings. Settings in this file will
+# be overridden by settings in those other files.
+
+# The commented out values below are the defaults
+
+# VIEW
+
+# which view (template engine) to use if one is not specified in the
+# template name
+# tg.defaultview = "kid"
+
+# The following kid settings determine the settings used by the kid serializer.
+
+# One of (html|xml|json)
+# kid.outputformat="html"
+
+# kid.encoding="utf-8"
+
+# The sitetemplate is used for overall styling of a site that
+# includes multiple TurboGears applications
+# tg.sitetemplate="<packagename.templates.templatename>"
+
+# Allow every exposed function to be called as json,
+# tg.allow_json = False
+
+# List of Widgets to include on every page.
+# for exemple ['turbogears.mochikit']
+# tg.include_widgets = []
+
+# Set to True if the scheduler should be started
+# tg.scheduler = False
+
+[/static]
+static_filter.on = True
+static_filter.dir = "%(top_level_dir)s/static"
+
+[/favicon.ico]
+static_filter.on = True
+static_filter.file = "%(top_level_dir)s/static/images/favicon.ico"
--- /dev/null
+# LOGGING
+# Logging is often deployment specific, but some handlers and
+# formatters can be defined here.
+
+[logging]
+[[formatters]]
+[[[message_only]]]
+format='*(message)s'
+
+[[[full_content]]]
+format='*(asctime)s *(name)s *(levelname)s *(message)s'
+
+[[handlers]]
+[[[debug_out]]]
+class='StreamHandler'
+level='DEBUG'
+args='(sys.stdout,)'
+formatter='full_content'
+
+[[[access_out]]]
+class='StreamHandler'
+level='INFO'
+args='(sys.stdout,)'
+formatter='message_only'
+
+[[[error_out]]]
+class='StreamHandler'
+level='ERROR'
+args='(sys.stdout,)'
-import turbogears
-from turbogears import controllers, expose, redirect, identity
+import logging
+
import cherrypy
+import turbogears
+from turbogears import controllers, expose, validate, redirect, identity
+
from libbe.bugdir import (tree_root, cmp_severity, new_bug, new_comment,
NoRootEntry)
from libbe import names
from config import projects
from prest import PrestHandler, provide_action
+
+from beweb import json
+
+log = logging.getLogger("beweb.controllers")
+
def project_tree(project):
try:
return tree_root(projects[project][1])
--- /dev/null
+# This module provides helper functions for the JSON part of your
+# view, if you are providing a JSON-based API for your app.
+
+# Here's what most rules would look like:
+# @jsonify.when("isinstance(obj, YourClass)")
+# def jsonify_yourclass(obj):
+# return [obj.val1, obj.val2]
+#
+# The goal is to break your objects down into simple values:
+# lists, dicts, numbers and strings
+
+from turbojson.jsonify import jsonify
+
+from datetime import datetime
+
from sqlobject import *
from turbogears.database import PackageHub
-# Uncomment the following line if you wish to use Identity and SO_Provider
-from turbogears.identity.soprovider import TG_User, TG_Group, TG_Permission
from turbogears import identity
hub = PackageHub("beweb")
__connection__ = hub
+class Visit(SQLObject):
+ class sqlmeta:
+ table = "visit"
+
+ visit_key = StringCol(length=40, alternateID=True,
+ alternateMethodName="by_visit_key")
+ created = DateTimeCol(default=datetime.now)
+ expiry = DateTimeCol()
+
+ def lookup_visit(cls, visit_key):
+ try:
+ return cls.by_visit_key(visit_key)
+ except SQLObjectNotFound:
+ return None
+ lookup_visit = classmethod(lookup_visit)
+
+class VisitIdentity(SQLObject):
+ visit_key = StringCol(length=40, alternateID=True,
+ alternateMethodName="by_visit_key")
+ user_id = IntCol()
+
+
+class Group(SQLObject):
+ """
+ An ultra-simple group definition.
+ """
+
+ # names like "Group", "Order" and "User" are reserved words in SQL
+ # so we set the name to something safe for SQL
+ class sqlmeta:
+ table = "tg_group"
+
+ group_name = UnicodeCol(length=16, alternateID=True,
+ alternateMethodName="by_group_name")
+ display_name = UnicodeCol(length=255)
+ created = DateTimeCol(default=datetime.now)
+
+ # collection of all users belonging to this group
+ users = RelatedJoin("User", intermediateTable="user_group",
+ joinColumn="group_id", otherColumn="user_id")
+
+ # collection of all permissions for this group
+ permissions = RelatedJoin("Permission", joinColumn="group_id",
+ intermediateTable="group_permission",
+ otherColumn="permission_id")
+
+
+class User(SQLObject):
+ """
+ Reasonably basic User definition. Probably would want additional attributes.
+ """
+ # names like "Group", "Order" and "User" are reserved words in SQL
+ # so we set the name to something safe for SQL
+ class sqlmeta:
+ table = "tg_user"
+
+ child_name = UnicodeCol(length=255)
+ user_name = UnicodeCol(length=16, alternateID=True,
+ alternateMethodName="by_user_name")
+ email_address = UnicodeCol(length=255, alternateID=True,
+ alternateMethodName="by_email_address")
+ display_name = UnicodeCol(length=255)
+ password = UnicodeCol(length=40)
+ created = DateTimeCol(default=datetime.now)
+
+ # groups this user belongs to
+ groups = RelatedJoin("Group", intermediateTable="user_group",
+ joinColumn="user_id", otherColumn="group_id")
+
+ def _get_permissions(self):
+ perms = set()
+ for g in self.groups:
+ perms = perms | set(g.permissions)
+ return perms
+
+ def _set_password(self, cleartext_password):
+ "Runs cleartext_password through the hash algorithm before saving."
+ hash = identity.encrypt_password(cleartext_password)
+ self._SO_set_password(hash)
+
+ def set_password_raw(self, password):
+ "Saves the password as-is to the database."
+ self._SO_set_password(password)
+
+
+
+class Permission(SQLObject):
+ permission_name = UnicodeCol(length=16, alternateID=True,
+ alternateMethodName="by_permission_name")
+ description = UnicodeCol(length=255)
+
+ groups = RelatedJoin("Group",
+ intermediateTable="group_permission",
+ joinColumn="permission_id",
+ otherColumn="group_id")
+
def people_map():
- return dict([(u.userId, u.displayName) for u in TG_User.select() if
+ return dict([(u.userId, u.displayName) for u in User.select() if
"fixbugs" in identity.current.permissions])
-
-# class YourDataClass(SQLObject):
-# pass
version = "1.0"
# description = "Your plan to rule the world"
+# long_description = "More description about your plan"
# author = "Your Name Here"
# email = "YourEmail@YourDomain"
# copyright = "Vintage 2006 - a good year indeed"
-table
-{
- background-color: black;
-}
-td
-{
- background-color: white;
-}
-h1
-{
- font-family: "Verdana";
- font-weight: bold;
- font-size: 120%;
- margin-bottom:0;
- color: #990;
-}
-
-tr.closed td
-{
- background-color: #ccc;
-}
-tr.closedeven td
-{
- background-color: #ccc;
-}
-tr.closedodd td
-{
- background-color: #dda;
-}
-
-a:visited, a:link
-{
- color: #990;
- text-decoration: None;
-}
-td a:visited, td a:link
-{
- display: block;
-}
-a:visited:hover, a:link:hover
-{
- text-decoration: underline;
-}
-td a:visited:hover, td a:link:hover
-{
- color:black;
- background-color:#dda;
- text-decoration: None;
- display: block;
-}
-
-body
-{
- font-family: "Verdana";
- font-size:11pt;
- background-color: white;
-}
-.comment
-{
-}
-.comment table
-{
- background-color: transparent;
-}
-.comment td
-{
- background-color: transparent;
-}
-.comment pre
-{
- font-family: "Verdana";
-}
-#header
-{
- color: black;
- font-weight: bold;
- background-image: url(/static/images/half-spiral.png);
- background-position: right center;
- background-repeat: no-repeat;
- background-color: #ff0;
-}
-#header ul.navoption
-{
- display: block;
- float: right;
- margin: 0;
- padding-right: 30px;
-}
-#header li
-{
- display: inline;
- margin:0;
- padding:0;
-}
-table.insetbox
-{
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-.insetbox tr, .insetbox td
-{
- margin: 0;
- padding: 0;
-}
-pre.traceback
-{
- font-family: Verdana, Ariel, Helvetica, sanserif;
-}
-tr.even td
-{
- background-color: #eee;
-}
-tr.odd td
-{
- background-color: #ffe;
-}
+table\r
+{\r
+ background-color: black;\r
+}\r
+td\r
+{\r
+ background-color: white;\r
+}\r
+h1\r
+{\r
+ font-family: "Verdana";\r
+ font-weight: bold;\r
+ font-size: 120%;\r
+ margin-bottom:0;\r
+ color: #990;\r
+}\r
+\r
+tr.closed td\r
+{\r
+ background-color: #ccc;\r
+}\r
+tr.closedeven td\r
+{\r
+ background-color: #ccc;\r
+}\r
+tr.closedodd td\r
+{\r
+ background-color: #dda;\r
+}\r
+\r
+a:visited, a:link\r
+{\r
+ color: #990;\r
+ text-decoration: None;\r
+}\r
+td a:visited, td a:link\r
+{\r
+ display: block;\r
+}\r
+a:visited:hover, a:link:hover\r
+{\r
+ text-decoration: underline;\r
+}\r
+td a:visited:hover, td a:link:hover\r
+{\r
+ color:black;\r
+ background-color:#dda;\r
+ text-decoration: None;\r
+ display: block;\r
+}\r
+\r
+body\r
+{\r
+ font-family: "Verdana";\r
+ font-size:11pt;\r
+ background-color: white;\r
+}\r
+.comment\r
+{\r
+}\r
+.comment table\r
+{\r
+ background-color: transparent;\r
+}\r
+.comment td\r
+{\r
+ background-color: transparent;\r
+}\r
+.comment pre\r
+{\r
+ font-family: "Verdana";\r
+}\r
+#header\r
+{\r
+ color: black;\r
+ font-weight: bold;\r
+ background-image: url(/static/images/half-spiral.png);\r
+ background-position: right center;\r
+ background-repeat: no-repeat;\r
+ background-color: #ff0;\r
+}\r
+#header ul.navoption\r
+{\r
+ display: block;\r
+ float: right;\r
+ margin: 0;\r
+ padding-right: 30px;\r
+}\r
+#header li\r
+{\r
+ display: inline;\r
+ margin:0;\r
+ padding:0;\r
+}\r
+table.insetbox\r
+{\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+.insetbox tr, .insetbox td\r
+{\r
+ margin: 0;\r
+ padding: 0;\r
+}\r
+pre.traceback\r
+{\r
+ font-family: Verdana, Ariel, Helvetica, sanserif;\r
+}\r
+tr.even td\r
+{\r
+ background-color: #eee;\r
+}\r
+tr.odd td\r
+{\r
+ background-color: #ffe;\r
+}\r
<meta content="text/html; charset=UTF-8"
http-equiv="content-type" py:replace="''"/>
<title>Login</title>
- <style>
+ <style type="text/css">
#loginBox
{
width: 30%;
</tr>
<tr>
<td colspan="2" class="buttons">
- <input type="submit" value="Login"/>
+ <input type="submit" name="login" value="Login"/>
</td>
</tr>
</table>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<?python import sitetemplate ?>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#" py:extends="sitetemplate">
-
-<head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()">
- <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
- <title py:if="False">Your title goes here</title>
- <link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
- <meta py:replace="item[:]"/>
- <style>
- #pageLogin
- {
- font-size: 10px;
- font-family: verdana;
- text-align: right;
- }
- </style>
-</head>
-
-<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">
-<div id="header"><div style="float: left">b u g s e v r y w h e r e</div><ul class="navoption"><li><a href="/about/">About</a></li></ul> </div>
- <div py:if="tg.config('identity.on',False) and not 'logging_in' in locals()"
- id="pageLogin">
- <span py:if="tg.identity.anonymous">
- <a href="/login">Login</a>
- </span>
- <span py:if="not tg.identity.anonymous">
- Welcome ${tg.identity.user.displayName}.
- <a href="/logout">Logout</a>
- </span>
- </div>
-
- <div py:if="tg_flash" class="flash" py:content="tg_flash"></div>
-
- <div py:replace="item[:]"/>
-
-</body>
-<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}insetbox'" cellspacing="0" cellpadding="0" border="0" class="insetbox">
-<tr height="19"><td background="/static/images/is-tl.png" width="19"/>
- <td background="/static/images/is-t.png" />
- <td background="/static/images/is-tr.png" width="11"></td>
-</tr>
-<tr>
- <td background="/static/images/is-l.png"/>
- <td py:content="item[:]"> Hello, this is some random text</td>
- <td background="/static/images/is-r.png"/>
-</tr>
-<tr height="11">
- <td background="/static/images/is-bl.png"/>
- <td background="/static/images/is-b.png" />
- <td background="/static/images/is-br.png"/>
-</tr>
-</table>
-<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}dsbox'" cellspacing="0" cellpadding="0" border="0" class="dsbox">
-<tr height="11"><td background="/static/images/ds-tl.png" width="11"/>
- <td background="/static/images/ds-t.png" />
- <td background="/static/images/ds-tr.png" width="19"></td>
-</tr>
-<tr>
- <td background="/static/images/ds-l.png"/>
- <td py:content="item[:]"> Hello, this is some random text</td>
- <td background="/static/images/ds2-r.png"/>
-</tr>
-<tr height="19">
- <td background="/static/images/ds-bl.png"/>
- <td background="/static/images/ds2-b.png" />
- <td background="/static/images/ds-br.png"/>
-</tr>
-</table>
-
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<?python import sitetemplate ?>\r
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#" py:extends="sitetemplate">\r
+\r
+<head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()">\r
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>\r
+ <title py:if="False">Your title goes here</title>\r
+ <link rel="stylesheet" type="text/css" href="/static/css/style.css"/>\r
+ <meta py:replace="item[:]"/>\r
+ <style type="text/css">\r
+ #pageLogin\r
+ {\r
+ font-size: 10px;\r
+ font-family: verdana;\r
+ text-align: right;\r
+ }\r
+ </style>\r
+</head>\r
+\r
+<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">\r
+<div id="header"><div style="float: left">b u g s e v r y w h e r e</div><ul class="navoption"><li><a href="/about/">About</a></li></ul> </div> \r
+ <div py:if="tg.config('identity.on',False) and not 'logging_in' in locals()"\r
+ id="pageLogin">\r
+ <span py:if="tg.identity.anonymous">\r
+ <a href="/login">Login</a>\r
+ </span>\r
+ <span py:if="not tg.identity.anonymous">\r
+ Welcome ${tg.identity.user.display_name}.\r
+ <a href="/logout">Logout</a>\r
+ </span>\r
+ </div>\r
+\r
+ <div py:if="tg_flash" class="flash" py:content="tg_flash"></div>\r
+\r
+ <div py:replace="[item.text]+item[:]"/>\r
+\r
+<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}insetbox'" cellspacing="0" cellpadding="0" border="0" class="insetbox">\r
+<tr height="19"><td background="/static/images/is-tl.png" width="19"/>\r
+ <td background="/static/images/is-t.png" />\r
+ <td background="/static/images/is-tr.png" width="11"></td>\r
+</tr>\r
+<tr>\r
+ <td background="/static/images/is-l.png"/>\r
+ <td py:content="item[:]"> Hello, this is some random text</td>\r
+ <td background="/static/images/is-r.png"/>\r
+</tr>\r
+<tr height="11">\r
+ <td background="/static/images/is-bl.png"/>\r
+ <td background="/static/images/is-b.png" />\r
+ <td background="/static/images/is-br.png"/>\r
+</tr>\r
+</table>\r
+<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}dsbox'" cellspacing="0" cellpadding="0" border="0" class="dsbox">\r
+<tr height="11"><td background="/static/images/ds-tl.png" width="11"/>\r
+ <td background="/static/images/ds-t.png" />\r
+ <td background="/static/images/ds-tr.png" width="19"></td>\r
+</tr>\r
+<tr>\r
+ <td background="/static/images/ds-l.png"/>\r
+ <td py:content="item[:]"> Hello, this is some random text</td>\r
+ <td background="/static/images/ds2-r.png"/>\r
+</tr>\r
+<tr height="19">\r
+ <td background="/static/images/ds-bl.png"/>\r
+ <td background="/static/images/ds2-b.png" />\r
+ <td background="/static/images/ds-br.png"/>\r
+</tr>\r
+</table>\r
+</body>\r
+\r
+</html>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
- py:extends="'master.kid'">
-
-<head>
- <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
- <title>Welcome to TurboGears</title>
-</head>
-
-<body>
- <p>Congratulations, your TurboGears application is running as of <span py:replace="now">now</span>.</p>
-
- <h2>Are you ready to Gear Up?</h2>
-
- <p>Take the following steps to dive right in:</p>
-
- <ol>
- <li>Edit your project's model.py to create SQLObjects representing the data you're working with</li>
- <li>Edit your dev.cfg file to point to the database you'll be using</li>
- <li>Run "<code>tg-admin sql create</code>" to create the tables in the database</li>
- <li>Edit controllers.py to add the functionality to your webapp</li>
- <li>Change the master.kid template to have the headers and footers for your application.</li>
- <li>Change welcome.kid (this template) or create a new one to display your data</li>
- <li>Repeat steps 4-6 until done.</li>
- <li><b>Profit!</b></li>
- </ol>
-
- <p>If you haven't already, you might check out some of the <a href="http://www.turbogears.org/docs/" >documentation</a>.</p>
-
- <p>Thanks for using TurboGears! See you on the <a href="http://groups.google.com/group/turbogears" >mailing list</a> and the "turbogears" channel on irc.freenode.org!</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"\r
+ py:extends="'master.kid'">\r
+<head>\r
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>\r
+<title>Welcome to TurboGears</title>\r
+</head>\r
+<body>\r
+<div id="header"> </div>\r
+<div id="main_content">\r
+ <div id="status_block">Your TurboGears application is now running.</div>\r
+ <!--h1>Take steps to dive right in:</h1-->\r
+ <div id="sidebar">\r
+ <h2>Learn more</h2>\r
+ Learn more about TurboGears and take part in its\r
+ development\r
+ <ul class="links">\r
+ <li><a href="http://www.turbogears.org">Official website</a></li>\r
+ <li><a href="http://docs.turbogears.org">Documentation</a></li>\r
+ <li><a href="http://trac.turbogears.org/turbogears/">Trac\r
+ (bugs/suggestions)</a></li>\r
+ <li><a href="http://groups.google.com/group/turbogears"> Mailing list</a> </li>\r
+ </ul>\r
+ </div>\r
+ <div id="getting_started">\r
+ <ol id="getting_started_steps">\r
+ <li class="getting_started">\r
+ <h3>Model</h3>\r
+ <p> <a href="http://docs.turbogears.org/1.0/GettingStarted/DefineDatabase">Design models</a> in the <span class="code">model.py</span>.<br/>\r
+ Edit <span class="code">dev.cfg</span> to <a href="http://docs.turbogears.org/1.0/GettingStarted/UseDatabase">use a different backend</a>, or start with a pre-configured SQLite database. <br/>\r
+ Use script <span class="code">tg-admin sql create</span> to create the database tables.</p>\r
+ </li>\r
+ <li class="getting_started">\r
+ <h3>View</h3>\r
+ <p> Edit <a href="http://docs.turbogears.org/1.0/GettingStarted/Kid">html-like templates</a> in the <span class="code">/templates</span> folder;<br/>\r
+ Put all <a href="http://docs.turbogears.org/1.0/StaticFiles">static contents</a> in the <span class="code">/static</span> folder. </p>\r
+ </li>\r
+ <li class="getting_started">\r
+ <h3>Controller</h3>\r
+ <p> Edit <span class="code"> controllers.py</span> and <a href="http://docs.turbogears.org/1.0/GettingStarted/CherryPy">build your\r
+ website structure</a> with the simplicity of Python objects. <br/>\r
+ TurboGears will automatically reload itself when you modify your project. </p>\r
+ </li>\r
+ </ol>\r
+ <div class="notice"> If you create something cool, please <a href="http://groups.google.com/group/turbogears">let people know</a>, and consider contributing something back to the <a href="http://groups.google.com/group/turbogears">community</a>.</div>\r
+ </div>\r
+ <!-- End of getting_started -->\r
+</div>\r
+</body>\r
+</html>\r
# choice for testing, because you can use an in-memory database
# which is very fast.
-from turbogears import testutil
-#from beweb.model import YourDataClass
-#from turbogears.identity.soprovider import TG_User
+from turbogears import testutil, database
+# from beweb.model import YourDataClass, User
# database.set_db_uri("sqlite:///:memory:")
-# class testTG_User(testutil.DBTest):
+# class TestUser(testutil.DBTest):
# def get_model(self):
-# return TG_User
+# return User
#
# def test_creation(self):
# "Object creation should set the name"
-# obj = TG_User(userId = "creosote",
-# emailAddress = "spam@python.not",
-# displayName = "Mr Creosote",
+# obj = User(user_name = "creosote",
+# email_address = "spam@python.not",
+# display_name = "Mr Creosote",
# password = "Wafer-thin Mint")
-# assert obj.displayName == "Mr Creosote"
+# assert obj.display_name == "Mr Creosote"
# This is where all of your settings go for your development environment
# Settings that are the same for both development and production
# (such as template engine, encodings, etc.) all go in
-# yourpackage/config/app.cfg
+# beweb/config/app.cfg
# DATABASE
# sqlobject.dburi="mysql://username:password@hostname:port/databasename"
sqlobject.dburi="sqlite://%(package_dir)s/database.sqlite"
+# If you have sqlite, here's a simple default to get you started
+# in development
+# sqlobject.dburi="sqlite://%(current_dir_uri)s/devdata.sqlite"
+
+
# if you are using a database or table type without transactions
# (MySQL default, for example), you should turn off transactions
# by prepending notrans_ on the uri
# sqlobject.dburi="notrans_mysql://username:password@hostname:port/databasename"
# for Windows users, sqlite URIs look like:
-# sqlobject.dburi="sqlite:///drive_letter|/path/to/file"
-
+# sqlobject.dburi="sqlite:///drive_letter:/path/to/file"
# SERVER
server.environment="development"
autoreload.package="beweb"
+# session_filter.on = True
+
# Set to True if you'd like to abort execution if a controller gets an
# unexpected parameter. False by default
tg.strict_parameters = True
+identity.on = True
+visit.on = True
+
+# LOGGING
+# Logging configuration generally follows the style of the standard
+# Python logging module configuration. Note that when specifying
+# log format messages, you need to use *() for formatting variables.
+# Deployment independent log configuration is in beweb/config/log.cfg
+[logging]
+
+[[loggers]]
+[[[beweb]]]
+level='DEBUG'
+qualname='beweb'
+handlers=['debug_out']
+
+[[[allinfo]]]
+level='INFO'
+handlers=['debug_out']
+[[[access]]]
+level='INFO'
+qualname='turbogears.access'
+handlers=['access_out']
+propagate=0
--- /dev/null
+[global]
+# This is where all of your settings go for your production environment.
+# You'll copy this file over to your production server and provide it
+# as a command-line option to your start script.
+# Settings that are the same for both development and production
+# (such as template engine, encodings, etc.) all go in
+# beweb/config/app.cfg
+
+# pick the form for your database
+# sqlobject.dburi="postgres://username@hostname/databasename"
+# sqlobject.dburi="mysql://username:password@hostname:port/databasename"
+# sqlobject.dburi="sqlite:///file_name_and_path"
+
+# If you have sqlite, here's a simple default to get you started
+# in development
+sqlobject.dburi="sqlite://%(current_dir_uri)s/devdata.sqlite"
+
+
+# if you are using a database or table type without transactions
+# (MySQL default, for example), you should turn off transactions
+# by prepending notrans_ on the uri
+# sqlobject.dburi="notrans_mysql://username:password@hostname:port/databasename"
+
+# for Windows users, sqlite URIs look like:
+# sqlobject.dburi="sqlite:///drive_letter:/path/to/file"
+
+
+# SERVER
+
+server.environment="production"
+
+# Sets the number of threads the server uses
+# server.thread_pool = 1
+
+# if this is part of a larger site, you can set the path
+# to the TurboGears instance here
+# server.webpath=""
+
+# session_filter.on = True
+
+# Set to True if you'd like to abort execution if a controller gets an
+# unexpected parameter. False by default
+# tg.strict_parameters = False
+
+# LOGGING
+# Logging configuration generally follows the style of the standard
+# Python logging module configuration. Note that when specifying
+# log format messages, you need to use *() for formatting variables.
+# Deployment independent log configuration is in beweb/config/log.cfg
+[logging]
+
+[[handlers]]
+
+[[[access_out]]]
+# set the filename as the first argument below
+args="('server.log',)"
+class='FileHandler'
+level='INFO'
+formatter='message_only'
+
+[[loggers]]
+[[[beweb]]]
+level='ERROR'
+qualname='beweb'
+handlers=['error_out']
+
+[[[access]]]
+level='INFO'
+qualname='turbogears.access'
+handlers=['access_out']
+propagate=0
#download_url=download_url,
#license=license,
- install_requires = ["TurboGears >= 0.9a4"],
+ install_requires = [
+ "TurboGears >= 1.0b1",
+ ],
scripts = ["start-beweb.py"],
zip_safe=False,
packages=find_packages(),
# probably installed
if len(sys.argv) > 1:
turbogears.update_config(configfile=sys.argv[1],
- modulename="beweb.config.app")
+ modulename="beweb.config")
elif exists(join(dirname(__file__), "setup.py")):
turbogears.update_config(configfile="dev.cfg",
- modulename="beweb.config.app")
+ modulename="beweb.config")
else:
turbogears.update_config(configfile="prod.cfg",
- modulename="beweb.config.app")
+ modulename="beweb.config")
from beweb.controllers import Root
-cherrypy.root = Root()
-cherrypy.server.start()
+turbogears.start_server(Root())