2020-05-22 12:02:10 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
2021-03-11 05:33:57 +01:00
|
|
|
|
2020-11-01 05:26:58 +01:00
|
|
|
import os
|
2020-05-22 12:02:10 +02:00
|
|
|
import re
|
2020-11-01 05:26:58 +01:00
|
|
|
import sys
|
2020-05-22 12:02:10 +02:00
|
|
|
|
2021-03-11 05:33:57 +01:00
|
|
|
import google.protobuf.descriptor
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
|
|
|
|
import anki.backend_pb2
|
|
|
|
import anki.i18n_pb2
|
2021-07-10 11:52:31 +02:00
|
|
|
import anki.cards_pb2
|
|
|
|
import anki.collection_pb2
|
2021-07-10 12:44:22 +02:00
|
|
|
import anki.decks_pb2
|
|
|
|
import anki.deckconfig_pb2
|
2021-07-22 10:07:13 +02:00
|
|
|
import anki.links_pb2
|
2021-07-10 12:44:22 +02:00
|
|
|
import anki.notes_pb2
|
|
|
|
import anki.notetypes_pb2
|
2021-07-10 13:33:12 +02:00
|
|
|
import anki.scheduler_pb2
|
|
|
|
import anki.sync_pb2
|
2021-07-11 11:35:18 +02:00
|
|
|
import anki.config_pb2
|
2021-07-10 13:33:12 +02:00
|
|
|
import anki.search_pb2
|
2021-07-10 13:58:34 +02:00
|
|
|
import anki.stats_pb2
|
|
|
|
import anki.card_rendering_pb2
|
|
|
|
import anki.tags_pb2
|
|
|
|
import anki.media_pb2
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
|
2020-11-17 10:23:06 +01:00
|
|
|
import stringcase
|
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
TYPE_DOUBLE = 1
|
|
|
|
TYPE_FLOAT = 2
|
|
|
|
TYPE_INT64 = 3
|
|
|
|
TYPE_UINT64 = 4
|
|
|
|
TYPE_INT32 = 5
|
|
|
|
TYPE_FIXED64 = 6
|
|
|
|
TYPE_FIXED32 = 7
|
|
|
|
TYPE_BOOL = 8
|
|
|
|
TYPE_STRING = 9
|
|
|
|
TYPE_GROUP = 10
|
|
|
|
TYPE_MESSAGE = 11
|
|
|
|
TYPE_BYTES = 12
|
|
|
|
TYPE_UINT32 = 13
|
|
|
|
TYPE_ENUM = 14
|
|
|
|
TYPE_SFIXED32 = 15
|
|
|
|
TYPE_SFIXED64 = 16
|
|
|
|
TYPE_SINT32 = 17
|
|
|
|
TYPE_SINT64 = 18
|
|
|
|
|
|
|
|
LABEL_OPTIONAL = 1
|
|
|
|
LABEL_REQUIRED = 2
|
|
|
|
LABEL_REPEATED = 3
|
|
|
|
|
2022-01-21 12:32:39 +01:00
|
|
|
RAW_ONLY = {"TranslateString"}
|
2020-05-24 00:36:50 +02:00
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
|
|
|
|
def python_type(field):
|
|
|
|
type = python_type_inner(field)
|
|
|
|
if field.label == LABEL_REPEATED:
|
2020-05-22 13:25:25 +02:00
|
|
|
type = f"Sequence[{type}]"
|
2020-05-22 12:02:10 +02:00
|
|
|
return type
|
|
|
|
|
|
|
|
|
|
|
|
def python_type_inner(field):
|
|
|
|
type = field.type
|
|
|
|
if type == TYPE_BOOL:
|
|
|
|
return "bool"
|
|
|
|
elif type in (1, 2):
|
|
|
|
return "float"
|
|
|
|
elif type in (3, 4, 5, 6, 7, 13, 15, 16, 17, 18):
|
|
|
|
return "int"
|
|
|
|
elif type == TYPE_STRING:
|
|
|
|
return "str"
|
|
|
|
elif type == TYPE_BYTES:
|
|
|
|
return "bytes"
|
2020-05-23 12:43:55 +02:00
|
|
|
elif type == TYPE_MESSAGE:
|
2020-05-24 00:36:50 +02:00
|
|
|
return fullname(field.message_type.full_name)
|
2020-05-23 12:43:55 +02:00
|
|
|
elif type == TYPE_ENUM:
|
2021-02-03 04:31:46 +01:00
|
|
|
return fullname(field.enum_type.full_name) + ".V"
|
2020-05-22 12:02:10 +02:00
|
|
|
else:
|
|
|
|
raise Exception(f"unknown type: {type}")
|
|
|
|
|
|
|
|
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
def fullname(fullname: str) -> str:
|
|
|
|
# eg anki.generic.Empty -> anki.generic_pb2.Empty
|
|
|
|
components = fullname.split(".")
|
|
|
|
components[1] += "_pb2"
|
|
|
|
return ".".join(components)
|
2020-05-24 00:36:50 +02:00
|
|
|
|
|
|
|
|
2020-05-23 04:58:13 +02:00
|
|
|
# get_deck_i_d -> get_deck_id etc
|
|
|
|
def fix_snakecase(name):
|
|
|
|
for fix in "a_v", "i_d":
|
|
|
|
name = re.sub(
|
2022-02-25 06:26:06 +01:00
|
|
|
rf"(\w)({fix})(\w)",
|
2020-05-23 04:58:13 +02:00
|
|
|
lambda m: m.group(1) + m.group(2).replace("_", "") + m.group(3),
|
|
|
|
name,
|
|
|
|
)
|
|
|
|
return name
|
|
|
|
|
|
|
|
|
2022-01-21 12:32:39 +01:00
|
|
|
def get_input_args(input_type):
|
|
|
|
fields = sorted(input_type.fields, key=lambda x: x.number)
|
2020-05-24 01:05:48 +02:00
|
|
|
self_star = ["self"]
|
|
|
|
if len(fields) >= 2:
|
|
|
|
self_star.append("*")
|
|
|
|
return ", ".join(self_star + [f"{f.name}: {python_type(f)}" for f in fields])
|
2020-05-22 12:02:10 +02:00
|
|
|
|
|
|
|
|
2022-01-21 12:32:39 +01:00
|
|
|
def get_input_assign(input_type):
|
|
|
|
fields = sorted(input_type.fields, key=lambda x: x.number)
|
2020-05-22 12:02:10 +02:00
|
|
|
return ", ".join(f"{f.name}={f.name}" for f in fields)
|
|
|
|
|
|
|
|
|
2021-03-11 05:33:57 +01:00
|
|
|
def render_method(service_idx, method_idx, method):
|
2022-01-21 12:32:39 +01:00
|
|
|
name = fix_snakecase(stringcase.snakecase(method.name))
|
2020-05-23 08:19:48 +02:00
|
|
|
input_name = method.input_type.name
|
2022-01-21 12:32:39 +01:00
|
|
|
|
2020-05-24 00:36:50 +02:00
|
|
|
if (
|
2022-01-21 12:32:39 +01:00
|
|
|
input_name.endswith("Request") or len(method.input_type.fields) < 2
|
|
|
|
) and not method.input_type.oneofs:
|
|
|
|
input_params = get_input_args(method.input_type)
|
|
|
|
input_assign_full = f"message = {fullname(method.input_type.full_name)}({get_input_assign(method.input_type)})"
|
2020-05-23 08:19:48 +02:00
|
|
|
else:
|
2022-01-21 12:32:39 +01:00
|
|
|
input_params = f"self, message: {fullname(method.input_type.full_name)}"
|
|
|
|
input_assign_full = ""
|
|
|
|
|
2020-06-02 05:23:01 +02:00
|
|
|
if (
|
|
|
|
len(method.output_type.fields) == 1
|
|
|
|
and method.output_type.fields[0].type != TYPE_ENUM
|
|
|
|
):
|
2020-05-22 12:02:10 +02:00
|
|
|
# unwrap single return arg
|
|
|
|
f = method.output_type.fields[0]
|
|
|
|
return_type = python_type(f)
|
2022-01-21 12:32:39 +01:00
|
|
|
single_attribute = f".{f.name}"
|
2020-05-22 12:02:10 +02:00
|
|
|
else:
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
return_type = fullname(method.output_type.full_name)
|
2022-01-21 12:32:39 +01:00
|
|
|
single_attribute = ""
|
2020-06-22 05:33:53 +02:00
|
|
|
|
|
|
|
buf = f"""\
|
2022-01-21 12:32:39 +01:00
|
|
|
def {name}_raw(self, message: bytes) -> bytes:
|
|
|
|
return self._run_command({service_idx}, {method_idx}, message)
|
2020-06-22 05:33:53 +02:00
|
|
|
|
|
|
|
"""
|
2022-01-21 12:32:39 +01:00
|
|
|
|
|
|
|
if not method.name in RAW_ONLY:
|
|
|
|
buf += f"""\
|
|
|
|
def {name}({input_params}) -> {return_type}:
|
|
|
|
{input_assign_full}
|
|
|
|
raw_bytes = self._run_command({service_idx}, {method_idx}, message.SerializeToString())
|
|
|
|
output = {fullname(method.output_type.full_name)}()
|
|
|
|
output.ParseFromString(raw_bytes)
|
|
|
|
return output{single_attribute}
|
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
"""
|
|
|
|
|
2020-06-22 05:33:53 +02:00
|
|
|
return buf
|
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
|
|
|
|
out = []
|
2021-03-11 05:33:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
def render_service(
|
|
|
|
service: google.protobuf.descriptor.ServiceDescriptor, service_index: int
|
|
|
|
) -> None:
|
|
|
|
for method_index, method in enumerate(service.methods):
|
|
|
|
out.append(render_method(service_index, method_index, method))
|
|
|
|
|
|
|
|
|
2021-07-10 11:52:31 +02:00
|
|
|
service_modules = dict(
|
|
|
|
I18N=anki.i18n_pb2,
|
|
|
|
COLLECTION=anki.collection_pb2,
|
|
|
|
CARDS=anki.cards_pb2,
|
2021-07-10 12:44:22 +02:00
|
|
|
NOTES=anki.notes_pb2,
|
|
|
|
DECKS=anki.decks_pb2,
|
|
|
|
DECK_CONFIG=anki.deckconfig_pb2,
|
|
|
|
NOTETYPES=anki.notetypes_pb2,
|
2021-07-10 13:33:12 +02:00
|
|
|
SCHEDULER=anki.scheduler_pb2,
|
|
|
|
SYNC=anki.sync_pb2,
|
2021-07-11 11:35:18 +02:00
|
|
|
CONFIG=anki.config_pb2,
|
2021-07-10 13:33:12 +02:00
|
|
|
SEARCH=anki.search_pb2,
|
2021-07-10 13:58:34 +02:00
|
|
|
STATS=anki.stats_pb2,
|
|
|
|
CARD_RENDERING=anki.card_rendering_pb2,
|
|
|
|
TAGS=anki.tags_pb2,
|
|
|
|
MEDIA=anki.media_pb2,
|
2021-07-22 10:07:13 +02:00
|
|
|
LINKS=anki.links_pb2,
|
2021-07-10 11:52:31 +02:00
|
|
|
)
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
|
|
|
|
for service in anki.backend_pb2.ServiceIndex.DESCRIPTOR.values:
|
2021-03-11 05:33:57 +01:00
|
|
|
# SERVICE_INDEX_TEST -> _TESTSERVICE
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
base = service.name.replace("SERVICE_INDEX_", "")
|
2021-07-10 13:58:34 +02:00
|
|
|
service_pkg = service_modules.get(base)
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
service_var = "_" + base.replace("_", "") + "SERVICE"
|
2021-07-10 11:52:31 +02:00
|
|
|
service_obj = getattr(service_pkg, service_var)
|
2021-03-11 05:33:57 +01:00
|
|
|
service_index = service.number
|
|
|
|
render_service(service_obj, service_index)
|
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
|
|
|
|
out = "\n".join(out)
|
|
|
|
|
|
|
|
|
2021-03-11 05:33:57 +01:00
|
|
|
open(sys.argv[1], "wb").write(
|
2020-11-01 05:26:58 +01:00
|
|
|
(
|
|
|
|
'''# Copyright: Ankitects Pty Ltd and contributors
|
2020-05-24 12:34:17 +02:00
|
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
# pylint: skip-file
|
2020-05-22 12:02:10 +02:00
|
|
|
|
2020-05-27 01:14:02 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2020-05-24 12:34:17 +02:00
|
|
|
"""
|
|
|
|
THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT.
|
2020-05-22 12:02:10 +02:00
|
|
|
|
2020-05-24 12:34:17 +02:00
|
|
|
Please do not access methods on the backend directly - they may be changed
|
|
|
|
or removed at any time. Instead, please use the methods on the collection
|
|
|
|
instead. Eg, don't use col.backend.all_deck_config(), instead use
|
|
|
|
col.decks.all_config()
|
|
|
|
"""
|
2022-01-21 12:32:39 +01:00
|
|
|
|
2020-05-24 12:34:17 +02:00
|
|
|
from typing import *
|
|
|
|
|
refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:
- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.
The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.
The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.
Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 09:50:18 +02:00
|
|
|
import anki
|
2021-07-11 06:51:25 +02:00
|
|
|
import anki.backend_pb2
|
|
|
|
import anki.i18n_pb2
|
|
|
|
import anki.cards_pb2
|
|
|
|
import anki.collection_pb2
|
|
|
|
import anki.decks_pb2
|
|
|
|
import anki.deckconfig_pb2
|
2021-07-22 10:07:13 +02:00
|
|
|
import anki.links_pb2
|
2021-07-11 06:51:25 +02:00
|
|
|
import anki.notes_pb2
|
|
|
|
import anki.notetypes_pb2
|
|
|
|
import anki.scheduler_pb2
|
|
|
|
import anki.sync_pb2
|
2021-07-11 11:35:18 +02:00
|
|
|
import anki.config_pb2
|
2021-07-11 06:51:25 +02:00
|
|
|
import anki.search_pb2
|
|
|
|
import anki.stats_pb2
|
|
|
|
import anki.card_rendering_pb2
|
|
|
|
import anki.tags_pb2
|
|
|
|
import anki.media_pb2
|
2020-05-24 12:34:17 +02:00
|
|
|
|
|
|
|
class RustBackendGenerated:
|
2021-03-11 05:33:57 +01:00
|
|
|
def _run_command(self, service: int, method: int, input: Any) -> bytes:
|
2020-05-24 12:34:17 +02:00
|
|
|
raise Exception("not implemented")
|
|
|
|
|
|
|
|
'''
|
2020-11-01 05:26:58 +01:00
|
|
|
+ out
|
|
|
|
).encode("utf8")
|
|
|
|
)
|