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'
This commit is contained in:
parent
61b4582364
commit
537c4daa94
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user