minor bug in repo; self.bibentry in paper
This commit is contained in:
parent
76a6d092dd
commit
353a282b42
@ -18,7 +18,9 @@ class Paper(object):
|
||||
self.citekey = citekey
|
||||
self.metadata = metadata
|
||||
self.bibdata = bibdata
|
||||
|
||||
|
||||
_, self.bibentry = bibstruct.get_entry(self.bibdata)
|
||||
|
||||
if self.metadata is None:
|
||||
self.metadata = copy.deepcopy(DEFAULT_META)
|
||||
if self.citekey is None:
|
||||
|
@ -50,9 +50,10 @@ class Repository(object):
|
||||
|
||||
def pull_paper(self, citekey):
|
||||
"""Load a paper by its citekey from disk, if necessary."""
|
||||
if self.databroker.exists(paper.citekey, both = True):
|
||||
return Paper(self, self.databroker.pull_bibdata(citekey),
|
||||
self.databroker.pull_metadata(citekey))
|
||||
if self.databroker.exists(citekey, both = True):
|
||||
return Paper(self.databroker.pull_bibdata(citekey),
|
||||
citekey=citekey,
|
||||
metadata=self.databroker.pull_metadata(citekey))
|
||||
else:
|
||||
raise InvalidReference
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user