On Mon, Jun 21, 2010 at 05:10:55PM -0400, Chris Ball wrote: > > You were close ;) > > self.bd = libbe.bugdir.BugDir(self.get_storage(bug_root), > > from_storage=True)
Ah, I can't read :p. In
libbe.command.base.StorageCallbacks.get_bugdir()
The line was
self._bugdir = libbe.bugdir.BugDir(self.get_storage(),
from_storage=True)
not
self._bugdir = libbe.bugdir.BugDir(storage.get_storage(),
from_storage=True)
Looking at
libbe.command.base.StorageCallbacks.get_storage()
we have
self._storage = self.get_unconnected_storage()
self._storage.connect()
version = self._storage.storage_version()
if version != libbe.storage.STORAGE_VERSION:
raise libbe.storage.InvalidStorageVersion(version)
So the proper connection procedure is
import libbe.storage
import libbe.bugdir
s = libbe.storage.get_storage("path/to/repo")
s.connect() # previously missing line
version = s.storage_version()
if version not in ['handled', 'versions', ...]:
raise ReallyObnoxiousError
b = B.BugDir(s, from_storage=True)
and then when you're done:
s.disconnect()
It makes sense if you channel "database" instead of "filesystem",
which is the whole idea behind the Storage abstraction.
--
This email may be signed or encrypted with GPG (http://www.gnupg.org).
The GPG signature (if present) will be attached as 'signature.asc'.
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
My public key is at http://www.physics.drexel.edu/~wking/pubkey.txt
pgpnXxtxrvgc4.pgp
Description: PGP signature
_______________________________________________ Be-devel mailing list [email protected] http://void.printf.net/cgi-bin/mailman/listinfo/be-devel
