Adds possibility to create repo when instance initialized.
This avoids having to manually call _create on filebroker.
This commit is contained in:
parent
b51477fc58
commit
2f1a8ae42a
@ -6,6 +6,7 @@ from .. import databroker
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .. import color
|
||||
from ..repo import Repository
|
||||
|
||||
|
||||
def parser(subparsers):
|
||||
@ -43,4 +44,4 @@ def command(args):
|
||||
config().docsdir = docsdir
|
||||
config().save()
|
||||
|
||||
databroker.DataBroker(pubsdir, create=True)
|
||||
Repository(config(), create=True)
|
||||
|
@ -21,10 +21,11 @@ class InvalidReference(Exception):
|
||||
|
||||
class Repository(object):
|
||||
|
||||
def __init__(self, config):
|
||||
def __init__(self, config, create=False):
|
||||
self.config = config
|
||||
self._citekeys = None
|
||||
self.databroker = datacache.DataCache(self.config.pubsdir)
|
||||
self.databroker = datacache.DataCache(self.config.pubsdir,
|
||||
create=create)
|
||||
|
||||
@property
|
||||
def citekeys(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user