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