From 1191899dbbc665216049d9e1fc886d4d4a5b5c2e Mon Sep 17 00:00:00 2001 From: Andrew <47720952+andrewhong5297@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:06:56 -0500 Subject: [PATCH] text fix --- scripts/pull_from_dune.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/pull_from_dune.py b/scripts/pull_from_dune.py index 6d18ba2..9a241f0 100644 --- a/scripts/pull_from_dune.py +++ b/scripts/pull_from_dune.py @@ -36,23 +36,23 @@ print('UPDATE: existing query file: {}'.format(found_files[0])) with open(file_path, 'r+', encoding='utf-8') as file: #if "query repo:" is in the file, then don't add the text header again - if '-- already part of a query repo' in query.sql: + if '-- part of a query repo' in query.sql: file.write(query.sql) else: - file.write(f'-- already part of a query repo\n-- query name: {query.base.name}\n-- query link: https://dune.com/queries/{query.base.query_id}\n\n\n{query.sql}') + file.write(f'-- part of a query repo\n-- query name: {query.base.name}\n-- query link: https://dune.com/queries/{query.base.query_id}\n\n\n{query.sql}') else: # Create new file and directories if they don't exist new_file = f'{query.base.name.replace(" ", "_").lower()[:30]}___{query.base.query_id}.sql' file_path = os.path.join(os.path.dirname(__file__), '..', 'queries', new_file) os.makedirs(os.path.dirname(file_path), exist_ok=True) - if '-- already part of a query repo' in query.sql: - print('WARNING!!! This query is already part of a query repo') + if '-- part of a query repo' in query.sql: + print('WARNING!!! This query is part of a query repo') with open(file_path, 'w', encoding='utf-8') as file: file.write(f'-- WARNING: this query may be part of multiple repos\n{query.sql}') else: with open(file_path, 'w', encoding='utf-8') as file: - file.write(f'-- already part of a query repo\n-- query name: {query.base.name}\n-- query link: https://dune.com/queries/{query.base.query_id}\n\n\n{query.sql}') + file.write(f'-- part of a query repo\n-- query name: {query.base.name}\n-- query link: https://dune.com/queries/{query.base.query_id}\n\n\n{query.sql}') print('CREATE: new query file: {}'.format(new_file))