diff --git a/bricklayer/__version__.py b/bricklayer/__version__.py index 9d1ffab..6820f36 100644 --- a/bricklayer/__version__.py +++ b/bricklayer/__version__.py @@ -1 +1 @@ -__version__ = '0.0.9' +__version__ = '0.0.10' diff --git a/bricklayer/api/__init__.py b/bricklayer/api/__init__.py index 08db29b..603ad3e 100644 --- a/bricklayer/api/__init__.py +++ b/bricklayer/api/__init__.py @@ -161,10 +161,9 @@ def mkdir(self, dir_path): ) ) - def backup_notebook(self, source_path, target_path, fmt="DBC"): + def backup_notebook(self, source_path, target_path, tmp_dir, fmt="DBC"): "Backup a notebook to another place in the workspace" - tmp_dir = '/dbfs/tmp/' - tmp_name = 'backup' + tmp_name = f'backup_{random.randint(0,1000)}' intermediate_location = pathlib.Path(tmp_dir).joinpath(tmp_name) self.export_notebook(source_path, intermediate_location.as_posix(), fmt) try: @@ -172,7 +171,7 @@ def backup_notebook(self, source_path, target_path, fmt="DBC"): finally: intermediate_location.unlink() - def export_current_notebook_run(self, target_path, fmt="DBC"): + def export_current_notebook_run(self, target_path, tmp_dir, fmt="DBC"): """Save the current notebook to a given location in the required format (default DBC) and preserving the path and timestamp. Formats allowed: @@ -189,7 +188,7 @@ def export_current_notebook_run(self, target_path, fmt="DBC"): .joinpath(timestamp) ) try: - self.backup_notebook(current_path, target_path.as_posix(), fmt) + self.backup_notebook(current_path, target_path.as_posix(), tmp_dir, fmt) except requests.exceptions.HTTPError as _e: error_code = _e.response.json()['error_code'] if error_code == 'RESOURCE_DOES_NOT_EXIST': diff --git a/examples/wiki1.png b/examples/wiki1.png new file mode 100644 index 0000000..b65ea89 Binary files /dev/null and b/examples/wiki1.png differ diff --git a/examples/wiki2.png b/examples/wiki2.png new file mode 100644 index 0000000..ad7ea16 Binary files /dev/null and b/examples/wiki2.png differ