diff --git a/timesearch_modules/breakdown.py b/timesearch_modules/breakdown.py index 36a918d..471d9e5 100644 --- a/timesearch_modules/breakdown.py +++ b/timesearch_modules/breakdown.py @@ -94,7 +94,7 @@ def breakdown_argparse(args): breakdown_basename = breakdown_basename % database.filepath.replace_extension('').basename breakdown_filepath = database.breakdown_dir.with_child(breakdown_basename) - os.makedirs(breakdown_filepath.parent.absolute_path, exist_ok=True) + breakdown_filepath.parent.makedirs(exist_ok=True) breakdown_file = breakdown_filepath.open('w') with breakdown_file: breakdown_file.write(dump) diff --git a/timesearch_modules/get_styles.py b/timesearch_modules/get_styles.py index 810f594..3a8f0ab 100644 --- a/timesearch_modules/get_styles.py +++ b/timesearch_modules/get_styles.py @@ -12,7 +12,7 @@ def get_styles(subreddit): subreddit = common.r.subreddit(subreddit) styles = subreddit.stylesheet() - os.makedirs(database.styles_dir.absolute_path, exist_ok=True) + database.styles_dir.makedirs(exist_ok=True) stylesheet_filepath = database.styles_dir.with_child('stylesheet.css') print('Downloading %s' % stylesheet_filepath.relative_path) diff --git a/timesearch_modules/get_wiki.py b/timesearch_modules/get_wiki.py index 4c88455..dd90ea2 100644 --- a/timesearch_modules/get_wiki.py +++ b/timesearch_modules/get_wiki.py @@ -15,7 +15,7 @@ def get_wiki(subreddit): continue wikipage_path = database.wiki_dir.join(wikipage.name).replace_extension('md') - os.makedirs(wikipage_path.parent.absolute_path, exist_ok=True) + wikipage_path.parent.makedirs(exist_ok=True) with wikipage_path.open('w', encoding='utf-8') as handle: handle.write(wikipage.content_md) print('Wrote', wikipage_path.relative_path) diff --git a/timesearch_modules/index.py b/timesearch_modules/index.py index d63d424..49e7de6 100644 --- a/timesearch_modules/index.py +++ b/timesearch_modules/index.py @@ -108,7 +108,7 @@ def index_worker( statement = statement.format(threshold=score_threshold, order=orderby) cur.execute(statement) - os.makedirs(database.index_dir.absolute_path, exist_ok=True) + database.index_dir.makedirs(exist_ok=True) extension = '.html' if html else '.txt' mash_basename = database.filepath.replace_extension('').basename diff --git a/timesearch_modules/offline_reading.py b/timesearch_modules/offline_reading.py index 909d074..9f110b9 100644 --- a/timesearch_modules/offline_reading.py +++ b/timesearch_modules/offline_reading.py @@ -209,7 +209,7 @@ def html_from_database(database, specific_submission=None): submission_trees = trees_from_database(database, specific_submission) for submission_tree in submission_trees: page = html_from_tree(submission_tree, sort=lambda x: x.data.score * -1) - os.makedirs(database.offline_reading_dir.absolute_path, exist_ok=True) + database.offline_reading_dir.makedirs(exist_ok=True) html = '' diff --git a/timesearch_modules/tsdb.py b/timesearch_modules/tsdb.py index eb2022e..44a79a4 100644 --- a/timesearch_modules/tsdb.py +++ b/timesearch_modules/tsdb.py @@ -180,7 +180,7 @@ class TSDB: raise exceptions.DatabaseNotFound(self.filepath) print('New database', self.filepath.relative_path) - os.makedirs(self.filepath.parent.absolute_path, exist_ok=True) + self.filepath.parent.makedirs(exist_ok=True) self.breakdown_dir = self.filepath.parent.with_child('breakdown') self.offline_reading_dir = self.filepath.parent.with_child('offline_reading')