FIX minor bug in document path.
This commit is contained in:
parent
5d312e020d
commit
0d413697e7
@ -1,4 +1,3 @@
|
||||
from ..color import colored
|
||||
from ..files import editor_input
|
||||
from .. import repo
|
||||
from ..paper import get_bibentry_from_string
|
||||
@ -6,11 +5,9 @@ from ..paper import get_bibentry_from_string
|
||||
|
||||
def parser(subparsers, config):
|
||||
parser = subparsers.add_parser('edit',
|
||||
help=colored('open the paper bibliographic file in an editor',
|
||||
'normal'))
|
||||
help='open the paper bibliographic file in an editor')
|
||||
parser.add_argument('reference',
|
||||
help=colored('reference to the paper (citekey or number)',
|
||||
'normal'))
|
||||
help='reference to the paper (citekey or number)')
|
||||
return parser
|
||||
|
||||
|
||||
|
@ -7,9 +7,9 @@ from ..paper import NoDocumentFile
|
||||
|
||||
def parser(subparsers, config):
|
||||
parser = subparsers.add_parser('open',
|
||||
help=colored('open the paper in a pdf viewer', 'normal'))
|
||||
help='open the paper in a pdf viewer')
|
||||
parser.add_argument('citekey',
|
||||
help=colored('the paper associated citekey', 'normal'))
|
||||
help='the paper associated citekey')
|
||||
return parser
|
||||
|
||||
|
||||
|
@ -179,12 +179,13 @@ class Repository(object):
|
||||
|
||||
def get_document_directory(self):
|
||||
if self.config.has_option('papers', 'document-directory'):
|
||||
return self.config.get('papers', 'document-directory')
|
||||
doc_dir = self.config.get('papers', 'document-directory')
|
||||
else:
|
||||
return os.path.join(self.papersdir, DOC_DIR)
|
||||
doc_dir = os.path.join(self.papersdir, DOC_DIR)
|
||||
return files.clean_path(doc_dir)
|
||||
|
||||
def find_document(self, citekey):
|
||||
doc_dir = files.clean_path(self.get_document_directory())
|
||||
doc_dir = self.get_document_directory()
|
||||
found = glob.glob(doc_dir + "/%s.*" % citekey)
|
||||
if found:
|
||||
return found[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user