@ -1,5 +1,3 @@
import shutil
import glob
import itertools
import itertools
from . import bibstruct
from . import bibstruct
@ -7,6 +5,7 @@ from . import events
from . import datacache
from . import datacache
from . paper import Paper
from . paper import Paper
def _base27 ( n ) :
def _base27 ( n ) :
return _base27 ( ( n - 1 ) / / 26 ) + chr ( ord ( ' a ' ) + ( ( n - 1 ) % 26 ) ) if n else ' '
return _base27 ( ( n - 1 ) / / 26 ) + chr ( ord ( ' a ' ) + ( ( n - 1 ) % 26 ) ) if n else ' '
@ -65,9 +64,8 @@ class Repository(object):
if True , mimick the behavior of updating a paper
if True , mimick the behavior of updating a paper
"""
"""
bibstruct . check_citekey ( paper . citekey )
bibstruct . check_citekey ( paper . citekey )
if ( not overwrite ) and self . databroker . exists ( paper . citekey , both = False ) :
if ( not overwrite ) and ( self . databroker . exists ( paper . citekey , both = False )
raise IOError ( ' files using the {} citekey already exists ' . format ( paper . citekey ) )
or ( citekey in self ) ) :
if ( not overwrite ) and self . citekeys is not None and paper . citekey in self . citekeys :
raise CiteKeyCollision ( ' citekey {} already in use ' . format ( paper . citekey ) )
raise CiteKeyCollision ( ' citekey {} already in use ' . format ( paper . citekey ) )
self . databroker . push_bibdata ( paper . citekey , paper . bibdata )
self . databroker . push_bibdata ( paper . citekey , paper . bibdata )
@ -138,4 +136,3 @@ class Repository(object):
for p in self . all_papers ( ) :
for p in self . all_papers ( ) :
tags = tags . union ( p . tags )
tags = tags . union ( p . tags )
return tags
return tags