Skip to content

Commit 32d8b7a

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 90639d7 commit 32d8b7a

File tree

6 files changed

+23
-41
lines changed

6 files changed

+23
-41
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ are given with the most recent entry first.
55
Fixed:
66
- rdbms backend full text search failure after import (sf bug 980314)
77
- rdbms backends not filtering correctly on link=None
8+
- fix anydbm journal import (sf bug 983166)
89

910

1011
2004-06-24 0.7.5

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
STXTOHTML = rst2html
2-
STXTOHT = rst2ht.py
1+
STXTOHTML = rst2html.py
2+
STXTOHT = python /usr/bin/rst2ht.py
33
WEBDIR = ../../htdocs/htdocs/doc-0.7
44

55
SOURCE = announcement.txt customizing.txt developers.txt FAQ.txt features.txt \

doc/customizing.txt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,13 +2460,6 @@ is also done in the ``open()`` function of ``dbinit.py``.
24602460
There are currently two loops which set up permissions and then assign
24612461
them to various roles. Simply add the new "category" to both lists::
24622462

2463-
# new permissions for this schema
2464-
for cl in 'issue', 'file', 'msg', 'user', 'category':
2465-
db.security.addPermission(name="Edit", klass=cl,
2466-
description="User is allowed to edit "+cl)
2467-
db.security.addPermission(name="View", klass=cl,
2468-
description="User is allowed to access "+cl)
2469-
24702463
# Assign the access and edit permissions for issue, file and message
24712464
# to regular users now
24722465
for cl in 'issue', 'file', 'msg', 'category':
@@ -2475,24 +2468,8 @@ them to various roles. Simply add the new "category" to both lists::
24752468
p = db.security.getPermission('Edit', cl)
24762469
db.security.addPermissionToRole('User', p)
24772470

2478-
So you are in effect doing the following (with 'cl' substituted by its
2479-
value)::
2480-
2481-
db.security.addPermission(name="Edit", klass='category',
2482-
description="User is allowed to edit "+'category')
2483-
db.security.addPermission(name="View", klass='category',
2484-
description="User is allowed to access "+'category')
2485-
2486-
which is creating two permission types; that of editing and viewing
2487-
"category" objects respectively. Then the following lines assign those
2488-
new permissions to the "User" role, so that normal users can view and
2489-
edit "category" objects::
2490-
2491-
p = db.security.getPermission('View', 'category')
2492-
db.security.addPermissionToRole('User', p)
2493-
2494-
p = db.security.getPermission('Edit', 'category')
2495-
db.security.addPermissionToRole('User', p)
2471+
These lines assign the View and Edit Permissions to the "User" role, so
2472+
that normal users can view and edit "category" objects.
24962473

24972474
This is all the work that needs to be done for the database. It will
24982475
store categories, and let users view and edit them. Now on to the

roundup/backends/back_anydbm.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.146.2.12 2004-06-28 23:15:39 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.13 2004-07-01 03:58:34 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -708,6 +708,7 @@ def doSetJournal(self, classname, nodeid, journal):
708708
if isinstance(params, type({})):
709709
if action in ('set', 'create'):
710710
params = self.serialise(classname, params)
711+
journaldate = journaldate.serialise()
711712
l.append((nodeid, journaldate, journaltag, action, params))
712713
db = self.getCachedJournalDB(classname)
713714
db[nodeid] = marshal.dumps(l)
@@ -2183,11 +2184,12 @@ def index(self, nodeid):
21832184
Pass on the content-type property for the content property.
21842185
'''
21852186
Class.index(self, nodeid)
2186-
mimetype = self.get(nodeid, 'type')
2187-
if not mimetype:
2188-
mimetype = self.default_mime_type
2187+
try:
2188+
mime_type = self.get(nodeid, 'type', self.default_mime_type)
2189+
except KeyError:
2190+
mime_type = self.default_mime_type
21892191
self.db.indexer.add_text((self.classname, nodeid, 'content'),
2190-
self.get(nodeid, 'content'), mimetype)
2192+
str(self.get(nodeid, 'content')), mime_type)
21912193

21922194
# deviation from spec - was called ItemClass
21932195
class IssueClass(Class, roundupdb.IssueClass):

roundup/backends/back_metakit.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.70.2.5 2004-06-24 09:56:49 richard Exp $
1+
# $Id: back_metakit.py,v 1.70.2.6 2004-07-01 03:58:34 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -1947,11 +1947,12 @@ def undo(fnm=nm):
19471947

19481948
def index(self, nodeid):
19491949
Class.index(self, nodeid)
1950-
mimetype = self.get(nodeid, 'type')
1951-
if not mimetype:
1952-
mimetype = self.default_mime_type
1950+
try:
1951+
mime_type = self.get(nodeid, 'type', self.default_mime_type)
1952+
except KeyError:
1953+
mime_type = self.default_mime_type
19531954
self.db.indexer.add_text((self.classname, nodeid, 'content'),
1954-
self.get(nodeid, 'content'), mimetype)
1955+
str(self.get(nodeid, 'content')), mime_type)
19551956

19561957
class IssueClass(Class, roundupdb.IssueClass):
19571958
''' The newly-created class automatically includes the "messages",

roundup/backends/rdbms_common.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.13 2004-06-29 05:53:37 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.14 2004-07-01 03:58:34 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2650,9 +2650,10 @@ def index(self, nodeid):
26502650
26512651
Pass on the content-type property for the content property.
26522652
'''
2653-
Class.index(nodeid)
2654-
mime_type = self.get(itemid, 'type')
2655-
if not mime_type:
2653+
Class.index(self, nodeid)
2654+
try:
2655+
mime_type = self.get(nodeid, 'type', self.default_mime_type)
2656+
except KeyError:
26562657
mime_type = self.default_mime_type
26572658
self.db.indexer.add_text((self.classname, nodeid, 'content'),
26582659
str(self.get(nodeid, 'content')), mime_type)

0 commit comments

Comments
 (0)