Skip to content
Snippets Groups Projects
Commit 92681cde authored by Ronald Jäpel's avatar Ronald Jäpel
Browse files

Improve error messages and import checks

parent e593bd1b
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,19 @@ import sys ...@@ -2,13 +2,19 @@ import sys
import time import time
import os import os
from pathlib import Path from pathlib import Path
import traceback
from cadetrdm.io_utils import wait_for_user from cadetrdm.io_utils import wait_for_user
from ipylab import JupyterFrontEnd from ipylab import JupyterFrontEnd
import junix import junix
import nbformat as nbf import nbformat as nbf
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert.nbconvertapp import NbConvertApp try:
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert.nbconvertapp import NbConvertApp
except ModuleNotFoundError as e:
traceback.print_exc()
print("No working nbconvert installation found OR a conflict in your packages found.")
class Notebook: class Notebook:
......
...@@ -6,7 +6,6 @@ import traceback ...@@ -6,7 +6,6 @@ import traceback
from datetime import datetime from datetime import datetime
import shutil import shutil
import time import time
import zipfile
import contextlib import contextlib
import glob import glob
from stat import S_IREAD, S_IWRITE from stat import S_IREAD, S_IWRITE
...@@ -611,7 +610,10 @@ class ProjectRepo(BaseRepo): ...@@ -611,7 +610,10 @@ class ProjectRepo(BaseRepo):
super().__init__(repository_path, search_parent_directories=search_parent_directories, *args, **kwargs) super().__init__(repository_path, search_parent_directories=search_parent_directories, *args, **kwargs)
with open(repository_path / "output_remotes.json", "r") as handle: with open(repository_path / "output_remotes.json", "r") as handle:
output_remotes = json.load(handle) try:
output_remotes = json.load(handle)
except FileNotFoundError:
raise RuntimeError(f"Folder {self.working_dir} does not appear to be a CADET-RDM repository.")
if output_folder is not None: if output_folder is not None:
print("Deprecation Warning. Setting the outputfolder manually during repo instantiation is deprecated" print("Deprecation Warning. Setting the outputfolder manually during repo instantiation is deprecated"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment