From 31e65ecb0b40ff8c6a336d95f7e5b54e90626032 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Mar 2025 14:13:08 +0000 Subject: [PATCH 1/4] Add helpful message when NOTE_TAKING_SYSTEM is not configured MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds clear instructions to users when the note taking system setting is using its default unconfigured value. The message explains how to configure the setting and what values are supported. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- gonotego/uploader/runner.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gonotego/uploader/runner.py b/gonotego/uploader/runner.py index 5ba92239..f9495ecc 100644 --- a/gonotego/uploader/runner.py +++ b/gonotego/uploader/runner.py @@ -40,6 +40,14 @@ def main(): print('Starting uploader.') note_events_queue = interprocess.get_note_events_queue() note_taking_system = settings.get('NOTE_TAKING_SYSTEM').lower() + + # Check if note taking system is still using the default unconfigured value + if note_taking_system == '' or note_taking_system == '': + print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") + print("Supported systems: email, ideaflow, remnote, roam, mem, notion, twitter") + print("Example: ':set NOTE_TAKING_SYSTEM roam'") + return + try: uploader = make_uploader(note_taking_system) except ValueError as e: @@ -56,6 +64,14 @@ def main(): note_taking_system_setting = settings.get('NOTE_TAKING_SYSTEM').lower() if note_taking_system_setting != note_taking_system: note_taking_system = note_taking_system_setting + + # Check if note taking system is using the default unconfigured value after a change + if note_taking_system == '' or note_taking_system == '': + print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") + print("Supported systems: email, ideaflow, remnote, roam, mem, notion, twitter") + print("Example: ':set NOTE_TAKING_SYSTEM roam'") + continue + uploader = make_uploader(note_taking_system) note_event_bytes_list = [] From e790c0209d8f25b7c24e55657b98a23a65479f67 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Mar 2025 22:51:13 +0000 Subject: [PATCH 2/4] Refactor to make NOTE_TAKING_SYSTEM configuration check more DRY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extract repeated code into helper functions - Create SUPPORTED_SYSTEMS list for better maintainability - Add print_configuration_help() and is_unconfigured() helper functions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- gonotego/uploader/runner.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/gonotego/uploader/runner.py b/gonotego/uploader/runner.py index f9495ecc..97e2317e 100644 --- a/gonotego/uploader/runner.py +++ b/gonotego/uploader/runner.py @@ -16,6 +16,19 @@ Status = status.Status +# List of supported note taking systems +SUPPORTED_SYSTEMS = ['email', 'ideaflow', 'remnote', 'roam', 'mem', 'notion', 'twitter'] + +def print_configuration_help(): + """Print helpful message when NOTE_TAKING_SYSTEM is not configured.""" + print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") + print(f"Supported systems: {', '.join(SUPPORTED_SYSTEMS)}") + print("Example: ':set NOTE_TAKING_SYSTEM roam'") + + +def is_unconfigured(note_taking_system): + """Check if the note taking system is unconfigured.""" + return note_taking_system == '' or note_taking_system == '' def make_uploader(note_taking_system): if note_taking_system == 'email': @@ -42,10 +55,8 @@ def main(): note_taking_system = settings.get('NOTE_TAKING_SYSTEM').lower() # Check if note taking system is still using the default unconfigured value - if note_taking_system == '' or note_taking_system == '': - print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") - print("Supported systems: email, ideaflow, remnote, roam, mem, notion, twitter") - print("Example: ':set NOTE_TAKING_SYSTEM roam'") + if is_unconfigured(note_taking_system): + print_configuration_help() return try: @@ -66,10 +77,8 @@ def main(): note_taking_system = note_taking_system_setting # Check if note taking system is using the default unconfigured value after a change - if note_taking_system == '' or note_taking_system == '': - print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") - print("Supported systems: email, ideaflow, remnote, roam, mem, notion, twitter") - print("Example: ':set NOTE_TAKING_SYSTEM roam'") + if is_unconfigured(note_taking_system): + print_configuration_help() continue uploader = make_uploader(note_taking_system) From ad191179052042b17e948720d49c86555ceebc44 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Mar 2025 22:53:21 +0000 Subject: [PATCH 3/4] Remove hardcoded list of supported systems from uploader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the message simple by removing the hardcoded list of supported note taking systems. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- gonotego/uploader/runner.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gonotego/uploader/runner.py b/gonotego/uploader/runner.py index 97e2317e..a2204540 100644 --- a/gonotego/uploader/runner.py +++ b/gonotego/uploader/runner.py @@ -16,13 +16,9 @@ Status = status.Status -# List of supported note taking systems -SUPPORTED_SYSTEMS = ['email', 'ideaflow', 'remnote', 'roam', 'mem', 'notion', 'twitter'] - def print_configuration_help(): """Print helpful message when NOTE_TAKING_SYSTEM is not configured.""" print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") - print(f"Supported systems: {', '.join(SUPPORTED_SYSTEMS)}") print("Example: ':set NOTE_TAKING_SYSTEM roam'") From 694c9271a87efe6d6df803d054a893f1e114f4a8 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Sun, 9 Mar 2025 18:55:17 -0400 Subject: [PATCH 4/4] Fix style --- gonotego/uploader/runner.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gonotego/uploader/runner.py b/gonotego/uploader/runner.py index a2204540..e9a029cb 100644 --- a/gonotego/uploader/runner.py +++ b/gonotego/uploader/runner.py @@ -16,16 +16,18 @@ Status = status.Status + def print_configuration_help(): - """Print helpful message when NOTE_TAKING_SYSTEM is not configured.""" - print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") - print("Example: ':set NOTE_TAKING_SYSTEM roam'") + """Print helpful message when NOTE_TAKING_SYSTEM is not configured.""" + print("NOTE_TAKING_SYSTEM is not configured. Please set it using ':set NOTE_TAKING_SYSTEM [system]'") + print("Example: ':set NOTE_TAKING_SYSTEM roam'") def is_unconfigured(note_taking_system): """Check if the note taking system is unconfigured.""" return note_taking_system == '' or note_taking_system == '' + def make_uploader(note_taking_system): if note_taking_system == 'email': return email_uploader.Uploader()