nemo-annotation 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.3
2
+ Name: nemo-annotation
3
+ Version: 0.1.0
4
+ Summary: An annotation extension for Nemo.
5
+ Author: Flynn
6
+ Author-email: Flynn <leisure-zyf@qq.com>
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+
10
+ # Nemo Annotation
11
+
12
+ > An annotation extension for Nemo.
13
+
14
+ ## Installation
15
+
16
+ ```sh
17
+ pip install nemo_annotation
18
+ ```
19
+
20
+ ```sh
21
+ uv add nemo_annotation
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```sh
27
+ [uv run] python -m nemo_annotation install[uninstall]
28
+ nemo -q && nemo
29
+ ```
30
+
31
+ ## Current System Environment
32
+
33
+ | Item | Version / Path | Notes |
34
+ |------|---------------|-------|
35
+ | Distribution | Ubuntu (Mint 22 "Zena" family) | `nemo` version carries `+zena` |
36
+ | System Python | 3.12.3 | `/usr/bin/python3` |
37
+ | Nemo core | 6.6.3+zena | The file manager itself |
38
+ | nemo-python | 6.0.0+ds-1build3 | Python bindings, packaged by Ubuntu |
39
+ | nemo-python maintainer | Debian Cinnamon Team | Upstream is Linux Mint |
40
+ | nemo-python homepage | https://github.com/linuxmint/nemo-extensions/ | Source repository |
41
+
42
+ ## Dependencies
43
+
44
+ | Package | Version requirement | Purpose |
45
+ |---------|--------------------|---------|
46
+ | `gir1.2-nemo-3.0` | >= 4.6~ | GObject Introspection data for Nemo |
47
+ | `python3-gi` | — | System PyGObject (runtime) |
48
+ | `libnemo-extension1` | >= 4.6~ | Nemo extension C shared library |
49
+ | `libgtk-3-0t64` | >= 3.0.0 | GTK3 runtime |
50
+ | `libpython3.12t64` | >= 3.12.1 | Python 3.12 runtime |
51
+
52
+ ## Version Compatibility Check
53
+
54
+ | Check | Result | Conclusion |
55
+ |-------|--------|------------|
56
+ | Nemo core range required by `nemo-python` | `>= 4.6~` | 6.6.3 satisfies |
57
+ | Current Nemo core | 6.6.3 | Above minimum requirement |
58
+ | Documentation source | Installed with the `nemo-python 6.0.0` package | Matches the bindings |
59
+ | Documentation vs. runtime API | Core interfaces stable | Usable |
60
+
61
+ ## GTK-Doc Documentation Location
62
+
63
+ ```bash
64
+ /usr/share/gtk-doc/html/nemo-python/
65
+ ```
66
+
67
+ Covered classes:
68
+
69
+ - `class-nemo-python-column.html`
70
+ - `class-nemo-python-column-provider.html`
71
+ - `class-nemo-python-file-info.html`
72
+ - `class-nemo-python-info-provider.html`
73
+ - `class-nemo-python-location-widget-provider.html`
74
+ - `class-nemo-python-menu.html`
75
+ - `class-nemo-python-menu-item.html`
76
+ - `class-nemo-python-menu-provider.html`
77
+ - `class-nemo-python-property-page.html`
78
+ - `class-nemo-python-property-page-provider.html`
79
+ - `enum-nemo-python-operation-result.html`
80
+
81
+ ## Development Environment
82
+
83
+ | Item | Value |
84
+ |------|-------|
85
+ | Project directory | `~/桌面/nemo-meta/` |
86
+ | Virtual environment | `.venv` (managed by uv, based on system Python 3.12.3) |
87
+ | IDE type stubs | `pygobject-stubs` + custom `Nemo.pyi` |
88
+ | Extension install path | `~/.local/share/nemo-python/extensions/` |
89
+ | Debugging method | `TMPDIR=/tmp/testing nemo --no-desktop` |
90
+
91
+ ## Key Version Risks
92
+
93
+ | Risk | Notes |
94
+ |------|-------|
95
+ | `nemo-python` 6.0.0 vs `nemo` 6.6.3 | Bindings lag behind the core, but the dependency declaration is compatible |
96
+ | Multiple versions in between | 6.0 → 6.2 → 6.4 → 6.6; core extension interfaces (Provider) are stable |
97
+ | Want the latest API | Check the `.c` sources at the corresponding tag (e.g. 6.6.3) on GitHub |
98
+
99
+
100
+
101
+ ### Notes
102
+
103
+ - **`nemo-python` 6.0.0** is the version packaged in the Ubuntu repositories. Its dependency declaration `>= 4.6~` means it is compatible with Nemo core 4.6 and above; your 6.6.3 satisfies this.
104
+ - **The documentation version matches the bindings** — both come from the `nemo-python 6.0.0` package, so it is safe to use for generating `.pyi` stubs.
105
+ - **For the latest upstream source**, look on GitHub for the `6.6.3` tag or similar, since the system bindings lag behind the core.
@@ -0,0 +1,96 @@
1
+ # Nemo Annotation
2
+
3
+ > An annotation extension for Nemo.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ pip install nemo_annotation
9
+ ```
10
+
11
+ ```sh
12
+ uv add nemo_annotation
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```sh
18
+ [uv run] python -m nemo_annotation install[uninstall]
19
+ nemo -q && nemo
20
+ ```
21
+
22
+ ## Current System Environment
23
+
24
+ | Item | Version / Path | Notes |
25
+ |------|---------------|-------|
26
+ | Distribution | Ubuntu (Mint 22 "Zena" family) | `nemo` version carries `+zena` |
27
+ | System Python | 3.12.3 | `/usr/bin/python3` |
28
+ | Nemo core | 6.6.3+zena | The file manager itself |
29
+ | nemo-python | 6.0.0+ds-1build3 | Python bindings, packaged by Ubuntu |
30
+ | nemo-python maintainer | Debian Cinnamon Team | Upstream is Linux Mint |
31
+ | nemo-python homepage | https://github.com/linuxmint/nemo-extensions/ | Source repository |
32
+
33
+ ## Dependencies
34
+
35
+ | Package | Version requirement | Purpose |
36
+ |---------|--------------------|---------|
37
+ | `gir1.2-nemo-3.0` | >= 4.6~ | GObject Introspection data for Nemo |
38
+ | `python3-gi` | — | System PyGObject (runtime) |
39
+ | `libnemo-extension1` | >= 4.6~ | Nemo extension C shared library |
40
+ | `libgtk-3-0t64` | >= 3.0.0 | GTK3 runtime |
41
+ | `libpython3.12t64` | >= 3.12.1 | Python 3.12 runtime |
42
+
43
+ ## Version Compatibility Check
44
+
45
+ | Check | Result | Conclusion |
46
+ |-------|--------|------------|
47
+ | Nemo core range required by `nemo-python` | `>= 4.6~` | 6.6.3 satisfies |
48
+ | Current Nemo core | 6.6.3 | Above minimum requirement |
49
+ | Documentation source | Installed with the `nemo-python 6.0.0` package | Matches the bindings |
50
+ | Documentation vs. runtime API | Core interfaces stable | Usable |
51
+
52
+ ## GTK-Doc Documentation Location
53
+
54
+ ```bash
55
+ /usr/share/gtk-doc/html/nemo-python/
56
+ ```
57
+
58
+ Covered classes:
59
+
60
+ - `class-nemo-python-column.html`
61
+ - `class-nemo-python-column-provider.html`
62
+ - `class-nemo-python-file-info.html`
63
+ - `class-nemo-python-info-provider.html`
64
+ - `class-nemo-python-location-widget-provider.html`
65
+ - `class-nemo-python-menu.html`
66
+ - `class-nemo-python-menu-item.html`
67
+ - `class-nemo-python-menu-provider.html`
68
+ - `class-nemo-python-property-page.html`
69
+ - `class-nemo-python-property-page-provider.html`
70
+ - `enum-nemo-python-operation-result.html`
71
+
72
+ ## Development Environment
73
+
74
+ | Item | Value |
75
+ |------|-------|
76
+ | Project directory | `~/桌面/nemo-meta/` |
77
+ | Virtual environment | `.venv` (managed by uv, based on system Python 3.12.3) |
78
+ | IDE type stubs | `pygobject-stubs` + custom `Nemo.pyi` |
79
+ | Extension install path | `~/.local/share/nemo-python/extensions/` |
80
+ | Debugging method | `TMPDIR=/tmp/testing nemo --no-desktop` |
81
+
82
+ ## Key Version Risks
83
+
84
+ | Risk | Notes |
85
+ |------|-------|
86
+ | `nemo-python` 6.0.0 vs `nemo` 6.6.3 | Bindings lag behind the core, but the dependency declaration is compatible |
87
+ | Multiple versions in between | 6.0 → 6.2 → 6.4 → 6.6; core extension interfaces (Provider) are stable |
88
+ | Want the latest API | Check the `.c` sources at the corresponding tag (e.g. 6.6.3) on GitHub |
89
+
90
+
91
+
92
+ ### Notes
93
+
94
+ - **`nemo-python` 6.0.0** is the version packaged in the Ubuntu repositories. Its dependency declaration `>= 4.6~` means it is compatible with Nemo core 4.6 and above; your 6.6.3 satisfies this.
95
+ - **The documentation version matches the bindings** — both come from the `nemo-python 6.0.0` package, so it is safe to use for generating `.pyi` stubs.
96
+ - **For the latest upstream source**, look on GitHub for the `6.6.3` tag or similar, since the system bindings lag behind the core.
@@ -0,0 +1,20 @@
1
+ [project]
2
+ name = "nemo-annotation"
3
+ version = "0.1.0"
4
+ description = "An annotation extension for Nemo."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = []
8
+
9
+ [[project.authors]]
10
+ name = "Flynn"
11
+ email = "leisure-zyf@qq.com"
12
+
13
+ [project.scripts]
14
+ main = "nemo_annotation:main"
15
+ install = "nemo_annotation:install"
16
+ uninstall = "nemo_annotation:uninstall"
17
+
18
+ [build-system]
19
+ requires = ["uv_build>=0.12.5,<0.13.0"]
20
+ build-backend = "uv_build"
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "nemo-annotation"
3
+ version = "0.1.0"
4
+ description = "An annotation extension for Nemo."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Flynn", email = "leisure-zyf@qq.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ dependencies = []
11
+
12
+ [project.scripts]
13
+ main = "nemo_annotation:main"
14
+ install = "nemo_annotation:install"
15
+ uninstall = "nemo_annotation:uninstall"
16
+
17
+ [build-system]
18
+ requires = ["uv_build>=0.12.5,<0.13.0"]
19
+ build-backend = "uv_build"
@@ -0,0 +1,20 @@
1
+ import os
2
+ import subprocess
3
+ import sys
4
+ from datetime import datetime
5
+ from pathlib import Path
6
+
7
+ #
8
+ from .cli import install, uninstall
9
+
10
+
11
+ def main() -> None:
12
+ print("Hello from nemo-meta!")
13
+ print(os.getcwd())
14
+
15
+
16
+ def log(s):
17
+ print("[INFO]", datetime.now().strftime("%H:%M:%S"), f"[{__name__}]:", s)
18
+
19
+
20
+ log(f"{sys.executable}, v{sys.version}.")
@@ -0,0 +1,9 @@
1
+ import sys
2
+
3
+ from .cli import install, uninstall
4
+
5
+ if "install" in " ".join(sys.argv):
6
+ install()
7
+
8
+ if "uninstall" in " ".join(sys.argv):
9
+ uninstall()
@@ -0,0 +1,31 @@
1
+ import subprocess
2
+ from pathlib import Path
3
+
4
+ nemo_annotation = Path(__file__).parent
5
+
6
+ xx = [
7
+ [
8
+ nemo_annotation,
9
+ Path.home() / ".local/share/nemo-python/extensions/nemo_annotation",
10
+ ],
11
+ [
12
+ nemo_annotation / "main.py",
13
+ Path.home() / ".local/share/nemo-python/extensions/nemo_annotation_main.py",
14
+ ],
15
+ ]
16
+
17
+
18
+ def install() -> None:
19
+ uninstall()
20
+ print("Installing nemo-meta extension...")
21
+ for src, tgt in xx:
22
+ subprocess.run(f"ln -s {src} {tgt}", shell=True, check=True)
23
+ print(tgt.exists(), tgt.resolve())
24
+
25
+
26
+ def uninstall() -> None:
27
+ print("Uninstalling nemo-meta extension...")
28
+ for src, tgt in xx:
29
+ if tgt.parent == Path.home() / ".local/share/nemo-python/extensions":
30
+ tgt.unlink(missing_ok=True)
31
+ print(tgt.exists(), tgt.resolve())
@@ -0,0 +1,234 @@
1
+ import json
2
+ import urllib.parse
3
+ from datetime import datetime
4
+ from functools import lru_cache
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING
7
+
8
+ from nemo_annotation import log
9
+
10
+ if TYPE_CHECKING:
11
+ from nemo_annotation.types import GObject, Gtk, Nemo
12
+ else:
13
+ from gi.repository import GObject, Gtk, Nemo
14
+
15
+
16
+ META_FN = ".nemo_annotation.json"
17
+ NAMESPACE = "NemoPython::NemoMeta"
18
+
19
+ # 三个属性列的元数据:label 用于列表列标题,title/hint 用于属性页。
20
+ META_TAGS = {
21
+ "creation_data": {
22
+ "label": "WHEN",
23
+ "title": "创建时间",
24
+ "hint": "YYYY-MM-DD HH:MM",
25
+ },
26
+ "description": {
27
+ "label": "DESC",
28
+ "title": "描述",
29
+ "hint": "简要说明",
30
+ },
31
+ "from": {
32
+ "label": "FROM",
33
+ "title": "来源",
34
+ "hint": "来源 / 出处",
35
+ },
36
+ }
37
+
38
+
39
+ @lru_cache(maxsize=8)
40
+ def get_json(fn: str, mtime: float):
41
+ fp = Path(fn)
42
+ if fp.exists():
43
+ try:
44
+ data = json.loads(fp.read_text(encoding="utf-8"))
45
+ except (OSError, json.JSONDecodeError):
46
+ log(f"忽略无法解析的元数据文件: {fn}")
47
+ return {}
48
+ return data if isinstance(data, dict) else {}
49
+ else:
50
+ return {}
51
+
52
+
53
+ def local_path(file) -> Path | None:
54
+ """把 Nemo.FileInfo 还原成本地路径,非本地 URI 返回 None。"""
55
+ if file.get_uri_scheme() != "file":
56
+ return None
57
+ path = file.get_location().get_path()
58
+ if path is None:
59
+ uri = file.get_uri()
60
+ if not uri.startswith("file://"):
61
+ return None
62
+ path = urllib.parse.unquote(uri[7:])
63
+ return Path(path)
64
+
65
+
66
+ def read_meta(fp: Path) -> dict:
67
+ """读取文件所在目录的 .nemo_annotation.json 中该文件的记录。"""
68
+ fm = fp.parent / META_FN
69
+ data = get_json(fm.resolve().as_posix(), fm.stat().st_mtime) if fm.exists() else {}
70
+ entry = data.get(fp.name, {}) if isinstance(data, dict) else {}
71
+ # 返回副本,避免属性页修改到 lru_cache 里共享的对象
72
+ return dict(entry) if isinstance(entry, dict) else {}
73
+
74
+
75
+ def write_meta(fp: Path, values: dict) -> None:
76
+ """写入该文件的属性;空记录会被清掉,目录里其它文件的记录保持不变。"""
77
+ fm = fp.parent / META_FN
78
+ data = {}
79
+ if fm.exists():
80
+ try:
81
+ data = json.loads(fm.read_text(encoding="utf-8"))
82
+ except (OSError, json.JSONDecodeError):
83
+ data = {}
84
+ if not isinstance(data, dict):
85
+ data = {}
86
+
87
+ entry = {k: v for k, v in values.items() if v}
88
+ if entry:
89
+ data[fp.name] = entry
90
+ else:
91
+ data.pop(fp.name, None)
92
+
93
+ if data:
94
+ tmp = fm.with_name(fm.name + ".tmp")
95
+ tmp.write_text(
96
+ json.dumps(data, ensure_ascii=False, indent=2) + "\n", encoding="utf-8"
97
+ )
98
+ tmp.replace(fm)
99
+ else:
100
+ fm.unlink(missing_ok=True)
101
+ get_json.cache_clear()
102
+
103
+
104
+ class ColumnExtension(GObject.GObject, Nemo.ColumnProvider, Nemo.InfoProvider):
105
+ def __init__(self):
106
+ GObject.GObject.__init__(self)
107
+
108
+ def get_columns(self):
109
+ return [
110
+ Nemo.Column(
111
+ name=f"{NAMESPACE}::{k}",
112
+ attribute=k,
113
+ label=v["label"],
114
+ description=f"Get the {k}",
115
+ )
116
+ for k, v in META_TAGS.items()
117
+ ]
118
+
119
+ def update_file_info(self, file):
120
+ # trash://、smb://、mtp:// 等非本地 URI 直接跳过
121
+ fp = local_path(file)
122
+ if fp is None:
123
+ return
124
+
125
+ for k in META_TAGS:
126
+ file.add_string_attribute(k, "")
127
+
128
+ fm = fp.parent / META_FN
129
+ if fm.exists():
130
+ data: dict = get_json(fm.resolve().as_posix(), fm.stat().st_mtime)
131
+ log(fm)
132
+
133
+ for k, v in data.get(fp.name, {}).items():
134
+ file.add_string_attribute(k, v)
135
+ log(f"{k}: {v} ")
136
+
137
+
138
+ class MetaPropertyPage(GObject.GObject, Nemo.PropertyPageProvider):
139
+ """显示 / 创建 / 修改三个属性列的属性页。"""
140
+
141
+ def __init__(self):
142
+ GObject.GObject.__init__(self)
143
+
144
+ def get_property_pages(self, files):
145
+ if len(files) != 1:
146
+ return
147
+
148
+ file = files[0]
149
+ fp = local_path(file)
150
+ if fp is None:
151
+ return
152
+
153
+ meta = read_meta(fp)
154
+ editable = file.can_write()
155
+
156
+ # 尚无记录时,为 creation_data 预填当前时间,方便直接“创建”。
157
+ if not meta.get("creation_data"):
158
+ meta["creation_data"] = datetime.now().strftime("%Y-%m-%d %H:%M")
159
+
160
+ self.property_label = Gtk.Label("属性标注")
161
+ self.property_label.show()
162
+
163
+ page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12)
164
+ page.set_border_width(12)
165
+
166
+ header = Gtk.Label(xalign=0)
167
+ header.set_markup(f"<b>{GObject.markup_escape_text(fp.name)}</b>")
168
+ page.pack_start(header, False, False, 0)
169
+
170
+ grid = Gtk.Grid(column_spacing=12, row_spacing=8)
171
+ page.pack_start(grid, False, False, 0)
172
+
173
+ entries = {}
174
+ for row, (k, v) in enumerate(META_TAGS.items()):
175
+ label = Gtk.Label(xalign=0)
176
+ label.set_markup(f"{GObject.markup_escape_text(v['title'])} ({k})")
177
+ grid.attach(label, 0, row, 1, 1)
178
+
179
+ entry = Gtk.Entry()
180
+ entry.set_text(meta.get(k, "") or "")
181
+ entry.set_placeholder_text(v["hint"])
182
+ entry.set_hexpand(True)
183
+ entry.set_sensitive(editable)
184
+ grid.attach(entry, 1, row, 1, 1)
185
+ entries[k] = entry
186
+
187
+ if k == "creation_data":
188
+ now_btn = Gtk.Button(label="现在")
189
+ now_btn.set_tooltip_text("填入当前时间")
190
+ now_btn.set_sensitive(editable)
191
+ grid.attach(now_btn, 2, row, 1, 1)
192
+
193
+ def on_now(_btn, _entry=entry):
194
+ _entry.set_text(datetime.now().strftime("%Y-%m-%d %H:%M"))
195
+
196
+ now_btn.connect("clicked", on_now)
197
+
198
+ status = Gtk.Label(xalign=0)
199
+ page.pack_start(status, False, False, 0)
200
+
201
+ buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
202
+ buttons.set_halign(Gtk.Align.END)
203
+ page.pack_start(buttons, False, False, 0)
204
+
205
+ save_btn = Gtk.Button(label="保存")
206
+ save_btn.set_sensitive(editable)
207
+ buttons.pack_start(save_btn, False, False, 0)
208
+
209
+ def on_save(_btn=None):
210
+ values = {k: e.get_text().strip() for k, e in entries.items()}
211
+ try:
212
+ write_meta(fp, values)
213
+ except OSError as err:
214
+ status.set_text(f"保存失败:{err}")
215
+ return
216
+ # 让列视图重新读取属性
217
+ file.invalidate_extension_info()
218
+ status.set_text("已保存")
219
+
220
+ save_btn.connect("clicked", on_save)
221
+ for entry in entries.values():
222
+ entry.connect("activate", on_save)
223
+
224
+ page.show_all()
225
+ if not editable:
226
+ status.set_text("文件不可写,仅可查看")
227
+
228
+ return (
229
+ Nemo.PropertyPage(
230
+ name=NAMESPACE,
231
+ label=self.property_label,
232
+ page=page,
233
+ ),
234
+ )
@@ -0,0 +1,131 @@
1
+ """Type declarations for the ``gi.repository.Nemo`` API documented here."""
2
+
3
+ from collections.abc import Sequence
4
+ from enum import IntEnum
5
+ from typing import Any, Protocol
6
+
7
+ class GObject: ...
8
+
9
+ class Column:
10
+ name: str
11
+ attribute: str
12
+ label: str
13
+ description: str
14
+ xalign: float
15
+
16
+ def __init__(
17
+ self,
18
+ name: str,
19
+ attribute: str,
20
+ label: str,
21
+ description: str,
22
+ ) -> None: ...
23
+
24
+ class FileInfo(Protocol):
25
+ def is_gone(self) -> bool: ...
26
+ def get_file_type(self) -> Any: ...
27
+ def get_location(self) -> Any: ...
28
+ def get_name(self) -> str: ...
29
+ def get_uri(self) -> str: ...
30
+ def get_activation_uri(self) -> str: ...
31
+ def get_parent_info(self) -> FileInfo | None: ...
32
+ def get_parent_location(self) -> Any: ...
33
+ def get_parent_uri(self) -> str: ...
34
+ def get_mount(self) -> Any: ...
35
+ def get_uri_scheme(self) -> str: ...
36
+ def get_mime_type(self) -> str: ...
37
+ def is_mime_type(self, mimetype: str) -> bool: ...
38
+ def is_directory(self) -> bool: ...
39
+ def can_write(self) -> bool: ...
40
+ def add_emblem(self, emblem_name: str) -> None: ...
41
+ def get_string_attribute(self, attribute_name: str) -> str | None: ...
42
+ def add_string_attribute(self, attribute_name: str, value: str) -> None: ...
43
+ def invalidate_extension_info(self) -> None: ...
44
+
45
+ class Menu:
46
+ def __init__(self) -> None: ...
47
+ def append_item(self, item: MenuItem) -> None: ...
48
+ def get_items(self) -> list[MenuItem]: ...
49
+
50
+ class MenuItem:
51
+ name: str
52
+ label: str
53
+ tip: str
54
+ icon: str
55
+ menu: Menu | None
56
+ priority: bool
57
+ sensitive: bool
58
+
59
+ def __init__(
60
+ self,
61
+ name: str,
62
+ label: str,
63
+ tooltip: str,
64
+ icon: str,
65
+ ) -> None: ...
66
+ def activate(self) -> None: ...
67
+ def set_submenu(self, menu: Menu | None) -> None: ...
68
+
69
+ class PropertyPage:
70
+ name: str
71
+ label: Any
72
+ page: Any
73
+
74
+ def __init__(self, name: str, label: Any, page: Any) -> None: ...
75
+
76
+ class ColumnProvider(Protocol):
77
+ def get_columns(self) -> list[Column]: ...
78
+
79
+ class InfoProvider(Protocol):
80
+ def update_file_info(self, file: FileInfo) -> None: ...
81
+ def update_file_info_full(
82
+ self,
83
+ provider: InfoProvider,
84
+ handle: Any,
85
+ closure: Any,
86
+ file: FileInfo,
87
+ ) -> OperationResult | None: ...
88
+ def cancel_update(self, provider: InfoProvider, handle: Any) -> None: ...
89
+
90
+ class LocationWidgetProvider(Protocol):
91
+ def get_widget(self, uri: str, window: Any) -> Any: ...
92
+
93
+ class MenuProvider(Protocol):
94
+ def get_file_items(
95
+ self,
96
+ window: Any,
97
+ files: Sequence[FileInfo],
98
+ ) -> list[MenuItem]: ...
99
+ def get_file_items_full(
100
+ self,
101
+ provider: MenuProvider,
102
+ window: Any,
103
+ files: Sequence[FileInfo],
104
+ ) -> list[MenuItem]: ...
105
+ def get_background_items(
106
+ self,
107
+ window: Any,
108
+ folder: FileInfo,
109
+ ) -> list[MenuItem]: ...
110
+ def get_background_items_full(
111
+ self,
112
+ provider: MenuProvider,
113
+ window: Any,
114
+ folder: FileInfo,
115
+ ) -> list[MenuItem]: ...
116
+
117
+ class PropertyPageProvider(Protocol):
118
+ def get_pages(self, files: Sequence[FileInfo]) -> list[PropertyPage]: ...
119
+
120
+ class OperationResult(IntEnum):
121
+ COMPLETE = ...
122
+ IN_PROGRESS = ...
123
+ FAILED = ...
124
+
125
+ def info_provider_update_complete_invoke(
126
+ provider: InfoProvider,
127
+ handle: Any,
128
+ closure: Any,
129
+ result: OperationResult = OperationResult.COMPLETE,
130
+ ) -> None: ...
131
+ def menu_provider_emit_items_updated_signal(provider: MenuProvider) -> None: ...
@@ -0,0 +1,19 @@
1
+ class Nemo:
2
+ from .nemo import (
3
+ Column,
4
+ ColumnProvider,
5
+ FileInfo,
6
+ InfoProvider,
7
+ LocationWidgetProvider,
8
+ Menu,
9
+ MenuItem,
10
+ MenuProvider,
11
+ OperationResult,
12
+ PropertyPage,
13
+ PropertyPageProvider,
14
+ )
15
+
16
+ class GObject:
17
+ from .nemo import GObject
18
+
19
+ class Gtk:...