Skip to content

Commit

Permalink
Ensure spool directory exists by automatically creating it
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jun 20, 2021
1 parent c289f97 commit a6e1aa5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -21,6 +21,7 @@ in progress
order to find out about its usage.
- Improve documentation
- Add ``CHANGES.rst``
- Ensure spool directory exists by automatically creating it


2019-10-10 0.0.0
Expand Down
3 changes: 3 additions & 0 deletions saraswati/cli.py
Expand Up @@ -135,6 +135,9 @@ def record(channels: List[Channel], chunk_duration: int, chunk_max_files: int, s
# Create settings container.
settings = SaraswatiSettings(channels=None, chunk_duration=chunk_duration, chunk_max_files=chunk_max_files)

# Ensure spool directory exists.
settings.spool_path.mkdir(exist_ok=True)

# Create recorder.
recorder = SaraswatiRecorder(settings=settings)

Expand Down
2 changes: 0 additions & 2 deletions saraswati/model.py
Expand Up @@ -34,8 +34,6 @@ def __post_init__(self):
if self.spool_path is None:
from saraswati import __appname__
self.spool_path = Path(user_data_dir(__appname__, "hiveeyes")) / "spool"
if not self.spool_path.exists():
raise FileNotFoundError(f"Spool directory '{self.spool_path}' does not exist")


@dataclass
Expand Down

0 comments on commit a6e1aa5

Please sign in to comment.