From 537c4daa94427023b0b9e1916f9cc41acc890ca7 Mon Sep 17 00:00:00 2001 From: flan Date: Mon, 24 Dec 2018 16:36:09 +0100 Subject: [PATCH] Make potential future instances of #8 easier to debug With hostNum prepended to the address, the client won't even be able to connect and will return an error message with the invalid address. Example: requests.exceptions.InvalidSchema: No connection adapters were found for '6http://localhost:27701/sync/meta' --- README.md | 2 +- addon/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87cd94e..1b5bb78 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ create a file named `__init__.py` containing the code below and put it in import anki.sync, anki.hooks, aqt addr = "http://127.0.0.1:27701/" # put your server address here - anki.sync.SYNC_BASE = addr + "%s" + anki.sync.SYNC_BASE = "%s" + addr def resetHostNum(): aqt.mw.pm.profile['hostNum'] = None anki.hooks.addHook("profileLoaded", resetHostNum) diff --git a/addon/__init__.py b/addon/__init__.py index ecdba7b..33706dc 100644 --- a/addon/__init__.py +++ b/addon/__init__.py @@ -56,7 +56,7 @@ def updateui(self, state): def setserver(): aqt.mw.pm.profile['hostNum'] = None - anki.sync.SYNC_BASE = config['addr'] + "%s" + anki.sync.SYNC_BASE = "%s" + config['addr'] addHook("profileLoaded", setserver) aqt.preferences.Preferences.__init__ = wrap(aqt.preferences.Preferences.__init__, addui, "after")