2019-02-05 04:59:03 +01:00
|
|
|
# Copyright: Ankitects Pty Ltd and contributors
|
2018-12-14 11:32:53 +01:00
|
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2020-12-18 10:55:52 +01:00
|
|
|
# pylint: disable=import-error,unused-import
|
|
|
|
|
|
|
|
"""
|
2018-12-14 11:32:53 +01:00
|
|
|
# this file is imported as part of the bundling process to ensure certain
|
|
|
|
# modules are included in the distribution
|
|
|
|
|
2020-12-18 10:55:52 +01:00
|
|
|
isort:skip_file
|
|
|
|
"""
|
2019-03-04 02:22:40 +01:00
|
|
|
|
2019-12-20 10:19:03 +01:00
|
|
|
# included implicitly in the past, and relied upon by some add-ons
|
|
|
|
import cgi
|
|
|
|
import decimal
|
2020-11-18 04:22:51 +01:00
|
|
|
import gettext
|
2019-12-23 01:31:47 +01:00
|
|
|
|
2019-12-20 10:19:03 +01:00
|
|
|
# useful for add-ons
|
|
|
|
import logging
|
|
|
|
import logging.config
|
|
|
|
import logging.handlers
|
2019-12-23 01:31:47 +01:00
|
|
|
|
2018-12-14 11:32:53 +01:00
|
|
|
# required by requests library
|
|
|
|
import queue
|
2019-12-20 10:19:03 +01:00
|
|
|
import typing
|
|
|
|
import uuid
|
|
|
|
|
2020-12-18 10:55:52 +01:00
|
|
|
# other modules we require that may not be automatically included
|
2021-10-05 02:17:56 +02:00
|
|
|
try:
|
|
|
|
import PyQt6.QtSvg # type: ignore
|
|
|
|
import PyQt6.QtMultimedia # type: ignore
|
|
|
|
except:
|
|
|
|
import PyQt5.QtSvg # type: ignore
|
|
|
|
import PyQt5.QtMultimedia # type: ignore
|
2020-05-08 09:29:09 +02:00
|
|
|
import socks
|
2018-12-14 11:32:53 +01:00
|
|
|
|
2020-06-08 03:12:51 +02:00
|
|
|
# legacy compat
|
|
|
|
import anki.storage
|
|
|
|
import anki.sync
|
2021-02-07 23:48:42 +01:00
|
|
|
import anki.rsbackend
|
2020-12-18 10:55:52 +01:00
|
|
|
|
|
|
|
# platform-specifics
|
2021-11-25 00:06:16 +01:00
|
|
|
from anki.utils import is_lin, is_mac, is_win
|
2018-12-14 11:32:53 +01:00
|
|
|
|
2021-11-25 00:06:16 +01:00
|
|
|
if is_win:
|
2020-11-06 03:01:37 +01:00
|
|
|
# external module access
|
2018-12-14 11:32:53 +01:00
|
|
|
import pythoncom
|
|
|
|
import pywintypes
|
2020-08-31 04:05:36 +02:00
|
|
|
import win32com
|
2020-02-19 10:14:14 +01:00
|
|
|
|
2021-11-25 00:06:16 +01:00
|
|
|
if is_lin:
|
2020-11-06 03:01:37 +01:00
|
|
|
# file locking
|
2020-02-19 10:14:14 +01:00
|
|
|
import fcntl
|