+33
-43
lines changedFilter options
+33
-43
lines changed Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
1
1
# -*- coding: utf-8 -*-
2
2
import subprocess
3
3
import os
4
-
import sys
5
4
import tempfile
6
5
from threading import Thread
7
6
@@ -14,11 +13,10 @@
14
13
from .gtk_helpers import CenterLabel, GObjectABCMeta, g_abstractproperty
15
14
16
15
17
-
if sys.version_info.minor >= 5:
18
-
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
19
-
if TYPE_CHECKING:
20
-
# pylint: disable=ungrouped-imports
21
-
from typing import Dict # noqa
16
+
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
17
+
if TYPE_CHECKING:
18
+
# pylint: disable=ungrouped-imports
19
+
from typing import Dict # noqa
22
20
23
21
24
22
class ExportConfig(CommonOomoxConfig):
Original file line number Diff line number Diff line change
@@ -18,13 +18,11 @@ def ls_r(path):
18
18
19
19
20
20
def get_plugin_module(name, path, submodule=None):
21
-
if sys.version_info.minor >= 5:
22
-
spec = importlib.util.spec_from_file_location(name, path) # pylint: disable=no-member
23
-
module = importlib.util.module_from_spec(spec) # pylint: disable=no-member
24
-
spec.loader.exec_module(module)
25
-
else:
26
-
loader = importlib.machinery.SourceFileLoader(name, path)
27
-
module = loader.load_module() # pylint: disable=deprecated-method,no-value-for-parameter
21
+
if sys.version_info.minor < 5:
22
+
raise RuntimeError('Python 3.5+ is required')
23
+
spec = importlib.util.spec_from_file_location(name, path) # pylint: disable=no-member
24
+
module = importlib.util.module_from_spec(spec) # pylint: disable=no-member
25
+
spec.loader.exec_module(module)
28
26
if submodule:
29
27
return getattr(module, submodule)
30
28
return module
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
1
1
import os
2
-
import sys
3
2
from abc import ABCMeta, abstractmethod
4
3
from enum import Enum
5
4
6
5
from .config import FALLBACK_COLOR, USER_COLORS_DIR
7
6
8
7
9
-
if sys.version_info.minor >= 5:
10
-
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
11
-
if TYPE_CHECKING:
12
-
# pylint: disable=ungrouped-imports
13
-
from typing import List, Dict, Any, Iterable, Optional, Union, Callable # noqa
14
-
from mypy_extensions import TypedDict # noqa # pylint: disable=import-error
8
+
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
9
+
if TYPE_CHECKING:
10
+
# pylint: disable=ungrouped-imports
11
+
from typing import List, Dict, Any, Iterable, Optional, Union, Callable # noqa
12
+
from mypy_extensions import TypedDict # noqa # pylint: disable=import-error
15
13
16
-
from .export_common import ExportDialog # noqa
17
-
from .preview import ThemePreview # noqa
18
-
from .preview_icons import IconThemePreview # noqa
14
+
from .export_common import ExportDialog # noqa
15
+
from .preview import ThemePreview # noqa
16
+
from .preview_icons import IconThemePreview # noqa
19
17
20
-
from .theme_model import ThemeModelValue # noqa
21
-
ColorScheme = Dict[str, Union[str, bool, int, float]]
22
-
AboutLink = TypedDict('AboutLink', {'name': str, 'url': str})
18
+
from .theme_model import ThemeModelValue # noqa
19
+
ColorScheme = Dict[str, Union[str, bool, int, float]]
20
+
AboutLink = TypedDict('AboutLink', {'name': str, 'url': str})
23
21
24
22
25
23
PLUGIN_PATH_PREFIX = "__plugin__"
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
1
-
import sys
2
1
import os
3
2
import json
4
3
5
4
from .i18n import _
6
5
from .config import USER_CONFIG_DIR, DEFAULT_ENCODING
7
6
8
7
9
-
if sys.version_info.minor >= 5:
10
-
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
11
-
if TYPE_CHECKING:
12
-
# pylint: disable=ungrouped-imports
13
-
from typing import Dict # noqa
8
+
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
9
+
if TYPE_CHECKING:
10
+
# pylint: disable=ungrouped-imports
11
+
from typing import Dict # noqa
14
12
15
13
16
14
class CommonOomoxConfig:
Original file line number Diff line number Diff line change
@@ -12,11 +12,10 @@
12
12
)
13
13
14
14
15
-
if sys.version_info.minor >= 5:
16
-
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
17
-
if TYPE_CHECKING:
18
-
# pylint: disable=ungrouped-imports
19
-
from typing import Dict # noqa
15
+
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
16
+
if TYPE_CHECKING:
17
+
# pylint: disable=ungrouped-imports
18
+
from typing import Dict # noqa
20
19
21
20
22
21
RED = 0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1
-
import sys
1
+
# pylint: disable=invalid-name
2
2
import os
3
3
4
4
from .config import TERMINAL_TEMPLATE_DIR
@@ -8,11 +8,10 @@
8
8
from .i18n import _
9
9
10
10
11
-
if sys.version_info.minor >= 5:
12
-
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
13
-
if TYPE_CHECKING:
14
-
# pylint: disable=ungrouped-imports
15
-
from typing import List, Dict, Any # noqa
11
+
from typing import TYPE_CHECKING # pylint: disable=wrong-import-order
12
+
if TYPE_CHECKING:
13
+
# pylint: disable=ungrouped-imports
14
+
from typing import List, Dict, Any # noqa
16
15
17
16
ThemeModelValue = Dict[str, Any]
18
17
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4