txl_editors 0.2.12__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.
txl_editors/__init__.py CHANGED
@@ -1 +0,0 @@
1
- __version__ = "0.2.12"
@@ -1,10 +1,11 @@
1
1
  from pathlib import Path
2
2
  from typing import Callable, Dict, List
3
3
 
4
- from asphalt.core import Component, Context
4
+ from anyio import create_task_group
5
+ from fps import Module
5
6
  from textual.containers import Container
6
7
 
7
- from txl.base import Editor, Editors, FileOpenEvent, Footer, Header, MainArea
8
+ from txl.base import Editor, Editors, Footer, Header, MainArea
8
9
 
9
10
 
10
11
  class EditorsMeta(type(Editors), type(Container)):
@@ -36,8 +37,8 @@ class _Editors(Editors, Container, metaclass=EditorsMeta):
36
37
  self.ext_editor_factories[ext] = []
37
38
  self.ext_editor_factories[ext].append(editor_factory)
38
39
 
39
- async def on_open(self, event: FileOpenEvent) -> None:
40
- path = Path(event.path)
40
+ async def on_open(self, path: str) -> None:
41
+ path = Path(path)
41
42
  extension = path.suffix
42
43
  for ext, editor_factories in self.ext_editor_factories.items():
43
44
  if ext == extension:
@@ -56,13 +57,10 @@ class _Editors(Editors, Container, metaclass=EditorsMeta):
56
57
  preferred_editor.refresh(layout=True)
57
58
 
58
59
 
59
- class EditorsComponent(Component):
60
- async def start(
61
- self,
62
- ctx: Context,
63
- ) -> None:
64
- header = await ctx.request_resource(Header)
65
- footer = await ctx.request_resource(Footer)
66
- main_area = await ctx.request_resource(MainArea)
60
+ class EditorsModule(Module):
61
+ async def start(self) -> None:
62
+ header = await self.get(Header)
63
+ footer = await self.get(Footer)
64
+ main_area = await self.get(MainArea)
67
65
  editors = _Editors(header, footer, main_area)
68
- ctx.add_resource(editors, types=Editors)
66
+ self.put(editors, Editors)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: txl_editors
3
- Version: 0.2.12
3
+ Version: 0.3.0
4
4
  Summary: TXL plugin for editors
5
5
  Project-URL: Source, https://github.com/davidbrochart/jpterm/plugins/editors
6
6
  Author-email: David Brochart <david.brochart@gmail.com>
@@ -11,10 +11,11 @@ Classifier: Programming Language :: Python
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Classifier: Programming Language :: Python :: Implementation :: CPython
15
16
  Classifier: Programming Language :: Python :: Implementation :: PyPy
16
17
  Requires-Python: >=3.10
17
- Requires-Dist: txl
18
+ Requires-Dist: txl<0.3.0,>=0.2.18
18
19
  Description-Content-Type: text/markdown
19
20
 
20
21
  # TXL plugin for editors
@@ -0,0 +1,7 @@
1
+ txl_editors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ txl_editors/main.py,sha256=L7uyHhushNyG8ynH6-166EFxRGLqU85qtegfCMimBLc,2259
3
+ txl_editors-0.3.0.dist-info/METADATA,sha256=55gj_RmBKtiDwz_koVLhpgUXxSnScSo1BDBcPlolM7I,825
4
+ txl_editors-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ txl_editors-0.3.0.dist-info/entry_points.txt,sha256=fUyNHjwvxZqXcULvZ7ZkxWTFQPgiWF-jiAhF6Rux1-c,111
6
+ txl_editors-0.3.0.dist-info/licenses/LICENSE.txt,sha256=su0IgzSHZ9tMFeCQ_IaCji5Q4VrZSOqDsEFi7lPduc8,1106
7
+ txl_editors-0.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.24.2
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,5 @@
1
+ [fps.modules]
2
+ editors = txl_editors.main:EditorsModule
3
+
4
+ [txl.modules]
5
+ editors = txl_editors.main:EditorsModule
@@ -1,7 +0,0 @@
1
- txl_editors/__init__.py,sha256=X4KG3FscE5AhbGbcdDDgdDC550CVpxNMwdNLcx6EQ7M,23
2
- txl_editors/components.py,sha256=5r1rOTNjpf1xMRTZ2AkSM0Fr8ybioHS2k115ABhdXIA,2369
3
- txl_editors-0.2.12.dist-info/METADATA,sha256=qtewfvE7CKrSelOFDdKYHfbUeU7p09L9yq3hs2Mu4ZQ,760
4
- txl_editors-0.2.12.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
5
- txl_editors-0.2.12.dist-info/entry_points.txt,sha256=UvxxaMEkojEIZCocyfQi0jGqVHafyG80PUKtIKaFX18,139
6
- txl_editors-0.2.12.dist-info/licenses/LICENSE.txt,sha256=su0IgzSHZ9tMFeCQ_IaCji5Q4VrZSOqDsEFi7lPduc8,1106
7
- txl_editors-0.2.12.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- [asphalt.components]
2
- editors = txl_editors.components:EditorsComponent
3
-
4
- [txl.components]
5
- editors = txl_editors.components:EditorsComponent