omdev 0.0.0.dev456__py3-none-any.whl → 0.0.0.dev458__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.
@@ -157,33 +157,6 @@
157
157
  }
158
158
  }
159
159
  },
160
- {
161
- "module": ".ptk.apps.ncdu",
162
- "attr": "_CLI_MODULE",
163
- "file": "omdev/ptk/apps/ncdu.py",
164
- "line": 162,
165
- "value": {
166
- "!.cli.types.CliModule": {
167
- "name": "ptk/ncdu",
168
- "module": "omdev.ptk.apps.ncdu"
169
- }
170
- }
171
- },
172
- {
173
- "module": ".ptk.markdown.__main__",
174
- "attr": "_CLI_MODULE",
175
- "file": "omdev/ptk/markdown/__main__.py",
176
- "line": 4,
177
- "value": {
178
- "!.cli.types.CliModule": {
179
- "name": [
180
- "ptk/markdown",
181
- "ptk/md"
182
- ],
183
- "module": "omdev.ptk.markdown.__main__"
184
- }
185
- }
186
- },
187
160
  {
188
161
  "module": ".py.attrdocs",
189
162
  "attr": "_CLI_MODULE",
@@ -561,5 +534,20 @@
561
534
  "module": "omdev.tools.sqlrepl"
562
535
  }
563
536
  }
537
+ },
538
+ {
539
+ "module": ".tui.apps.markdown.__main__",
540
+ "attr": "_CLI_MODULE",
541
+ "file": "omdev/tui/apps/markdown/__main__.py",
542
+ "line": 4,
543
+ "value": {
544
+ "!.cli.types.CliModule": {
545
+ "name": [
546
+ "tui/markdown",
547
+ "tui/md"
548
+ ],
549
+ "module": "omdev.tui.apps.markdown.__main__"
550
+ }
551
+ }
564
552
  }
565
553
  ]
omdev/__about__.py CHANGED
@@ -38,13 +38,14 @@ class Project(ProjectBase):
38
38
  'gprof2dot ~= 2025.4',
39
39
  ],
40
40
 
41
- 'ptk': [
42
- 'prompt-toolkit ~= 3.0',
43
- ],
44
-
45
41
  'qr': [
46
42
  'segno ~= 1.6',
47
43
  ],
44
+
45
+ 'tui': [
46
+ 'rich ~= 14.1',
47
+ 'textual ~= 6.2',
48
+ ],
48
49
  }
49
50
 
