summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14012c9)
raw | patch | inline | side by side (parent: 14012c9)
author | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 25 Feb 2002 14:34:31 +0000 (14:34 +0000) | ||
committer | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 25 Feb 2002 14:34:31 +0000 (14:34 +0000) |
change test_db as dirlist does not work for subdirectories.
ATTENTION: blobfiles now creates subdirectories for files.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@658 57a73879-2fb5-44c3-a270-3262357dd7e2
ATTENTION: blobfiles now creates subdirectories for files.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@658 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
MIGRATION.txt | patch | blob | history | |
README.txt | patch | blob | history | |
roundup/backends/back_anydbm.py | patch | blob | history | |
test/test_db.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 0f1e2dcb970222300b821903cbe82c2962d09bc6..5e637b2f024dd37acd7c455b6751a7a7799e60bc 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2002-02-?? - 0.4.1
Feature:
2002-02-?? - 0.4.1
Feature:
+ . use blobfiles in back_anydbm which is used in back_bsddb.
+ change test_db as dirlist does not work for subdirectories.
+ ATTENTION: blobfiles now creates subdirectories for files.
. add module blobfiles in backends with file access functions.
. roundup db catch only IOError in getfile.
. roundup db catches retrieving not existing files.
. add module blobfiles in backends with file access functions.
. roundup db catch only IOError in getfile.
. roundup db catches retrieving not existing files.
diff --git a/MIGRATION.txt b/MIGRATION.txt
index 5de7618c6ed86bc8aeb8a548b1151fc8e9954e30..396ade182b9144780d400b9c7677574bc0b8727e 100644 (file)
--- a/MIGRATION.txt
+++ b/MIGRATION.txt
0.3.x -> 0.4.x
0.2.x -> 0.3.x
0.3.x -> 0.4.x
0.2.x -> 0.3.x
+From CVS
+========
+
+Files storage
+-------------
+
+Messages and files from newly created issues will be put into subdierectories
+in thousands e.g. msg123 will be put into files/msg/0/msg123, file2003
+will go into files/file/2/file2003. Previous messages are still found, but
+could be put into this structure.
Migrating from 0.4.0 to 0.4.1
=============================
Migrating from 0.4.0 to 0.4.1
=============================
diff --git a/README.txt b/README.txt
index 4dc1b066c6e689d900c48f171c3cd5e34688e7a1..57745d334d7848cf3aa76416c096159954c0e12b 100644 (file)
--- a/README.txt
+++ b/README.txt
. more back-ends
hyperdb:
. more efficient reverse lookups
. more back-ends
hyperdb:
. more efficient reverse lookups
-roundupdb:
- . split the file storage into multiple dirs?
roundup-server:
. check the source file timestamps before reloading
cgi_client
roundup-server:
. check the source file timestamps before reloading
cgi_client
index 5f30b1ad6cffb3d2511a2d17070c84cdce4a9dd1..7c95841eeca0f54bd23b84f0d19f7d6ca65456be 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.28 2002-02-16 09:14:17 richard Exp $
+#$Id: back_anydbm.py,v 1.29 2002-02-25 14:34:31 grubert Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
import whichdb, anydbm, os, marshal
from roundup import hyperdb, date, password
import whichdb, anydbm, os, marshal
from roundup import hyperdb, date, password
+from blobfiles import FileStorage
#
# Now the database
#
#
# Now the database
#
-class Database(hyperdb.Database):
+class Database(FileStorage, hyperdb.Database):
"""A database for storing records containing flexible data types.
Transaction stuff TODO:
"""A database for storing records containing flexible data types.
Transaction stuff TODO:
#
# Files - special node properties
#
# Files - special node properties
- #
- def filename(self, classname, nodeid, property=None):
- '''Determine what the filename for the given node and optionally property is.
- '''
- # TODO: split into multiple files directories
- if property:
- return os.path.join(self.dir, 'files', '%s%s.%s'%(classname,
- nodeid, property))
- else:
- # roundupdb.FileClass never specified the property name, so don't include it
- return os.path.join(self.dir, 'files', '%s%s'%(classname,
- nodeid))
-
- def storefile(self, classname, nodeid, property, content):
- '''Store the content of the file in the database. The property may be None, in
- which case the filename does not indicate which property is being saved.
- '''
- name = self.filename(classname, nodeid, property)
- open(name + '.tmp', 'wb').write(content)
- self.transactions.append((self._doStoreFile, (name, )))
-
- def getfile(self, classname, nodeid, property):
- '''Store the content of the file in the database.
- '''
- filename = self.filename(classname, nodeid, property)
- try:
- return open(filename, 'rb').read()
- except:
- return open(filename+'.tmp', 'rb').read()
-
+ # inherited from FileStorage
#
# Journal
#
# Journal
#
#$Log: not supported by cvs2svn $
#
#$Log: not supported by cvs2svn $
+#Revision 1.28 2002/02/16 09:14:17 richard
+# . #514854 ] History: "User" is always ticket creator
+#
#Revision 1.27 2002/01/22 07:21:13 richard
#. fixed back_bsddb so it passed the journal tests
#
#Revision 1.27 2002/01/22 07:21:13 richard
#. fixed back_bsddb so it passed the journal tests
#
diff --git a/test/test_db.py b/test/test_db.py
index b96f166b20297f92b05f348dd50d46839164675e..dc08709cc447092623c9c99610f39281eb5e5b74 100644 (file)
--- a/test/test_db.py
+++ b/test/test_db.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_db.py,v 1.18 2002-01-22 07:21:13 richard Exp $
+# $Id: test_db.py,v 1.19 2002-02-25 14:34:31 grubert Exp $
import unittest, os, shutil
import unittest, os, shutil
self.db.status.history('2')
def testTransactions(self):
self.db.status.history('2')
def testTransactions(self):
+ # remember the number of items we started
num_issues = len(self.db.issue.list())
num_issues = len(self.db.issue.list())
- files_dir = os.path.join('_test_dir', 'files')
- if os.path.exists(files_dir):
- num_files = len(os.listdir(files_dir))
- else:
- num_files = 0
+ num_files = self.db.numfiles()
self.db.issue.create(title="don't commit me!", status='1')
self.assertNotEqual(num_issues, len(self.db.issue.list()))
self.db.rollback()
self.db.issue.create(title="don't commit me!", status='1')
self.assertNotEqual(num_issues, len(self.db.issue.list()))
self.db.rollback()
self.assertNotEqual(num_issues, len(self.db.issue.list()))
self.db.file.create(name="test", type="text/plain", content="hi")
self.db.rollback()
self.assertNotEqual(num_issues, len(self.db.issue.list()))
self.db.file.create(name="test", type="text/plain", content="hi")
self.db.rollback()
- self.assertEqual(num_files, len(os.listdir(files_dir)))
- self.db.file.create(name="test", type="text/plain", content="hi")
- self.db.commit()
- self.assertNotEqual(num_files, len(os.listdir(files_dir)))
- num_files2 = len(os.listdir(files_dir))
+ self.assertEqual(num_files, self.db.numfiles())
+ for i in range(10):
+ self.db.file.create(name="test", type="text/plain",
+ content="hi %d"%(i))
+ self.db.commit()
+ num_files2 = self.db.numfiles()
+ self.assertNotEqual(num_files, num_files2)
self.db.file.create(name="test", type="text/plain", content="hi")
self.db.rollback()
self.db.file.create(name="test", type="text/plain", content="hi")
self.db.rollback()
- self.assertNotEqual(num_files, len(os.listdir(files_dir)))
- self.assertEqual(num_files2, len(os.listdir(files_dir)))
+ self.assertNotEqual(num_files, self.db.numfiles())
+ self.assertEqual(num_files2, self.db.numfiles())
+
def testExceptions(self):
def testExceptions(self):
#
# $Log: not supported by cvs2svn $
#
# $Log: not supported by cvs2svn $
+# Revision 1.18 2002/01/22 07:21:13 richard
+# . fixed back_bsddb so it passed the journal tests
+#
+# ... it didn't seem happy using the back_anydbm _open method, which is odd.
+# Yet another occurrance of whichdb not being able to recognise older bsddb
+# databases. Yadda yadda. Made the HYPERDBDEBUG stuff more sane in the
+# process.
+#
# Revision 1.17 2002/01/22 05:06:09 rochecompaan
# We need to keep the last 'set' entry in the journal to preserve
# information on 'activity' for nodes.
# Revision 1.17 2002/01/22 05:06:09 rochecompaan
# We need to keep the last 'set' entry in the journal to preserve
# information on 'activity' for nodes.