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 ..files import editor_input
|
||||||
from .. import repo
|
from .. import repo
|
||||||
from ..paper import get_bibentry_from_string
|
from ..paper import get_bibentry_from_string
|
||||||
@ -6,11 +5,9 @@ from ..paper import get_bibentry_from_string
|
|||||||
|
|
||||||
def parser(subparsers, config):
|
def parser(subparsers, config):
|
||||||
parser = subparsers.add_parser('edit',
|
parser = subparsers.add_parser('edit',
|
||||||
help=colored('open the paper bibliographic file in an editor',
|
help='open the paper bibliographic file in an editor')
|
||||||
'normal'))
|
|
||||||
parser.add_argument('reference',
|
parser.add_argument('reference',
|
||||||
help=colored('reference to the paper (citekey or number)',
|
help='reference to the paper (citekey or number)')
|
||||||
'normal'))
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ from ..paper import NoDocumentFile
|
|||||||
|
|
||||||
def parser(subparsers, config):
|
def parser(subparsers, config):
|
||||||
parser = subparsers.add_parser('open',
|
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',
|
parser.add_argument('citekey',
|
||||||
help=colored('the paper associated citekey', 'normal'))
|
help='the paper associated citekey')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,12 +179,13 @@ class Repository(object):
|
|||||||
|
|
||||||
def get_document_directory(self):
|
def get_document_directory(self):
|
||||||
if self.config.has_option('papers', 'document-directory'):
|
if self.config.has_option('papers', 'document-directory'):
|
||||||
return self.config.get('papers', 'document-directory')
|
doc_dir = self.config.get('papers', 'document-directory')
|
||||||
else:
|
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):
|
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)
|
found = glob.glob(doc_dir + "/%s.*" % citekey)
|
||||||
if found:
|
if found:
|
||||||
return found[0]
|
return found[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user