mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
195bcefaa1
commit
63e5dfd27b
@ -768,6 +768,7 @@ class AnkiWindow(QWidget):
|
||||
autoUpdateModel = globalconfig["ankiconnect"]["autoUpdateModel"]
|
||||
allowDuplicate = globalconfig["ankiconnect"]["allowDuplicate"]
|
||||
anki.global_port = globalconfig["ankiconnect"]["port"]
|
||||
anki.global_host = globalconfig["ankiconnect"]["host"]
|
||||
ModelName = globalconfig["ankiconnect"]["ModelName6"]
|
||||
try:
|
||||
DeckName = globalconfig["ankiconnect"]["DeckNameS"][
|
||||
|
@ -1,6 +1,7 @@
|
||||
import requests
|
||||
|
||||
global_port = 999
|
||||
global_host = "127.0.0.1"
|
||||
|
||||
|
||||
class AnkiException(Exception):
|
||||
@ -13,7 +14,7 @@ class AnkiModelExists(AnkiException):
|
||||
|
||||
def invoke(action, **params):
|
||||
response = requests.get(
|
||||
"http://127.0.0.1:{}".format(global_port),
|
||||
"http://{}:{}".format(global_host, global_port),
|
||||
json={"action": action, "params": params, "version": 6},
|
||||
).json()
|
||||
if len(response) != 2:
|
||||
|
@ -465,6 +465,7 @@
|
||||
"is_tracetime_strict": true,
|
||||
"jiamingcolor": "black",
|
||||
"ankiconnect": {
|
||||
"host": "127.0.0.1",
|
||||
"port": 8765,
|
||||
"DeckName_i": 0,
|
||||
"DeckNameS": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user