Skip to content

Commit

Permalink
chore: fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoeggy committed May 27, 2024
1 parent 4a08b7e commit b02e293
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion 03-Export-Tags-Authors-Stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion automated_archive/aa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion shared_python/Chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 3 additions & 1 deletion shared_python/Sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions shared_python/Tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b02e293

Please sign in to comment.