Repository navigation
Expand file tree
/
Copy path_compat.py
More file actions
58 lines (44 loc) · 1.54 KB
/
Copy path_compat.py
File metadata and controls
58 lines (44 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from __future__ import annotations
from types import SimpleNamespace
try:
import sublime # type: ignore
import sublime_plugin # type: ignore
except ImportError: # pragma: no cover - used outside Sublime Text.
class _Settings(dict):
def get(self, key, default=None):
return super().get(key, default)
def set(self, key, value):
self[key] = value
def erase(self, key):
self.pop(key, None)
class _QuickPanelItem:
__slots__ = ["trigger", "details", "annotation", "kind"]
def __init__(self, trigger, details="", annotation="", kind=(0, "", "")):
self.trigger = trigger
self.details = details
self.annotation = annotation
self.kind = kind
class _SublimeModule(SimpleNamespace):
OP_EQUAL = 0
OP_NOT_EQUAL = 1
KEEP_OPEN_ON_FOCUS_LOST = 0
MONOSPACE_FONT = 0
KIND_ID_COLOR_ORANGISH = 10
KIND_AMBIGUOUS = (0, "", "")
QuickPanelItem = _QuickPanelItem
def set_timeout(self, callback, timeout=0):
callback()
def set_timeout_async(self, callback, timeout=0):
callback()
def active_window(self):
return None
class _CommandBase:
def __init__(self, window=None):
self.window = window
class _EventListener:
pass
sublime = _SublimeModule(Settings=_Settings)
sublime_plugin = SimpleNamespace(
WindowCommand=_CommandBase,
EventListener=_EventListener,
)