From 0beea54bf7624bb5cec8360e9a289b53f04de237 Mon Sep 17 00:00:00 2001 From: Charles Kiene Date: Mon, 27 Feb 2023 15:12:52 -0800 Subject: [PATCH] Changed delimiter to _ from . --- taguette-export_tags_to_csv.py | 7 ++++++- taguette-update_tags_from_sheet.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/taguette-export_tags_to_csv.py b/taguette-export_tags_to_csv.py index 7ba5a91..53a5c48 100755 --- a/taguette-export_tags_to_csv.py +++ b/taguette-export_tags_to_csv.py @@ -11,11 +11,16 @@ config.read('.taguette_gdocs') project_id = int(config['General']['taguette_project_id']) taguette_database_file = config['General']['taguette_database_file'] + ## connect to sqlite3 con = sqlite3.connect(taguette_database_file) cur = con.cursor() +# Run this if you just want tags and no highlights sql_stmt_get = "SELECT id, path, description FROM tags WHERE project_id = ?" + +# Run this if you want tags AND highlights +#sql_stmt_get = "SELECT tags.id, tags.path, tags.description, highlights.snippet FROM highlight_tags INNER JOIN tags ON highlight_tags.tag_id = tags.id INNER JOIN highlights ON highlight_tags.highlight_id = highlights.id WHERE project_id = ?" cur.execute(sql_stmt_get, (project_id,)) while True: @@ -25,7 +30,7 @@ while True: tag_id, path, description = row - m = re.match(r'^(.+)\.(.*)$', path) + m = re.match(r'^(.+)\_(.*)$', path) if m: axial = m.group(1) tag = m.group(2) diff --git a/taguette-update_tags_from_sheet.py b/taguette-update_tags_from_sheet.py index 9a19b40..3f550c2 100755 --- a/taguette-update_tags_from_sheet.py +++ b/taguette-update_tags_from_sheet.py @@ -47,7 +47,7 @@ for row in DictReader(csv_text.splitlines(), delimiter=","): old_description = tag_info[0][2] if row['Axial Codes']: - newname = row['Axial Codes'].lower() + "." + new_name.lower() + newname = row['Axial Codes'].lower() + "_" + new_name.lower() else: newname = new_name.lower() -- 2.39.2