50
51
  entry_points = {
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ from ....cli import CliModule
2
+
3
+
4
+ # @omlish-manifest
5
+ _CLI_MODULE = CliModule(['tui/markdown', 'tui/md'], __name__)
6
+
7
+
8
+ if __name__ == '__main__':
9
+ from .cli import _main
10
+
11
+ _main()
@@ -1,9 +1,8 @@
1
1
  import argparse
2
2
  import sys
3
3
 
4
- from ... import ptk
5
- from .markdown import Markdown
6
- from .styles import MARKDOWN_STYLE
4
+ import rich.console
5
+ import rich.markdown
7
6
 
8
7
 
9
8
  ##
@@ -20,10 +19,10 @@ def _main() -> None:
20
19
  else:
21
20
  src = sys.stdin.read()
22
21
 
23
- ptk.print_formatted_text(
24
- Markdown(src),
25
- style=ptk.Style(list(MARKDOWN_STYLE)),
26
- )
22
+ console = rich.console.Console()
23
+ markdown = rich.markdown.Markdown(src)
24
+ console.print(markdown)
25
+ print()
27
26
 
28
27
 
29
28
  if __name__ == '__main__':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omdev
3
- Version: 0.0.0.dev456
3
+ Version: 0.0.0.dev458
4
4
  Summary: omdev
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Python: >=3.13
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omlish==0.0.0.dev456
17
+ Requires-Dist: omlish==0.0.0.dev458
18
18
  Provides-Extra: all
19
19
  Requires-Dist: black~=25.9; extra == "all"
20
20
  Requires-Dist: pycparser~=2.23; extra == "all"
@@ -25,8 +25,9 @@ Requires-Dist: mdit-py-plugins~=0.5; extra == "all"
25
25
  Requires-Dist: pygments~=2.19; extra == "all"
26
26
  Requires-Dist: mypy~=1.18; extra == "all"
27
27
  Requires-Dist: gprof2dot~=2025.4; extra == "all"
28
- Requires-Dist: prompt-toolkit~=3.0; extra == "all"
29
28
  Requires-Dist: segno~=1.6; extra == "all"
29
+ Requires-Dist: rich~=14.1; extra == "all"
30
+ Requires-Dist: textual~=6.2; extra == "all"
30
31
  Provides-Extra: black
31
32
  Requires-Dist: black~=25.9; extra == "black"
32
33
  Provides-Extra: c
@@ -41,10 +42,11 @@ Provides-Extra: mypy
41
42
  Requires-Dist: mypy~=1.18; extra == "mypy"
42
43
  Provides-Extra: prof
43
44
  Requires-Dist: gprof2dot~=2025.4; extra == "prof"
44
- Provides-Extra: ptk
45
- Requires-Dist: prompt-toolkit~=3.0; extra == "ptk"
46
45
  Provides-Extra: qr
47
46
  Requires-Dist: segno~=1.6; extra == "qr"
47
+ Provides-Extra: tui
48
+ Requires-Dist: rich~=14.1; extra == "tui"
49
+ Requires-Dist: textual~=6.2; extra == "tui"
48
50
  Dynamic: license-file
49
51
 
50
52
  # Overview
@@ -1,5 +1,5 @@
1
- omdev/.omlish-manifests.json,sha256=ex2KVBEIjVkqBI_gpH-HcSDohNuDC3rhaY6eFCPzM_8,11909
2
- omdev/__about__.py,sha256=pot8uNAp4CaTEc-t9HxzgTaWvig6fG7C4ZC1ucj21MA,1202
1
+ omdev/.omlish-manifests.json,sha256=YqhbZs4Wr3L9DAwcFfhTs8Zw8W8MxPLaxYXp2aqbyzQ,11671
2
+ omdev/__about__.py,sha256=cyDSrqIUOuSGA9RZt7oDd7w7HXKgZ0GyDpI0QfvKT7I,1223
3
3
  omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  omdev/cmake.py,sha256=gu49t10_syXh_TUJs4POsxeFs8we8Y3XTOOPgIXmGvg,4608
5
5
  omdev/imgur.py,sha256=oqei705LhSnLWQTOMHMHwRecRXcpSEP90Sg4SVINPQ0,3133
@@ -225,20 +225,6 @@ omdev/precheck/main.py,sha256=hbCouy3Lh1hFmQxktQz-_-LhlT3fnXXFoJhzT_rKX9M,4445
225
225
  omdev/precheck/manifests.py,sha256=dxl7GSJHKjQrR6mbwvj6j92XDGHOpxxEEQ6smJkBEe4,810
226
226
  omdev/precheck/scripts.py,sha256=6nb_lDgyX7u9kdF_BU6ubY01q_jGk96VH9q9gpOieng,1753
227
227
  omdev/precheck/unicode.py,sha256=vMxGb4Kqg1NhFlw1kbgsPtXOnswjREH0ZPZExrrTwCU,3260
228
- omdev/ptk/__init__.py,sha256=SFL-S3E8Qov4SZEOl8txwEZc5gln1lGLc1mr7t7zD6U,5248
229
- omdev/ptk/prompts.py,sha256=gOemzNe_5h4entcqk6N_14gyJi46gDqMGck7cahkEY8,1855
230
- omdev/ptk/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
231
- omdev/ptk/apps/ncdu.py,sha256=KTbAgwhzcROOvq20VGN92UwMWcgkMMVOeFfpjZAsKUk,4561
232
- omdev/ptk/markdown/LICENSE,sha256=oSmc9j-n23wTJUO0TbY8sIHrf9pFZUovFWfDL7D53IA,1489
233
- omdev/ptk/markdown/__init__.py,sha256=Mj0KTyzdGVhkp79QoUiS6iJjnDz8c9chygcbVIgm1do,222
234
- omdev/ptk/markdown/__main__.py,sha256=zaZuKy3-llEztkpoIAIzvspOyCsTJQI33ZuadvSHJKM,181
235
- omdev/ptk/markdown/border.py,sha256=4gWpwTimurgJ_MjE-UKMCDMb4DnVcgFPfXutObQWOxk,1726
236
- omdev/ptk/markdown/cli.py,sha256=FlV12qpyVWgpfeOzyFg9DlgLkss3rgCet_Jebs6_Xqo,537
237
- omdev/ptk/markdown/markdown.py,sha256=wRxCWSV2u71NP_MTi8A8vVLjZ1TmmaWUZMnvW468Ejc,12368
238
- omdev/ptk/markdown/parser.py,sha256=UppwouvAYh3qzQMKL-BjcyqBIl2KHcocXlWiKFZ7cBA,990
239
- omdev/ptk/markdown/styles.py,sha256=lc17zooXhff5_2tkqLsCmdq2b_rfSAehmHVR-8Lo2qk,777
240
- omdev/ptk/markdown/tags.py,sha256=6wF9lbqbpf_WCxEJ_tJP_QtaDCcQKCKYS1CMzHTQg2U,7020
241
- omdev/ptk/markdown/utils.py,sha256=lApIIK_n9dgLaC9mHKJf8O8VPrYRHO9qjFON_mqXv1Y,10513
242
228
  omdev/py/__init__.py,sha256=u7tLEfRTnPVtWPmKK_ZIvnFkZwTe1q44UQ53cvsix3k,41
243
229
  omdev/py/attrdocs.py,sha256=kIVgOD8Apsw9hgaqAk6nsMsFD30cCMRAPRTG8qMPmR4,5174
244
230
  omdev/py/bracepy.py,sha256=tcZaljRkSsFYMewb1FULHet5HxV6GGqgbmLhlIGqdCw,2742
@@ -324,9 +310,14 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
324
310
  omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
325
311
  omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
326
312
  omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
327
- omdev-0.0.0.dev456.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
328
- omdev-0.0.0.dev456.dist-info/METADATA,sha256=Lhp2ofoTfq4gPbhXMs8Au7vYaj2ZUjmmi6n0a1WNd74,5100
329
- omdev-0.0.0.dev456.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
330
- omdev-0.0.0.dev456.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
331
- omdev-0.0.0.dev456.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
332
- omdev-0.0.0.dev456.dist-info/RECORD,,
313
+ omdev/tui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
314
+ omdev/tui/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
315
+ omdev/tui/apps/markdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
316
+ omdev/tui/apps/markdown/__main__.py,sha256=Xy-G2-8Ymx8QMBbRzA4LoiAMZqvtC944mMjFEWd69CA,182
317
+ omdev/tui/apps/markdown/cli.py,sha256=ubm4UsMbkAvwsjxbQ82kxo1ku4657YLMQ1NVXv0DuRo,506
318
+ omdev-0.0.0.dev458.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
319
+ omdev-0.0.0.dev458.dist-info/METADATA,sha256=KV1MXJ5lnXtSpSK2U4_DLmD827p7n6lsvHfTMYLsAVw,5170
320
+ omdev-0.0.0.dev458.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
321
+ omdev-0.0.0.dev458.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
322
+ omdev-0.0.0.dev458.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
323
+ omdev-0.0.0.dev458.dist-info/RECORD,,
omdev/ptk/__init__.py DELETED
@@ -1,104 +0,0 @@
1
- # ruff: noqa: F401
2
- # flake8: noqa: F401
3
-
4
- from prompt_toolkit.application import Application
5
- from prompt_toolkit.application import get_app
6
- from prompt_toolkit.application import get_app_session
7
- from prompt_toolkit.application import run_in_terminal
8
- from prompt_toolkit.buffer import Buffer
9
- from prompt_toolkit.completion import CompleteEvent
10
- from prompt_toolkit.completion import Completer
11
- from prompt_toolkit.completion import Completion
12
- from prompt_toolkit.completion import PathCompleter
13
- from prompt_toolkit.completion import WordCompleter
14
- from prompt_toolkit.document import Document
15
- from prompt_toolkit.enums import EditingMode
16
- from prompt_toolkit.eventloop.utils import call_soon_threadsafe
17
- from prompt_toolkit.filters import Condition
18
- from prompt_toolkit.filters import has_arg
19
- from prompt_toolkit.filters import has_focus
20
- from prompt_toolkit.filters import is_searching
21
- from prompt_toolkit.filters import to_filter
22
- from prompt_toolkit.filters import vi_insert_mode
23
- from prompt_toolkit.filters import vi_navigation_mode
24
- from prompt_toolkit.formatted_text import ANSI
25
- from prompt_toolkit.formatted_text import HTML
26
- from prompt_toolkit.formatted_text import AnyFormattedText
27
- from prompt_toolkit.formatted_text import FormattedText
28
- from prompt_toolkit.formatted_text import OneStyleAndTextTuple
29
- from prompt_toolkit.formatted_text import StyleAndTextTuples
30
- from prompt_toolkit.formatted_text import fragment_list_to_text
31
- from prompt_toolkit.formatted_text import fragment_list_width
32
- from prompt_toolkit.formatted_text import split_lines
33
- from prompt_toolkit.formatted_text import to_formatted_text
34
- from prompt_toolkit.formatted_text import to_plain_text
35
- from prompt_toolkit.history import FileHistory
36
- from prompt_toolkit.input import DummyInput
37
- from prompt_toolkit.input import Input
38
- from prompt_toolkit.input import create_input
39
- from prompt_toolkit.key_binding import KeyBindings
40
- from prompt_toolkit.key_binding import KeyPress
41
- from prompt_toolkit.key_binding import KeyPressEvent
42
- from prompt_toolkit.key_binding import vi_state
43
- from prompt_toolkit.keys import Keys
44
- from prompt_toolkit.layout import Container
45
- from prompt_toolkit.layout.containers import ColorColumn
46
- from prompt_toolkit.layout.containers import ConditionalContainer
47
- from prompt_toolkit.layout.containers import Float
48
- from prompt_toolkit.layout.containers import FloatContainer
49
- from prompt_toolkit.layout.containers import HSplit
50
- from prompt_toolkit.layout.containers import ScrollOffsets
51
- from prompt_toolkit.layout.containers import VSplit
52
- from prompt_toolkit.layout.containers import Window
53
- from prompt_toolkit.layout.containers import WindowAlign
54
- from prompt_toolkit.layout.controls import BufferControl
55
- from prompt_toolkit.layout.controls import FormattedTextControl
56
- from prompt_toolkit.layout.dimension import D
57
- from prompt_toolkit.layout.dimension import Dimension
58
- from prompt_toolkit.layout.layout import Layout
59
- from prompt_toolkit.layout.margins import ConditionalMargin
60
- from prompt_toolkit.layout.margins import NumberedMargin
61
- from prompt_toolkit.layout.menus import CompletionsMenu
62
- from prompt_toolkit.layout.processors import BeforeInput
63
- from prompt_toolkit.layout.processors import ConditionalProcessor
64
- from prompt_toolkit.layout.processors import DisplayMultipleCursors
65
- from prompt_toolkit.layout.processors import HighlightIncrementalSearchProcessor
66
- from prompt_toolkit.layout.processors import HighlightMatchingBracketProcessor
67
- from prompt_toolkit.layout.processors import HighlightSearchProcessor
68
- from prompt_toolkit.layout.processors import HighlightSelectionProcessor
69
- from prompt_toolkit.layout.processors import Processor
70
- from prompt_toolkit.layout.processors import ShowTrailingWhiteSpaceProcessor
71
- from prompt_toolkit.layout.processors import TabsProcessor
72
- from prompt_toolkit.layout.processors import Transformation
73
- from prompt_toolkit.layout.utils import explode_text_fragments
74
- from prompt_toolkit.lexers import Lexer
75
- from prompt_toolkit.lexers import PygmentsLexer
76
- from prompt_toolkit.lexers import SimpleLexer
77
- from prompt_toolkit.mouse_events import MouseEventType
78
- from prompt_toolkit.output import DummyOutput
79
- from prompt_toolkit.output import Output
80
- from prompt_toolkit.search import SearchDirection
81
- from prompt_toolkit.selection import SelectionType
82
- from prompt_toolkit.shortcuts import confirm
83
- from prompt_toolkit.shortcuts import print_formatted_text
84
- from prompt_toolkit.styles import BaseStyle
85
- from prompt_toolkit.styles import DynamicStyle
86
- from prompt_toolkit.styles import Style
87
- from prompt_toolkit.styles import merge_styles
88
- from prompt_toolkit.styles import style_from_pygments_cls
89
- from prompt_toolkit.utils import get_cwidth
90
- from prompt_toolkit.widgets import Frame
91
- from prompt_toolkit.widgets import Label
92
- from prompt_toolkit.widgets import TextArea
93
- from prompt_toolkit.widgets.toolbars import CompletionsToolbar
94
- from prompt_toolkit.widgets.toolbars import FormattedTextToolbar
95
- from prompt_toolkit.widgets.toolbars import SearchToolbar
96
- from prompt_toolkit.widgets.toolbars import SystemToolbar
97
- from prompt_toolkit.widgets.toolbars import ValidationToolbar
98
-
99
- from .prompts import create_strict_confirm_session # noqa
100
- from .prompts import prompt # noqa
101
-
102
- #
103
- from .prompts import session_prompt # noqa
104
- from .prompts import strict_confirm # noqa
omdev/ptk/apps/ncdu.py DELETED
@@ -1,167 +0,0 @@
1
- """
2
- TODO:
3
- - reuse dir sizes lol
4
- """
5
- import dataclasses as dc
6
- import os
7
- import typing as ta
8
-
9
- from omlish.lite.strings import format_num_bytes
10
-
11
- from ... import ptk
12
- from ...cli import CliModule
13
-
14
-
15
- ##
16
-
17
-
18
- def get_directory_size(path: str) -> int:
19
- total_size = 0
20
- for dirpath, _, filenames in os.walk(path):
21
- for f in filenames:
22
- fp = os.path.join(dirpath, f)
23
- try:
24
- total_size += os.path.getsize(fp) # noqa
25
- except OSError:
26
- pass
27
- return total_size
28
-
29
-
30
- @dc.dataclass(frozen=True)
31
- class Entry:
32
- name: str
33
- size: int
34
- type: ta.Literal['dir', 'file']
35
-
36
-
37
- def scan_directory(path: str) -> list[Entry]:
38
- entries: list[Entry] = []
39
-
40
- with os.scandir(path) as it:
41
- for entry in it:
42
- if entry.is_dir(follow_symlinks=False):
43
- size = get_directory_size(entry.path)
44
- entries.append(Entry(entry.name + '/', size, 'dir'))
45
-
46
- elif entry.is_file(follow_symlinks=False):
47
- size = entry.stat().st_size
48
- entries.append(Entry(entry.name, size, 'file'))
49
-
50
- entries.sort(key=lambda x: x.size, reverse=True)
51
- return entries
52
-
53
-
54
- class NcduApp:
55
- def __init__(self, root_path: str) -> None:
56
- super().__init__()
57
-
58
- self._root_path = root_path
59
- self._current_path = root_path
60
-
61
- self._entries_by_path: dict[str, list[Entry]] = {}
62
- self._entries = self._get_entries(root_path)
63
-
64
- self._cursor = 0
65
-
66
- self._text_area = ptk.TextArea(
67
- read_only=True,
68
- )
69
- self._text_area.window.always_hide_cursor = ptk.to_filter(True)
70
-
71
- self.update_display()
72
-
73
- self._kb = ptk.KeyBindings()
74
- self._kb.add('q')(self.exit_app)
75
- for k in ['up', 'p']:
76
- self._kb.add(k)(self.move_up)
77
- for k in ['down', 'n']:
78
- self._kb.add(k)(self.move_down)
79
- for k in ['right', 'enter']:
80
- self._kb.add(k)(self.enter_directory)
81
- for k in ['left', 'backspace']:
82
- self._kb.add(k)(self.go_back)
83
-
84
- self._layout = ptk.Layout(ptk.Frame(self._text_area))
85
-
86
- self._style = ptk.Style.from_dict({
87
- 'frame': 'bg:#008800 bold',
88
- 'text-area': 'bg:#000000 fg:#ffffff',
89
- })
90
-
91
- self._app: ptk.Application = ptk.Application(
92
- layout=self._layout,
93
- key_bindings=self._kb,
94
- style=self._style,
95
- full_screen=True,
96
- )
97
-
98
- def _get_entries(self, path: str) -> list[Entry]:
99
- try:
100
- return self._entries_by_path[path]
101
- except KeyError:
102
- pass
103
- entries = self._entries_by_path[path] = scan_directory(path)
104
- return entries
105
-
106
- #
107
-
108
- def update_display(self) -> None:
109
- display_text = f'Current Directory: {self._current_path}\n\n'
110
- for i, e in enumerate(self._entries):
111
- indicator = '>' if i == self._cursor else ' '
112
- display_text += f'{indicator} {e.name:<40} {format_num_bytes(e.size):>10}\n'
113
- self._text_area.text = display_text
114
-
115
- #
116
-
117
- def move_up(self, event: ptk.KeyPressEvent) -> None:
118
- if self._cursor > 0:
119
- self._cursor -= 1
120
- self.update_display()
121
-
122
- def move_down(self, event: ptk.KeyPressEvent) -> None:
123
- if self._cursor < len(self._entries) - 1:
124
- self._cursor += 1
125
- self.update_display()
126
-
127
- def enter_directory(self, event: ptk.KeyPressEvent) -> None:
128
- selected_entry = self._entries[self._cursor]
129
- if selected_entry.type == 'dir':
130
- self._current_path = os.path.join(self._current_path, selected_entry.name[:-1])
131
- self._entries = self._get_entries(self._current_path)
132
- self._cursor = 0
133
- self.update_display()
134
-
135
- def go_back(self, event: ptk.KeyPressEvent) -> None:
136
- if self._current_path != self._root_path:
137
- self._current_path = os.path.dirname(self._current_path)
138
- self._entries = self._get_entries(self._current_path)
139
- self._cursor = 0
140
- self.update_display()
141
-
142
- def exit_app(self, event: ptk.KeyPressEvent) -> None:
143
- event.app.exit()
144
-
145
- #
146
-
147
- def run(self) -> None:
148
- self._app.run()
149
-
150
-
151
- def _main() -> None:
152
- import argparse
153
-
154
- parser = argparse.ArgumentParser()
155
- parser.add_argument('dir', default='.', nargs='?')
156
- args = parser.parse_args()
157
-
158
- ncdu_app = NcduApp(args.dir)
159
- ncdu_app.run()
160
-
161
-
162
- # @omlish-manifest
163
- _CLI_MODULE = CliModule('ptk/ncdu', __name__)
164
-
165
-
166
- if __name__ == '__main__':
167
- _main()
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014, Jonathan Slenders
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5
- following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8
- disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
11
- disclaimer in the documentation and/or other materials provided with the distribution.
12
-
13
- * Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products
14
- derived from this software without specific prior written permission.
15
-
16
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,10 +0,0 @@
1
- # https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1604/files
2
- # See also: https://github.com/joouha/euporie
3
-
4
- from .markdown import ( # noqa
5
- Markdown,
6
- )
7
-
8
- from .styles import ( # noqa
9
- MARKDOWN_STYLE,
10
- )
@@ -1,11 +0,0 @@
1
- from ...cli import CliModule
2
-
3
-
4
- # @omlish-manifest
5
- _CLI_MODULE = CliModule(['ptk/markdown', 'ptk/md'], __name__)
6
-
7
-
8
- if __name__ == '__main__':
9
- from .cli import _main
10
-
11
- _main()
@@ -1,94 +0,0 @@
1
- import abc
2
-
3
-
4
- ##
5
-
6
-
7
- class Border(metaclass=abc.ABCMeta):
8
- """Base border type."""
9
-
10
- TOP_LEFT: str
11
- TOP_SPLIT: str
12
- TOP_RIGHT: str
13
- HORIZONTAL: str
14
- VERTICAL: str
15
- LEFT_SPLIT: str
16
- RIGHT_SPLIT: str
17
- CROSS: str
18
- BOTTOM_LEFT: str
19
- BOTTOM_SPLIT: str
20
- BOTTOM_RIGHT: str
21
-
22
-
23
- class NoBorder(Border):
24
- """Invisible border."""
25
-
26
- TOP_LEFT = ' '
27
- TOP_SPLIT = ' '
28
- TOP_RIGHT = ' '
29
- HORIZONTAL = ' '
30
- INNER_VERTICAL = ' '
31
- VERTICAL = ' '
32
- LEFT_SPLIT = ' '
33
- RIGHT_SPLIT = ' '
34
- CROSS = ' '
35
- BOTTOM_LEFT = ' '
36
- BOTTOM_SPLIT = ' '
37
- BOTTOM_RIGHT = ' '
38
-
39
-
40
- class SquareBorder(Border):
41
- """Square thin border."""
42
-
43
- TOP_LEFT = '┌'
44
- TOP_SPLIT = '┬'
45
- TOP_RIGHT = '┐'
46
- HORIZONTAL = '─'
47
- VERTICAL = '│'
48
- LEFT_SPLIT = '├'
49
- RIGHT_SPLIT = '┤'
50
- CROSS = '┼'
51
- BOTTOM_LEFT = '└'
52
- BOTTOM_SPLIT = '┴'
53
- BOTTOM_RIGHT = '┘'
54
-
55
-
56
- class RoundBorder(SquareBorder):
57
- """Thin border with round corners."""
58
-
59
- TOP_LEFT = '╭'
60
- TOP_RIGHT = '╮'
61
- BOTTOM_LEFT = '╰'
62
- BOTTOM_RIGHT = '╯'
63
-
64
-
65
- class DoubleBorder(Border):
66
- """Square border with double lines."""
67
-
68
- TOP_LEFT = '╔'
69
- TOP_SPLIT = '╦'
70
- TOP_RIGHT = '╗'
71
- HORIZONTAL = '═'
72
- VERTICAL = '║'
73
- LEFT_SPLIT = '╠'
74
- RIGHT_SPLIT = '╣'
75
- CROSS = '╬'
76
- BOTTOM_LEFT = '╚'
77
- BOTTOM_SPLIT = '╩'
78
- BOTTOM_RIGHT = '╝'
79
-
80
-
81
- class ThickBorder(Border):
82
- """Square border with thick lines."""
83
-
84
- TOP_LEFT = '┏'
85
- TOP_SPLIT = '┳'
86
- TOP_RIGHT = '┓'
87
- HORIZONTAL = '━'
88
- VERTICAL = '┃'
89
- LEFT_SPLIT = '┣'
90
- RIGHT_SPLIT = '┫'
91
- CROSS = '╋'
92
- BOTTOM_LEFT = '┗'
93
- BOTTOM_SPLIT = '┻'
94
- BOTTOM_RIGHT = '┛'