Skip to content

Commit 998f758

Browse files
author
Anthony Baxter
committed
moved templates to proper location
1 parent 8bb3fec commit 998f758

File tree

12 files changed

+719
-0
lines changed

12 files changed

+719
-0
lines changed
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# $Id: __init__.py,v 1.1 2001-07-23 03:50:46 anthonybaxter Exp $
2+
3+
MAIL_DOMAIN=MAILHOST=HTTP_HOST=None
4+
HTTP_PORT=0
5+
6+
try:
7+
from localconfig import *
8+
except ImportError:
9+
localconfig = None
10+
11+
import os
12+
13+
# roundup home is this package's directory
14+
ROUNDUP_HOME=os.path.split(__file__)[0]
15+
16+
# The SMTP mail host that roundup will use to send mail
17+
if not MAILHOST:
18+
MAILHOST = 'localhost'
19+
20+
# The domain name used for email addresses.
21+
if not MAIL_DOMAIN:
22+
MAIL_DOMAIN = 'bizarsoftware.com.au'
23+
24+
# the next two are only used for the standalone HTTP server.
25+
if not HTTP_HOST:
26+
HTTP_HOST = ''
27+
if not HTTP_PORT:
28+
HTTP_PORT = 9080
29+
30+
# This is the directory that the database is going to be stored in
31+
DATABASE = os.path.join(ROUNDUP_HOME, 'db')
32+
33+
# This is the directory that the HTML templates reside in
34+
TEMPLATES = os.path.join(ROUNDUP_HOME, 'templates')
35+
36+
# The email address that mail to roundup should go to
37+
ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
38+
39+
# The email address that roundup will complain to if it runs into trouble
40+
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
41+
42+
# Somewhere for roundup to log stuff internally sent to stdout or stderr
43+
LOG = os.path.join(ROUNDUP_HOME, 'roundup.log')
44+
45+
46+
from roundup import hyperdb, hyper_bsddb, roundupdb, cgi_client, mailgw
47+
48+
class Database(roundupdb.Database, hyper_bsddb.Database):
49+
''' Creates a hybrid database from:
50+
. the base Database class given in hyperdb (basic functionlity)
51+
. the BSDDB implementation in hyperdb_bsddb
52+
. the roundup extensions from roundupdb
53+
'''
54+
pass
55+
56+
Class = roundupdb.Class
57+
class IssueClass(roundupdb.IssueClass):
58+
''' issues need the email information
59+
'''
60+
ISSUE_TRACKER_EMAIL = ISSUE_TRACKER_EMAIL
61+
ADMIN_EMAIL = ADMIN_EMAIL
62+
MAILHOST = MAILHOST
63+
64+
FileClass = roundupdb.FileClass
65+
66+
class Client(cgi_client.Client):
67+
''' derives basic mail gateway implementation from the standard module,
68+
with any specific extensions
69+
'''
70+
TEMPLATES = TEMPLATES
71+
pass
72+
73+
class MailGW(mailgw.MailGW):
74+
''' derives basic mail gateway implementation from the standard module,
75+
with any specific extensions
76+
'''
77+
ISSUE_TRACKER_EMAIL = ISSUE_TRACKER_EMAIL
78+
ADMIN_EMAIL = ADMIN_EMAIL
79+
MAILHOST = MAILHOST
80+
81+
def open(name=None):
82+
''' as from the roundupdb method openDB
83+
84+
storagelocator must be the directory the __init__.py file is in
85+
- os.path.split(__file__)[0] gives us that I think
86+
'''
87+
db = Database(DATABASE, name)
88+
pri = Class(db, "priority", name=hyperdb.String(), order=hyperdb.String())
89+
pri.setkey("name")
90+
stat = Class(db, "status", name=hyperdb.String(), order=hyperdb.String())
91+
stat.setkey("name")
92+
Class(db, "keyword", name=hyperdb.String())
93+
user = Class(db, "user", username=hyperdb.String(),
94+
password=hyperdb.String(), address=hyperdb.String(),
95+
realname=hyperdb.String(), phone=hyperdb.String(),
96+
organisation=hyperdb.String())
97+
user.setkey("username")
98+
msg = FileClass(db, "msg", author=hyperdb.Link("user"),
99+
recipients=hyperdb.Multilink("user"), date=hyperdb.Date(),
100+
summary=hyperdb.String(), files=hyperdb.Multilink("file"))
101+
file = FileClass(db, "file", name=hyperdb.String(), type=hyperdb.String())
102+
103+
# bugs and support calls etc
104+
rate = Class(db, "rate", name=hyperdb.String(), order=hyperdb.String())
105+
rate.setkey("name")
106+
source = Class(db, "source", name=hyperdb.String(), order=hyperdb.String())
107+
source.setkey("name")
108+
platform = Class(db, "platform", name=hyperdb.String(), order=hyperdb.String())
109+
platform.setkey("name")
110+
product = Class(db, "product", name=hyperdb.String(), order=hyperdb.String())
111+
product.setkey("name")
112+
Class(db, "timelog", date=hyperdb.Date(), time=hyperdb.String(),
113+
performedby=hyperdb.Link("user"), description=hyperdb.String())
114+
issue = IssueClass(db, "issue", assignedto=hyperdb.Link("user"),
115+
priority=hyperdb.Link("priority"), status=hyperdb.Link("status"),
116+
rate=hyperdb.Link("rate"), source=hyperdb.Link("source"),
117+
product=hyperdb.Link("product"), platform=hyperdb.Multilink("platform"),
118+
version=hyperdb.String(),
119+
timelog=hyperdb.Multilink("timelog"), customername=hyperdb.String())
120+
issue.setkey('title')
121+
import detectors
122+
detectors.init(db)
123+
return db
124+
125+
def init(adminpw):
126+
''' as from the roundupdb method initDB
127+
128+
storagelocator must be the directory the __init__.py file is in
129+
- os.path.split(__file__)[0] gives us that I think
130+
'''
131+
dbdir = os.path.join(DATABASE, 'files')
132+
if not os.path.isdir(dbdir):
133+
os.makedirs(dbdir)
134+
db = open("admin")
135+
db.clear()
136+
pri = db.getclass('priority')
137+
pri.create(name="fatal-bug", order="1")
138+
pri.create(name="bug", order="2")
139+
pri.create(name="usability", order="3")
140+
pri.create(name="feature", order="4")
141+
pri.create(name="support", order="5")
142+
143+
stat = db.getclass('status')
144+
stat.create(name="unread", order="1")
145+
stat.create(name="deferred", order="2")
146+
stat.create(name="chatting", order="3")
147+
stat.create(name="need-eg", order="4")
148+
stat.create(name="in-progress", order="5")
149+
stat.create(name="testing", order="6")
150+
stat.create(name="done-cbb", order="7")
151+
stat.create(name="resolved", order="8")
152+
153+
rate = db.getclass("rate")
154+
rate.create(name='basic', order="1")
155+
rate.create(name='premium', order="2")
156+
rate.create(name='internal', order="3")
157+
158+
source = db.getclass("source")
159+
source.create(name='phone', order="1")
160+
source.create(name='e-mail', order="2")
161+
source.create(name='internal', order="3")
162+
source.create(name='internal-qa', order="4")
163+
164+
platform = db.getclass("platform")
165+
platform.create(name='linux', order="1")
166+
platform.create(name='windows', order="2")
167+
platform.create(name='mac', order="3")
168+
169+
product = db.getclass("product")
170+
product.create(name='Bizar Shop', order="1")
171+
product.create(name='Bizar Shop Developer', order="2")
172+
product.create(name='Bizar Shop Manual', order="3")
173+
product.create(name='Bizar Shop Developer Manual', order="4")
174+
175+
user = db.getclass('user')
176+
user.create(username="admin", password=adminpw, address=ADMIN_EMAIL)
177+
178+
db.close()
179+
180+
#
181+
# $Log: not supported by cvs2svn $
182+
# Revision 1.2 2001/07/22 12:09:32 richard
183+
# Final commit of Grande Splite
184+
#
185+
#
186+
187+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#$Id: __init__.py,v 1.1 2001-07-23 03:50:47 anthonybaxter Exp $
2+
3+
def init(db):
4+
''' execute the init functions of all the modules in this directory
5+
'''
6+
import os, sys
7+
this_dir = os.path.split(__file__)[0]
8+
try:
9+
sys.path.insert(0, this_dir)
10+
for file in os.listdir(this_dir):
11+
file, ext = os.path.splitext(file)
12+
if file == '__init__': continue
13+
if ext in ('.py', '.pyc'):
14+
module = __import__(file)
15+
module.init(db)
16+
finally:
17+
del sys.path[0]
18+
19+
#
20+
#$Log: not supported by cvs2svn $
21+
#Revision 1.1 2001/07/22 12:09:32 richard
22+
#Final commit of Grande Splite
23+
#
24+
#
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#$Id: nosyreaction.py,v 1.1 2001-07-23 03:50:47 anthonybaxter Exp $
2+
3+
def nosyreaction(db, cl, nodeid, oldvalues):
4+
''' A standard detector is provided that watches for additions to the
5+
"messages" property.
6+
7+
When a new message is added, the detector sends it to all the users on
8+
the "nosy" list for the issue that are not already on the "recipients"
9+
list of the message.
10+
11+
Those users are then appended to the "recipients" property on the
12+
message, so multiple copies of a message are never sent to the same
13+
user.
14+
15+
The journal recorded by the hyperdatabase on the "recipients" property
16+
then provides a log of when the message was sent to whom.
17+
'''
18+
messages = []
19+
if oldvalues is None:
20+
# the action was a create, so use all the messages in the create
21+
messages = cl.get(nodeid, 'messages')
22+
elif oldvalues.has_key('messages'):
23+
# the action was a set (so adding new messages to an existing issue)
24+
m = {}
25+
for msgid in oldvalues['messages']:
26+
m[msgid] = 1
27+
messages = []
28+
# figure which of the messages now on the issue weren't there before
29+
for msgid in cl.get(nodeid, 'messages'):
30+
if not m.has_key(msgid):
31+
messages.append(msgid)
32+
if not messages:
33+
return
34+
35+
# send a copy to the nosy list
36+
for msgid in messages:
37+
cl.sendmessage(nodeid, msgid)
38+
39+
# update the nosy list with the recipients from the new messages
40+
nosy = cl.get(nodeid, 'nosy')
41+
n = {}
42+
for nosyid in nosy: n[nosyid] = 1
43+
change = 0
44+
# but don't add admin to the nosy list
45+
for msgid in messages:
46+
for recipid in db.msg.get(msgid, 'recipients'):
47+
if recipid != '1' and not n.has_key(recipid):
48+
change = 1
49+
nosy.append(recipid)
50+
authid = db.msg.get(msgid, 'author')
51+
if authid != '1' and not n.has_key(authid):
52+
change = 1
53+
nosy.append(authid)
54+
if change:
55+
cl.set(nodeid, nosy=nosy)
56+
57+
58+
def init(db):
59+
db.issue.react('create', nosyreaction)
60+
db.issue.react('set', nosyreaction)
61+
62+
#
63+
#$Log: not supported by cvs2svn $
64+
#Revision 1.1 2001/07/22 12:09:32 richard
65+
#Final commit of Grande Splite
66+
#
67+
#
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- $Id: file.index,v 1.1 2001-07-23 03:50:46 anthonybaxter Exp $-->
2+
<tr>
3+
<property name="name">
4+
<td><display call="link('name')"></td>
5+
</property>
6+
<property name="type">
7+
<td><display call="plain('type')"></td>
8+
</property>
9+
</tr>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!-- $Id: issue.filter,v 1.1 2001-07-23 03:50:46 anthonybaxter Exp $-->
2+
<property name="title">
3+
<tr><th width="1%" align="right" class="location-bar">Title</th>
4+
<td><display call="field('title')"></td></tr>
5+
</property>
6+
<property name="status">
7+
<tr><th width="1%" align="right" class="location-bar">Status</th>
8+
<td><display call="checklist('status')"></td></tr>
9+
</property>
10+
<property name="priority">
11+
<tr><th width="1%" align="right" class="location-bar">Priority</th>
12+
<td><display call="checklist('priority')"></td></tr>
13+
</property>
14+
<property name="platform">
15+
<tr><th width="1%" align="right" class="location-bar">Platform</th>
16+
<td><display call="checklist('platform')"></td></tr>
17+
</property>
18+
<property name="product">
19+
<tr><th width="1%" align="right" class="location-bar">Product</th>
20+
<td><display call="checklist('product')"></td></tr>
21+
</property>
22+
<property name="version">
23+
<tr><th width="1%" align="right" class="location-bar">Version</th>
24+
<td><display call="field('version')"></td></tr>
25+
</property>
26+
<property name="source">
27+
<tr><th width="1%" align="right" class="location-bar">Source</th>
28+
<td><display call="checklist('source')"></td></tr>
29+
</property>
30+
<property name="assignedto">
31+
<tr><th width="1%" align="right" class="location-bar">Assigned&nbsp;to</th>
32+
<td><display call="checklist('assignedto')"></td></tr>
33+
</property>
34+
<property name="customername">
35+
<tr><th width="1%" align="right" class="location-bar">Customer&nbsp;name</th>
36+
<td><display call="field('customername')"></td></tr>
37+
</property>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- $Id: issue.index,v 1.1 2001-07-23 03:50:46 anthonybaxter Exp $-->
2+
<tr>
3+
<property name="activity">
4+
<td valign="top"><display call="reldate('activity', pretty=1)"></td>
5+
</property>
6+
<property name="priority">
7+
<td valign="top"><display call="plain('priority')"></td>
8+
</property>
9+
<property name="status">
10+
<td valign="top"><display call="plain('status')"></td>
11+
</property>
12+
<property name="title">
13+
<td valign="top"><display call="link('title')"></td>
14+
</property>
15+
<property name="platform">
16+
<td valign="top"><display call="plain('platform')"></td>
17+
</property>
18+
<property name="product">
19+
<td valign="top"><display call="plain('product')"></td>
20+
</property>
21+
<property name="version">
22+
<td valign="top"><display call="plain('version')"></td>
23+
</property>
24+
<property name="source">
25+
<td valign="top"><display call="plain('source')"></td>
26+
</property>
27+
<property name="assignedto">
28+
<td valign="top"><display call="plain('assignedto')"></td>
29+
</property>
30+
<property name="customername">
31+
<td valign="top"><display call="plain('customername')"></td>
32+
</property>
33+
</tr>

0 commit comments

Comments
 (0)