mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Whoa. Long time no commit. Anyway, we make shelf dispatch to Shelf appropriately.
This commit is contained in:
parent
6504dfcaa1
commit
1a40c6fc69
@ -87,14 +87,14 @@ def open(filename, mode='r'):
|
|||||||
else:
|
else:
|
||||||
raise ValueError, 'Invalid flag: %s' % mode
|
raise ValueError, 'Invalid flag: %s' % mode
|
||||||
|
|
||||||
def shelf(filename):
|
def shelf(filename, *args, **kwargs):
|
||||||
"""Opens a new shelf database object."""
|
"""Opens a new shelf database object."""
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
return Shelf(filename)
|
return Shelf(filename, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
maker = Maker(filename)
|
maker = Maker(filename)
|
||||||
maker.finish()
|
maker.finish()
|
||||||
return Shelf(filename)
|
return Shelf(filename, *args, **kwargs)
|
||||||
|
|
||||||
def _readKeyValue(fd):
|
def _readKeyValue(fd):
|
||||||
klen = 0
|
klen = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user