|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
from ..color import colored
|
|
|
|
|
from .. import repo
|
|
|
|
|
from ..paper import NoDocumentFile
|
|
|
|
|
from .. import configs
|
|
|
|
@ -19,9 +18,10 @@ def command(config, ui, citekey):
|
|
|
|
|
paper = rp.paper_from_ref(citekey, fatal=True)
|
|
|
|
|
try:
|
|
|
|
|
filepath = paper.get_document_path()
|
|
|
|
|
subprocess.Popen([config.get(configs.MAIN_SECTION, 'open-cmd'), filepath])
|
|
|
|
|
print("%s opened." % colored(filepath, 'filepath'))
|
|
|
|
|
subprocess.Popen([config.get(configs.MAIN_SECTION, 'open-cmd'),
|
|
|
|
|
filepath])
|
|
|
|
|
print("%s opened." % ui.colored(filepath, 'filepath'))
|
|
|
|
|
except NoDocumentFile:
|
|
|
|
|
print("%s: No document associated to this entry %s."
|
|
|
|
|
% (colored('error', 'error'), colored(citekey, 'citekey')))
|
|
|
|
|
exit(-1)
|
|
|
|
|
ui.error("No document associated with the entry %s."
|
|
|
|
|
% ui.colored(citekey, 'citekey'))
|
|
|
|
|
ui.exit()
|
|
|
|
|