--- /dev/null
+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
--- /dev/null
+TurboGears >= 0.8a4
\ No newline at end of file
--- /dev/null
+db_module=beweb.model
+history_dir=$base/beweb/sqlobject-history
--- /dev/null
+#!/usr/bin/env python2.4
+import pkg_resources
+pkg_resources.require("TurboGears")
+
+import cherrypy
+from os.path import *
+import sys
+
+# first look on the command line for a desired config file,
+# 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
+if len(sys.argv) > 1:
+ cherrypy.config.update(file=sys.argv[1])
+elif exists(join(dirname(__file__), "setup.py")):
+ cherrypy.config.update(file="dev.cfg")
+else:
+ cherrypy.config.update(file="prod.cfg")
+
+from beweb.controllers import Root
+
+cherrypy.root = Root()
+cherrypy.server.start()
--- /dev/null
+import turbogears
+from turbogears import controllers
+from libbe.bugdir import tree_root, cmp_severity
+projects = {"be": ("Bugs Everywhere","/home/abentley/be"),
+ "devel": ("PF devel","/home/abentley/devel"),
+}
+
+def project_tree(project):
+ try:
+ return tree_root(projects[project][1])
+ except KeyError:
+ raise Exception("Unknown project %s" % project)
+
+class Root(controllers.Root):
+ @turbogears.expose(html="beweb.templates.projects")
+ def index(self):
+ return {"projects" : projects}
+
+ @turbogears.expose()
+ def default(self, *args, **kwargs):
+ if len(args) == 1:
+ return self.bugs(args[0], **kwargs)
+ elif len(args) == 2:
+ return self.bug(*args, **kwargs)
+ else:
+ return repr(args)
+
+
+ @turbogears.expose(html="beweb.templates.bugs")
+ def bugs(self, project_id, sort_by=None):
+ bug_tree = project_tree(project_id)
+ bugs = list(bug_tree.list())
+ if sort_by is None:
+ def cmp_date(bug1, bug2):
+ return -cmp(bug1.time, bug2.time)
+ bugs.sort(cmp_date)
+ bugs.sort(cmp_severity)
+ return {"project_id" : project_id,
+ "project_name" : projects[project_id][0],
+ "bugs" : bugs,
+ }
+
+ @turbogears.expose(html="beweb.templates.edit_bug")
+ def bug(self, project_id, bug_uuid, action=None, status=None,
+ severity=None, summary=None):
+ bug_tree = project_tree(project_id)
+ bug = bug_tree.get_bug(bug_uuid)
+ if action == "Update":
+ bug.status = status
+ bug.severity = severity
+ bug.summary = summary
+ bug.save()
+ return {"bug": bug, "project_id": project_id}
--- /dev/null
+from sqlobject import *
+from turbogears.database import PackageHub
+
+hub = PackageHub("beweb")
+__connection__ = hub
+
+# class YourDataClass(SQLObject):
+# pass
--- /dev/null
+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
+{
+ display: none
+}
+tr.closed td
+{
+ background-color: #ccc;
+}
+
+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;
+}
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+from libbe.cmdutil import unique_name
+def row_class(bug):
+ if bug.status == "closed":
+ return "closed"
+ else:
+ return ""
+?>
+<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>Bugs for $project_name</title>
+</head>
+
+<body>
+<h1>Bug list for ${project_name}</h1>
+<table>
+<tr><td>ID</td><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr>
+<div py:for="bug in bugs" py:strip="True"><tr class="${row_class(bug)}"><td><a href="${'/%s/%s' % (project_id, bug.uuid)}">${unique_name(bug, bugs[:])}</a></td><td>${bug.status}</td><td>${bug.severity}</td><td>${bug.assigned}</td><td>${bug.summary}</td></tr>
+</div>
+</table>
+<a href="/">Project list</a>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+from libbe.bugdir import severity_levels
+def select_among(name, options, default):
+ output = ['<select name="%s">' % name]
+ for option in options:
+ if option == default:
+ selected = ' selected="selected"'
+ else:
+ selected = ""
+ output.append("<option%s>%s</option>" % (selected, option))
+ output.append("</select>")
+ return XML("".join(output))
+?>
+<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>Edit bug</title>
+ <style type="text/css">
+ /*tr, td, table{border: black thin solid}*/
+ table
+ {
+ background-color: black;
+ }
+ td
+ {
+ background-color: white;
+ }
+ h1
+ {
+ font-family: "Verdana";
+ font-weight: bold;
+ font-size: 120%;
+ margin-bottom:0;
+ color: #a07;
+ }
+ tr.closed
+ {
+ display: none
+ }
+ tr.closed td
+ {
+ background-color: #ccc;
+ }
+ </style>
+</head>
+
+<body>
+<h1>Edit bug</h1>
+<form method="post">
+<table>
+<tr><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr>
+<tr><td>${select_among("status", ["open", "closed", "in-progress"], bug.status)}</td><td>${select_among("severity", severity_levels, bug.severity)}</td><td>${bug.assigned}</td><td><input name="summary" value="${bug.summary}" size="80" /></td></tr>
+</table>
+<input type="submit" name="action" value="Update"/>
+</form>
+<a href="/${project_id}/">Bug List</a>
+</body>
+</html>
--- /dev/null
+<!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'">
+ <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"/>
+ <div py:replace="item[:]"/>
+</head>
+
+<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'">
+<div>b u g s e v e r y w h e r e</div>
+ <div py:if="tg_flash" class="flash" py:content="tg_flash"></div>
+
+ <div py:replace="item[:]"/>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+from libbe.bugdir import severity_levels
+def select_among(name, options, default):
+ output = ['<select name="%s">' % name]
+ for option in options:
+ if option == default:
+ selected = ' selected="selected"'
+ else:
+ selected = ""
+ output.append("<option%s>%s</option>" % (selected, option))
+ output.append("</select>")
+ return XML("".join(output))
+?>
+<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>Project List</title>
+</head>
+
+<body>
+<h1>Project List</h1>
+<table>
+<tr py:for="project_id,(project_name, project_loc) in projects.iteritems()"><td><a href="/${project_id}/">${project_name}</a></td></tr>
+</table>
+</body>
+</html>
--- /dev/null
+# 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="<packagename.templates.templatename>"
+
+
+# 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"
+
+[/static]
+staticFilter.on = True
+staticFilter.dir = "static"
--- /dev/null
+../libbe/
\ No newline at end of file
--- /dev/null
+# 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="<packagename.templates.templatename>"
+
+
+# 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=""
+
+[/static]
+staticFilter.on = True
+staticFilter.dir = "static"
--- /dev/null
+2005/12/01 15:44:05 CONFIG INFO Server parameters:
+2005/12/01 15:44:05 CONFIG INFO server.environment: production
+2005/12/01 15:44:05 CONFIG INFO server.logToScreen: False
+2005/12/01 15:44:05 CONFIG INFO server.logFile: server.log
+2005/12/01 15:44:05 CONFIG INFO server.protocolVersion: HTTP/1.0
+2005/12/01 15:44:05 CONFIG INFO server.socketHost:
+2005/12/01 15:44:05 CONFIG INFO server.socketPort: 8080
+2005/12/01 15:44:05 CONFIG INFO server.socketFile:
+2005/12/01 15:44:05 CONFIG INFO server.reverseDNS: False
+2005/12/01 15:44:05 CONFIG INFO server.socketQueueSize: 5
+2005/12/01 15:44:05 CONFIG INFO server.threadPool: 0
+2005/12/01 15:44:05 HTTP INFO Serving HTTP on http://localhost:8080/
+2005/12/01 15:44:17 HTTP INFO 127.0.0.1 - GET / HTTP/1.1
+2005/12/01 15:44:37 HTTP INFO 192.168.2.12 - GET / HTTP/1.1
+2005/12/01 15:44:42 HTTP INFO 192.168.2.12 - GET /be HTTP/1.1
+2005/12/01 15:44:43 HTTP INFO 192.168.2.12 - GET /be/301724b1-3853-4aff-8f23-44373df7cf1c HTTP/1.1
+2005/12/01 15:44:48 HTTP INFO 192.168.2.12 - GET /be/ HTTP/1.1
+2005/12/01 15:44:50 HTTP INFO 192.168.2.12 - GET / HTTP/1.1
+2005/12/01 15:44:53 HTTP INFO 192.168.2.12 - GET /devel/ HTTP/1.1
+2005/12/01 15:44:58 HTTP INFO 192.168.2.12 - GET / HTTP/1.1
+2005/12/01 15:52:57 HTTP INFO 127.0.0.1 - GET /devel HTTP/1.1
+2005/12/01 15:52:59 HTTP INFO 127.0.0.1 - GET /devel HTTP/1.1
+2005/12/01 15:53:25 HTTP INFO 127.0.0.1 - GET /devel HTTP/1.1
+2005/12/01 15:53:29 HTTP INFO <Ctrl-C> hit: shutting down server
+2005/12/01 15:53:29 HTTP INFO HTTP Server shut down
+2005/12/01 15:53:29 HTTP INFO CherryPy shut down
--- /dev/null
+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'),
+ )
+