Use pathclass.Path.makedirs.

This commit is contained in:
voussoir 2020-09-24 14:17:44 -07:00
parent eec72db4fd
commit 38c7226ec2

View file

@ -325,7 +325,7 @@ class YCDLDBVideoMixin:
extension = self.config['queuefile_extension'] extension = self.config['queuefile_extension']
download_directory = pathclass.Path(download_directory) download_directory = pathclass.Path(download_directory)
os.makedirs(download_directory.absolute_path, exist_ok=True) download_directory.makedirs(exist_ok=True)
queuefile = download_directory.with_child(video_id).replace_extension(extension) queuefile = download_directory.with_child(video_id).replace_extension(extension)
queuefile.touch() queuefile.touch()
@ -491,7 +491,7 @@ class YCDLDB(
msg = f'"{self.database_filepath.absolute_path}" does not exist and create is off.' msg = f'"{self.database_filepath.absolute_path}" does not exist and create is off.'
raise FileNotFoundError(msg) raise FileNotFoundError(msg)
os.makedirs(self.data_directory.absolute_path, exist_ok=True) self.data_directory.makedirs(exist_ok=True)
self.sql = sqlite3.connect(self.database_filepath.absolute_path) self.sql = sqlite3.connect(self.database_filepath.absolute_path)
if existing_database: if existing_database: