diff --git a/03-Export-Tags-Authors-Stories.py b/03-Export-Tags-Authors-Stories.py index d036adf..4604b78 100755 --- a/03-Export-Tags-Authors-Stories.py +++ b/03-Export-Tags-Authors-Stories.py @@ -22,7 +22,6 @@ def write_csv(data, filename, columns): fp.close() - if __name__ == "__main__": """ This step exports the Tag Wrangling and Authors with stories CSV files which you then have to import into Google diff --git a/automated_archive/aa.py b/automated_archive/aa.py index 06df23d..df451b4 100755 --- a/automated_archive/aa.py +++ b/automated_archive/aa.py @@ -133,7 +133,9 @@ def _create_mysql(args, FILES, log): cursor.execute("use {0}".format(DATABASE_NAME)) sql = Sql(args, log) - script_path = Path(__file__).parent.parent / "shared_python" / "create-open-doors-tables.sql" + script_path = ( + Path(__file__).parent.parent / "shared_python" / "create-open-doors-tables.sql" + ) sql.run_script_from_file(script_path, database=DATABASE_NAME) db.commit() diff --git a/shared_python/Chapters.py b/shared_python/Chapters.py index 10e2eff..7189dae 100755 --- a/shared_python/Chapters.py +++ b/shared_python/Chapters.py @@ -82,7 +82,7 @@ def _gather_and_dedupe(self, chapters_path, extensions, has_ids=False): # look up the author id and add that one to the file_names list sql_author_id = self.sql.execute_and_fetchall( self.sql.database, - "SELECT author_id FROM chapters WHERE id = {0}".format(cid) + "SELECT author_id FROM chapters WHERE id = {0}".format(cid), ) if len(sql_author_id) > 0: author_id = sql_author_id[0][0] diff --git a/shared_python/Sql.py b/shared_python/Sql.py index 5bf0100..31e140f 100755 --- a/shared_python/Sql.py +++ b/shared_python/Sql.py @@ -55,7 +55,9 @@ def execute_and_fetchall(self, database: str, statement: str): self.conn.commit() return cursor.fetchall() - def run_script_from_file(self, filename: Union[str, Path], database, initial_load=False): + def run_script_from_file( + self, filename: Union[str, Path], database, initial_load=False + ): # Open and read the file as a single buffer fd = open(filename, "r") sqlFile = fd.read() diff --git a/shared_python/Tags.py b/shared_python/Tags.py index 48b2724..11da9ed 100755 --- a/shared_python/Tags.py +++ b/shared_python/Tags.py @@ -93,9 +93,7 @@ def populate_tag_table( if isinstance( tag_col_lookup[col], str ): # Probably AA or a custom archive - cleaned_tag = ( - val.replace("'", "'").strip() - ) + cleaned_tag = val.replace("'", "'").strip() values.append( '({0}, "{1}", "{2}", "{3}")'.format(