From: Aaron Bentley Date: Tue, 11 Apr 2006 02:07:54 +0000 (-0400) Subject: Updated beweb to use TurboGears 0.9 X-Git-Tag: 1.0.0~194 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=68df9cb4413c2642bac15a940c26e68f9d1391cb;p=be.git Updated beweb to use TurboGears 0.9 --- diff --git a/.bzrignore b/.bzrignore index 7565778..0670f57 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,2 +1,2 @@ -beweb/beweb/config.py +Bugs-Everywhere-Web/beweb/config.py ./build diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO new file mode 100644 index 0000000..6cb6ad2 --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO @@ -0,0 +1,15 @@ +Metadata-Version: 1.0 +Name: Bugs-Everywhere-Web +Version: 1.0 +Summary: UNKNOWN +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN +Classifier: Development Status :: 3 - Alpha +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Framework :: TurboGears diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/SOURCES.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/SOURCES.txt new file mode 100644 index 0000000..def18b1 --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/SOURCES.txt @@ -0,0 +1,36 @@ +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/not-zip-safe +Bugs-Everywhere-Web.egg-info/requires.txt +Bugs-Everywhere-Web.egg-info/sqlobject.txt +Bugs-Everywhere-Web.egg-info/top_level.txt +beweb/__init__.py +beweb/config.py +beweb/controllers.py +beweb/formatting.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 diff --git a/beweb/beweb/__init__.py b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/not-zip-safe similarity index 100% rename from beweb/beweb/__init__.py rename to Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/not-zip-safe diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/requires.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/requires.txt new file mode 100644 index 0000000..88b15cb --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/requires.txt @@ -0,0 +1 @@ +TurboGears >= 0.9a4 \ No newline at end of file diff --git a/beweb/Bugs-Everywhere-Web.egg-info/sqlobject.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/sqlobject.txt similarity index 100% rename from beweb/Bugs-Everywhere-Web.egg-info/sqlobject.txt rename to Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/sqlobject.txt diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/top_level.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/top_level.txt new file mode 100644 index 0000000..6455be9 --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/top_level.txt @@ -0,0 +1,2 @@ +beweb +libbe diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO new file mode 100644 index 0000000..78b12a6 --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO @@ -0,0 +1 @@ +Version: 0.0 diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/paster_plugins.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/paster_plugins.txt new file mode 100644 index 0000000..14fec70 --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/paster_plugins.txt @@ -0,0 +1,2 @@ +TurboGears +PasteScript diff --git a/beweb/Bugs-Everywhere-Web.egg-info/requires.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/requires.txt similarity index 100% rename from beweb/Bugs-Everywhere-Web.egg-info/requires.txt rename to Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/requires.txt diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/sqlobject.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/sqlobject.txt new file mode 100644 index 0000000..7f7cbad --- /dev/null +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/sqlobject.txt @@ -0,0 +1,2 @@ +db_module=beweb.model +history_dir=$base/beweb/sqlobject-history diff --git a/beweb/Bugs-Everywhere-Web.egg-info/top_level.txt b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/top_level.txt similarity index 100% rename from beweb/Bugs-Everywhere-Web.egg-info/top_level.txt rename to Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/top_level.txt diff --git a/Bugs-Everywhere-Web/README.txt b/Bugs-Everywhere-Web/README.txt new file mode 100644 index 0000000..efde8ff --- /dev/null +++ b/Bugs-Everywhere-Web/README.txt @@ -0,0 +1,4 @@ +Bugs-Everywhere-Web + +This is a TurboGears (http://www.turbogears.org) project. It can be +started by running the start-beweb.py script. \ No newline at end of file diff --git a/beweb/beweb/templates/__init__.py b/Bugs-Everywhere-Web/beweb/__init__.py similarity index 100% rename from beweb/beweb/templates/__init__.py rename to Bugs-Everywhere-Web/beweb/__init__.py diff --git a/Bugs-Everywhere-Web/beweb/app.cfg b/Bugs-Everywhere-Web/beweb/app.cfg new file mode 100644 index 0000000..c424cf8 --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/app.cfg @@ -0,0 +1,121 @@ +[global] +# The settings in this file should not vary depending on the deployment +# environment. devcfg.py and prodcfg.py 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" + +# kid.outputformat="html" +# kid.encoding="utf-8" + +# The sitetemplate is used for overall styling of a site that +# includes multiple TurboGears applications +# tg.sitetemplate="" + +# Allow every exposed function to be called as json, +# tg.allow_json = False + +# Set to True if you'd like all of your pages to include MochiKit +# tg.mochikit_all = False + +# VISIT TRACKING +# Each visit to your application will be assigned a unique visit ID tracked via +# a cookie sent to the visitor's browser. +# -------------- + +# Enable Visit tracking +# visit.on=False + +# Number of minutes a visit may be idle before it expires. +# visit.timeout=20 + +# The name of the cookie to transmit to the visitor's browser. +# visit.cookie.name="tg-visit" + +# Domain name to specify when setting the cookie (must begin with . according to +# RFC 2109). The default (None) should work for most cases and will default to +# the machine to which the request was made. NOTE: localhost is NEVER a valid +# value and will NOT WORK. +# visit.cookie.domain=None + +# Specific path for the cookie +# visit.cookie.path="/" + +# The name of the VisitManager plugin to use for visitor tracking. +# visit.manager="sqlobject" + + +# IDENTITY +# General configuration of the TurboGears Identity management module +# -------- + +# Switch to turn on or off the Identity management module +# identity.on=False + +# [REQUIRED] URL to which CherryPy will internally redirect when an access +# control check fails. If Identity management is turned on, a value for this +# option must be specified. +# identity.failure_url=None + +# The IdentityProvider to use -- defaults to the SqlObjectIdentityProvider which +# pulls User, Group, and Permission data out of your model database. +# identity.provider="sqlobject" + +# The names of the fields on the login form containing the visitor's user ID +# and password. In addition, the submit button is specified simply so its +# existence may be stripped out prior to passing the form data to the target +# controller. +# identity.form.user_name="user_name" +# identity.form.password="password" +# identity.form.submit="login" + +# What sources should the identity provider consider when determining the +# identity associated with a request? Comma separated list of identity sources. +# Valid sources: form, visit, http_auth +# identity.source="form,http_auth,visit" + + +# SqlObjectIdentityProvider +# Configuration options for the default IdentityProvider +# ------------------------- + +# The classes you wish to use for your Identity model. Leave these commented out +# to use the default classes for SqlObjectIdentityProvider. Or set them to the +# classes in your model. NOTE: These aren't TG_* because the TG prefix is +# reserved for classes created by TurboGears. +# identity.soprovider.model.user="beweb.model.User" +# identity.soprovider.model.group="beweb.model.Group" +# identity.soprovider.model.permission="beweb.model.Permission" + +# The password encryption algorithm used when comparing passwords against what's +# stored in the database. Valid values are 'md5' or 'sha1'. If you do not +# specify an encryption algorithm, passwords are expected to be clear text. +# +# The SqlObjectProvider *will* encrypt passwords supplied as part of your login +# form. If you set the password through the password property, like: +# my_user.password = 'secret' +# the password will be encrypted in the database, provided identity is up and +# running, or you have loaded the configuration specifying what encryption to +# use (in situations where identity may not yet be running, like tests). + +# identity.soprovider.encryption_algorithm=None + +[/static] +static_filter.on = True +#static_filter.dir = "%(top_level_dir)s/static" +static_filter.dir = "/home/abentley/be/Bugs-Everywhere-Web/beweb/static" + +[/favicon.ico] +static_filter.on = True +#static_filter.file = "%(top_level_dir)s/static/images/favicon.ico" +static_filter.file = "/home/abentley/be/Bugs-Everywhere-Web/beweb/static/images/favicon.ico" + +[/] +decodingFilter.on = True diff --git a/beweb/beweb/config.py.example b/Bugs-Everywhere-Web/beweb/config.py.example similarity index 100% rename from beweb/beweb/config.py.example rename to Bugs-Everywhere-Web/beweb/config.py.example diff --git a/Bugs-Everywhere-Web/beweb/config/tmp/__init__.py b/Bugs-Everywhere-Web/beweb/config/tmp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/beweb/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py similarity index 86% rename from beweb/beweb/controllers.py rename to Bugs-Everywhere-Web/beweb/controllers.py index fc505ed..9231030 100644 --- a/beweb/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -1,5 +1,5 @@ import turbogears -from turbogears import controllers +from turbogears import controllers, expose, redirect, identity import cherrypy from libbe.bugdir import (tree_root, cmp_severity, new_bug, new_comment, NoRootEntry) @@ -166,6 +166,34 @@ class Root(controllers.Root): def index(self): raise cherrypy.HTTPRedirect(project_url()) + @expose(template="beweb.templates.login") + def login(self, forward_url=None, previous_url=None, *args, **kw): + + if not identity.current.anonymous and identity.was_login_attempted(): + raise redirect(forward_url) + + forward_url=None + previous_url= cherrypy.request.path + + if identity.was_login_attempted(): + msg=_("The credentials you supplied were not correct or "\ + "did not grant access to this resource.") + elif identity.get_identity_errors(): + msg=_("You must provide your credentials before accessing "\ + "this resource.") + else: + msg=_("Please log in.") + forward_url= cherrypy.request.headers.get("Referer", "/") + cherrypy.response.status=403 + return dict(message=msg, previous_url=previous_url, logging_in=True, + original_parameters=cherrypy.request.params, + forward_url=forward_url) + + @expose() + def logout(self): + identity.current.logout() + raise redirect("/") + @turbogears.expose('beweb.templates.about') def about(self, *paths, **kwargs): return {} @@ -174,7 +202,7 @@ class Root(controllers.Root): def default(self, *args, **kwargs): return self.prest.default(*args, **kwargs) - def _cpOnError(self): + def _cp_on_error(self): import traceback, StringIO bodyFile = StringIO.StringIO() traceback.print_exc(file = bodyFile) diff --git a/beweb/beweb/formatting.py b/Bugs-Everywhere-Web/beweb/formatting.py similarity index 100% rename from beweb/beweb/formatting.py rename to Bugs-Everywhere-Web/beweb/formatting.py diff --git a/beweb/beweb/model.py b/Bugs-Everywhere-Web/beweb/model.py similarity index 51% rename from beweb/beweb/model.py rename to Bugs-Everywhere-Web/beweb/model.py index 208f5bb..e20d1ce 100644 --- a/beweb/beweb/model.py +++ b/Bugs-Everywhere-Web/beweb/model.py @@ -1,5 +1,7 @@ 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 hub = PackageHub("beweb") __connection__ = hub diff --git a/beweb/beweb/prest.py b/Bugs-Everywhere-Web/beweb/prest.py similarity index 100% rename from beweb/beweb/prest.py rename to Bugs-Everywhere-Web/beweb/prest.py diff --git a/Bugs-Everywhere-Web/beweb/release.py b/Bugs-Everywhere-Web/beweb/release.py new file mode 100644 index 0000000..0232912 --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/release.py @@ -0,0 +1,13 @@ +# Release information about Bugs-Everywhere-Web + +version = "1.0" + +# description = "Your plan to rule the world" +# author = "Your Name Here" +# email = "YourEmail@YourDomain" +# copyright = "Vintage 2006 - a good year indeed" + +# if it's open source, you might want to specify these +# url = "http://yourcool.site/" +# download_url = "http://yourcool.site/download" +# license = "MIT" diff --git a/beweb/beweb/static/css/style.css b/Bugs-Everywhere-Web/beweb/static/css/style.css similarity index 100% rename from beweb/beweb/static/css/style.css rename to Bugs-Everywhere-Web/beweb/static/css/style.css diff --git a/beweb/beweb/static/images/ds-b.png b/Bugs-Everywhere-Web/beweb/static/images/ds-b.png similarity index 100% rename from beweb/beweb/static/images/ds-b.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-b.png diff --git a/beweb/beweb/static/images/ds-bl.png b/Bugs-Everywhere-Web/beweb/static/images/ds-bl.png similarity index 100% rename from beweb/beweb/static/images/ds-bl.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-bl.png diff --git a/beweb/beweb/static/images/ds-br.png b/Bugs-Everywhere-Web/beweb/static/images/ds-br.png similarity index 100% rename from beweb/beweb/static/images/ds-br.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-br.png diff --git a/beweb/beweb/static/images/ds-l.png b/Bugs-Everywhere-Web/beweb/static/images/ds-l.png similarity index 100% rename from beweb/beweb/static/images/ds-l.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-l.png diff --git a/beweb/beweb/static/images/ds-r.png b/Bugs-Everywhere-Web/beweb/static/images/ds-r.png similarity index 100% rename from beweb/beweb/static/images/ds-r.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-r.png diff --git a/beweb/beweb/static/images/ds-t.png b/Bugs-Everywhere-Web/beweb/static/images/ds-t.png similarity index 100% rename from beweb/beweb/static/images/ds-t.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-t.png diff --git a/beweb/beweb/static/images/ds-tl.png b/Bugs-Everywhere-Web/beweb/static/images/ds-tl.png similarity index 100% rename from beweb/beweb/static/images/ds-tl.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-tl.png diff --git a/beweb/beweb/static/images/ds-tr.png b/Bugs-Everywhere-Web/beweb/static/images/ds-tr.png similarity index 100% rename from beweb/beweb/static/images/ds-tr.png rename to Bugs-Everywhere-Web/beweb/static/images/ds-tr.png diff --git a/beweb/beweb/static/images/ds2-b.png b/Bugs-Everywhere-Web/beweb/static/images/ds2-b.png similarity index 100% rename from beweb/beweb/static/images/ds2-b.png rename to Bugs-Everywhere-Web/beweb/static/images/ds2-b.png diff --git a/beweb/beweb/static/images/ds2-r.png b/Bugs-Everywhere-Web/beweb/static/images/ds2-r.png similarity index 100% rename from beweb/beweb/static/images/ds2-r.png rename to Bugs-Everywhere-Web/beweb/static/images/ds2-r.png diff --git a/beweb/beweb/static/images/favicon.ico b/Bugs-Everywhere-Web/beweb/static/images/favicon.ico similarity index 100% rename from beweb/beweb/static/images/favicon.ico rename to Bugs-Everywhere-Web/beweb/static/images/favicon.ico diff --git a/beweb/beweb/static/images/favicon.png b/Bugs-Everywhere-Web/beweb/static/images/favicon.png similarity index 100% rename from beweb/beweb/static/images/favicon.png rename to Bugs-Everywhere-Web/beweb/static/images/favicon.png diff --git a/beweb/beweb/static/images/half-spiral.png b/Bugs-Everywhere-Web/beweb/static/images/half-spiral.png similarity index 100% rename from beweb/beweb/static/images/half-spiral.png rename to Bugs-Everywhere-Web/beweb/static/images/half-spiral.png diff --git a/beweb/beweb/static/images/is-b.png b/Bugs-Everywhere-Web/beweb/static/images/is-b.png similarity index 100% rename from beweb/beweb/static/images/is-b.png rename to Bugs-Everywhere-Web/beweb/static/images/is-b.png diff --git a/beweb/beweb/static/images/is-bl.png b/Bugs-Everywhere-Web/beweb/static/images/is-bl.png similarity index 100% rename from beweb/beweb/static/images/is-bl.png rename to Bugs-Everywhere-Web/beweb/static/images/is-bl.png diff --git a/beweb/beweb/static/images/is-br.png b/Bugs-Everywhere-Web/beweb/static/images/is-br.png similarity index 100% rename from beweb/beweb/static/images/is-br.png rename to Bugs-Everywhere-Web/beweb/static/images/is-br.png diff --git a/beweb/beweb/static/images/is-l.png b/Bugs-Everywhere-Web/beweb/static/images/is-l.png similarity index 100% rename from beweb/beweb/static/images/is-l.png rename to Bugs-Everywhere-Web/beweb/static/images/is-l.png diff --git a/beweb/beweb/static/images/is-r.png b/Bugs-Everywhere-Web/beweb/static/images/is-r.png similarity index 100% rename from beweb/beweb/static/images/is-r.png rename to Bugs-Everywhere-Web/beweb/static/images/is-r.png diff --git a/beweb/beweb/static/images/is-t.png b/Bugs-Everywhere-Web/beweb/static/images/is-t.png similarity index 100% rename from beweb/beweb/static/images/is-t.png rename to Bugs-Everywhere-Web/beweb/static/images/is-t.png diff --git a/beweb/beweb/static/images/is-tl.png b/Bugs-Everywhere-Web/beweb/static/images/is-tl.png similarity index 100% rename from beweb/beweb/static/images/is-tl.png rename to Bugs-Everywhere-Web/beweb/static/images/is-tl.png diff --git a/beweb/beweb/static/images/is-tr.png b/Bugs-Everywhere-Web/beweb/static/images/is-tr.png similarity index 100% rename from beweb/beweb/static/images/is-tr.png rename to Bugs-Everywhere-Web/beweb/static/images/is-tr.png diff --git a/beweb/beweb/static/images/shadows.png b/Bugs-Everywhere-Web/beweb/static/images/shadows.png similarity index 100% rename from beweb/beweb/static/images/shadows.png rename to Bugs-Everywhere-Web/beweb/static/images/shadows.png diff --git a/beweb/beweb/static/images/spiral.png b/Bugs-Everywhere-Web/beweb/static/images/spiral.png similarity index 100% rename from beweb/beweb/static/images/spiral.png rename to Bugs-Everywhere-Web/beweb/static/images/spiral.png diff --git a/Bugs-Everywhere-Web/beweb/templates/__init__.py b/Bugs-Everywhere-Web/beweb/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/beweb/beweb/templates/about.kid b/Bugs-Everywhere-Web/beweb/templates/about.kid similarity index 100% rename from beweb/beweb/templates/about.kid rename to Bugs-Everywhere-Web/beweb/templates/about.kid diff --git a/beweb/beweb/templates/bugs.kid b/Bugs-Everywhere-Web/beweb/templates/bugs.kid similarity index 100% rename from beweb/beweb/templates/bugs.kid rename to Bugs-Everywhere-Web/beweb/templates/bugs.kid diff --git a/beweb/beweb/templates/edit_bug.kid b/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid similarity index 100% rename from beweb/beweb/templates/edit_bug.kid rename to Bugs-Everywhere-Web/beweb/templates/edit_bug.kid diff --git a/beweb/beweb/templates/edit_comment.kid b/Bugs-Everywhere-Web/beweb/templates/edit_comment.kid similarity index 100% rename from beweb/beweb/templates/edit_comment.kid rename to Bugs-Everywhere-Web/beweb/templates/edit_comment.kid diff --git a/beweb/beweb/templates/error.kid b/Bugs-Everywhere-Web/beweb/templates/error.kid similarity index 100% rename from beweb/beweb/templates/error.kid rename to Bugs-Everywhere-Web/beweb/templates/error.kid diff --git a/Bugs-Everywhere-Web/beweb/templates/login.kid b/Bugs-Everywhere-Web/beweb/templates/login.kid new file mode 100644 index 0000000..2c150db --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/templates/login.kid @@ -0,0 +1,113 @@ + + + + + + Login + + + + +
+

Login

+

${message}

+
+ + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+ + + + +
+
+ + diff --git a/beweb/beweb/templates/master.kid b/Bugs-Everywhere-Web/beweb/templates/master.kid similarity index 73% rename from beweb/beweb/templates/master.kid rename to Bugs-Everywhere-Web/beweb/templates/master.kid index 6610d00..54f6bad 100644 --- a/beweb/beweb/templates/master.kid +++ b/Bugs-Everywhere-Web/beweb/templates/master.kid @@ -2,18 +2,38 @@ - + Your title goes here -
+ + - + +
+ + Login + + + Welcome ${tg.identity.user.displayName}. + Logout + +
+
- +
+
diff --git a/beweb/beweb/templates/projects.kid b/Bugs-Everywhere-Web/beweb/templates/projects.kid similarity index 100% rename from beweb/beweb/templates/projects.kid rename to Bugs-Everywhere-Web/beweb/templates/projects.kid diff --git a/Bugs-Everywhere-Web/beweb/templates/welcome.kid b/Bugs-Everywhere-Web/beweb/templates/welcome.kid new file mode 100644 index 0000000..0d3cf3e --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/templates/welcome.kid @@ -0,0 +1,33 @@ + + + + + + Welcome to TurboGears + + + +

Congratulations, your TurboGears application is running as of now.

+ +

Are you ready to Gear Up?

+ +

Take the following steps to dive right in:

+ +
    +
  1. Edit your project's model.py to create SQLObjects representing the data you're working with
  2. +
  3. Edit your dev.cfg file to point to the database you'll be using
  4. +
  5. Run "tg-admin sql create" to create the tables in the database
  6. +
  7. Edit controllers.py to add the functionality to your webapp
  8. +
  9. Change the master.kid template to have the headers and footers for your application.
  10. +
  11. Change welcome.kid (this template) or create a new one to display your data
  12. +
  13. Repeat steps 4-6 until done.
  14. +
  15. Profit!
  16. +
+ +

If you haven't already, you might check out some of the documentation.

+ +

Thanks for using TurboGears! See you on the mailing list and the "turbogears" channel on irc.freenode.org!

+ + + diff --git a/Bugs-Everywhere-Web/beweb/tests/__init__.py b/Bugs-Everywhere-Web/beweb/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Bugs-Everywhere-Web/beweb/tests/test_controllers.py b/Bugs-Everywhere-Web/beweb/tests/test_controllers.py new file mode 100644 index 0000000..0c77afe --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/tests/test_controllers.py @@ -0,0 +1,16 @@ +from turbogears import testutil +from beweb.controllers import Root +import cherrypy + +cherrypy.root = Root() + +def test_method(): + "the index method should return a string called now" + import types + result = testutil.call(cherrypy.root.index) + assert type(result["now"]) == types.StringType + +def test_indextitle(): + "The mainpage should have the right title" + testutil.createRequest("/") + assert "Welcome to TurboGears" in cherrypy.response.body[0] diff --git a/Bugs-Everywhere-Web/beweb/tests/test_model.py b/Bugs-Everywhere-Web/beweb/tests/test_model.py new file mode 100644 index 0000000..5346f8b --- /dev/null +++ b/Bugs-Everywhere-Web/beweb/tests/test_model.py @@ -0,0 +1,24 @@ +# If your project uses a database, you can set up database tests +# similar to what you see below. Be sure to set the db_uri to +# an appropriate uri for your testing database. sqlite is a good +# 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 + +# database.set_db_uri("sqlite:///:memory:") + +# class testTG_User(testutil.DBTest): +# def get_model(self): +# return TG_User +# +# def test_creation(self): +# "Object creation should set the name" +# obj = TG_User(userId = "creosote", +# emailAddress = "spam@python.not", +# displayName = "Mr Creosote", +# password = "Wafer-thin Mint") +# assert obj.displayName == "Mr Creosote" + diff --git a/Bugs-Everywhere-Web/dev.cfg b/Bugs-Everywhere-Web/dev.cfg new file mode 100644 index 0000000..e985b4b --- /dev/null +++ b/Bugs-Everywhere-Web/dev.cfg @@ -0,0 +1,37 @@ +[global] +# 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 + +# DATABASE + +# 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 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 + +# Some server parameters that you may want to tweak +# server.socket_port=8080 + +# Enable the debug output at the end on pages. +# log_debug_info_filter.on = False + +server.environment="development" +autoreload.package="beweb" + +# Set to True if you'd like to abort execution if a controller gets an +# unexpected parameter. False by default +tg.strict_parameters = True + diff --git a/beweb/libbe b/Bugs-Everywhere-Web/libbe similarity index 100% rename from beweb/libbe rename to Bugs-Everywhere-Web/libbe diff --git a/Bugs-Everywhere-Web/prod.cfg b/Bugs-Everywhere-Web/prod.cfg new file mode 100644 index 0000000..c0d4aca --- /dev/null +++ b/Bugs-Everywhere-Web/prod.cfg @@ -0,0 +1,41 @@ +[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 +# yourpackage/config/app.cfg + +# DATABASE + +# 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 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" +server.log_file="server.log" +server.log_to_screen=False + +# 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="" + +# Set to True if you'd like to abort execution if a controller gets an +# unexpected parameter. False by default +# tg.strict_parameters = False + diff --git a/beweb/server.log b/Bugs-Everywhere-Web/server.log similarity index 100% rename from beweb/server.log rename to Bugs-Everywhere-Web/server.log diff --git a/Bugs-Everywhere-Web/setup.py b/Bugs-Everywhere-Web/setup.py new file mode 100644 index 0000000..29f1d6f --- /dev/null +++ b/Bugs-Everywhere-Web/setup.py @@ -0,0 +1,60 @@ +from setuptools import setup, find_packages +from turbogears.finddata import find_package_data + +import os +execfile(os.path.join("beweb", "release.py")) + +setup( + name="Bugs-Everywhere-Web", + version=version, + + # uncomment the following lines if you fill them out in release.py + #description=description, + #author=author, + #author_email=email, + #url=url, + #download_url=download_url, + #license=license, + + install_requires = ["TurboGears >= 0.9a4"], + scripts = ["start-beweb.py"], + zip_safe=False, + packages=find_packages(), + package_data = find_package_data(where='beweb', + package='beweb'), + keywords = [ + # Use keywords if you'll be adding your package to the + # Python Cheeseshop + + # if this has widgets, uncomment the next line + # 'turbogears.widgets', + + # if this has a tg-admin command, uncomment the next line + # 'turbogears.command', + + # if this has identity providers, uncomment the next line + # 'turbogears.identity.provider', + + # If this is a template plugin, uncomment the next line + # 'python.templating.engines', + + # If this is a full application, uncomment the next line + # 'turbogears.app', + ], + classifiers = [ + 'Development Status :: 3 - Alpha', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Framework :: TurboGears', + # if this is an application that you'll distribute through + # the Cheeseshop, uncomment the next line + # 'Framework :: TurboGears :: Applications', + + # if this is a package that includes widgets that you'll distribute + # through the Cheeseshop, uncomment the next line + # 'Framework :: TurboGears :: Widgets', + ], + test_suite = 'nose.collector', + ) + diff --git a/beweb/beweb-start.py b/Bugs-Everywhere-Web/start-beweb.py similarity index 60% rename from beweb/beweb-start.py rename to Bugs-Everywhere-Web/start-beweb.py index 3f0f0a6..6eba527 100755 --- a/beweb/beweb-start.py +++ b/Bugs-Everywhere-Web/start-beweb.py @@ -2,7 +2,10 @@ import pkg_resources pkg_resources.require("TurboGears") +import turbogears import cherrypy +cherrypy.lowercase_api = True + from os.path import * import sys @@ -10,13 +13,15 @@ import sys # if it's not on the command line, then # look for setup.py in this directory. If it's not there, this script is # probably installed -cherrypy.config.update(file="common.cfg") if len(sys.argv) > 1: - cherrypy.config.update(file=sys.argv[1]) + turbogears.update_config(configfile=sys.argv[1], + modulename="beweb.config.app") elif exists(join(dirname(__file__), "setup.py")): - cherrypy.config.update(file="dev.cfg") + turbogears.update_config(configfile="dev.cfg", + modulename="beweb.config.app") else: - cherrypy.config.update(file="prod.cfg") + turbogears.update_config(configfile="prod.cfg", + modulename="beweb.config.app") from beweb.controllers import Root diff --git a/beweb/Bugs-Everywhere-Web.egg-info/PKG-INFO b/beweb/Bugs-Everywhere-Web.egg-info/PKG-INFO deleted file mode 100644 index 30070c9..0000000 --- a/beweb/Bugs-Everywhere-Web.egg-info/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: Bugs-Everywhere-Web -Version: 1.0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff --git a/beweb/common.cfg b/beweb/common.cfg deleted file mode 100644 index de0d84f..0000000 --- a/beweb/common.cfg +++ /dev/null @@ -1,9 +0,0 @@ -# This is where all of your settings go for your development environment -[/static] -staticFilter.on = True -staticFilter.dir = "static" -[/favicon.ico] -staticFilter.on = True -staticFilter.file = "static/images/favicon.ico" -[/] -decodingFilter.on = True diff --git a/beweb/dev.cfg b/beweb/dev.cfg deleted file mode 100644 index 4fd8903..0000000 --- a/beweb/dev.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# This is where all of your settings go for your development environment - -[global] - -# DATABASE - -# 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" - -# for Windows users, sqlite URIs look like: -# sqlobject.dburi="sqlite:///drive_letter|/path/to/file" - - -# VIEW - -# kid.outputformat="html" - -# The sitetemplate is used for overall styling of a site that -# includes multiple TurboGears applications -# tg.sitetemplate="" - - -# SERVER - -# Some server parameters that you may want to tweak -# server.socketPort=8080 - -# Disable the debug output at the end on pages. -# logDebugInfoFilter.on = False - -server.environment="development" -autoreload.package="beweb" diff --git a/beweb/prod.cfg b/beweb/prod.cfg deleted file mode 100644 index 21eb08e..0000000 --- a/beweb/prod.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# This is where all of your settings go for your development environment - -[global] - -# DATABASE - -# 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" - -# for Windows users, sqlite URIs look like: -# sqlobject.dburi="sqlite:///drive_letter|/path/to/file" - - -# VIEW - -# kid.outputformat="html" - -# The sitetemplate is used for overall styling of a site that -# includes multiple TurboGears applications -# tg.sitetemplate="" - - -# Server configuration -server.environment="production" -server.logFile="server.log" -server.logToScreen=False - -# if this is part of a larger site, you can set the path -# to the TurboGears instance here -# server.webpath="" - diff --git a/beweb/setup.py b/beweb/setup.py deleted file mode 100644 index a382ed9..0000000 --- a/beweb/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -from setuptools import setup, find_packages -from turbogears.finddata import find_package_data - -setup( - name="Bugs Everywhere Web", - version="1.0", - #description="", - #author="", - #author_email="", - #url="", - install_requires = ["TurboGears >= 0.8a4"], - scripts = ["beweb-start.py"], - zip_safe=False, - packages=find_packages(), - package_data = find_package_data(where='beweb', - package='beweb'), - ) -