auto-editor 25.0.1__py3-none-any.whl → 25.2.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.
@@ -118,6 +118,10 @@ class Proc:
118
118
 
119
119
  if kws is not None:
120
120
  for key, val in kwargs.items():
121
+ if key not in kws:
122
+ raise MyError(
123
+ f"{self.name} got an unexpected keyword argument: {key}"
124
+ )
121
125
  check = cont[-1] if kws[key] >= len(cont) else cont[kws[key]]
122
126
  if not check_contract(check, val):
123
127
  exp = f"{check}" if callable(check) else print_str(check)
@@ -54,12 +54,14 @@ class Env:
54
54
 
55
55
 
56
56
  class Sym:
57
- __slots__ = ("val", "hash")
57
+ __slots__ = ("val", "hash", "lineno", "column")
58
58
 
59
- def __init__(self, val: str):
59
+ def __init__(self, val: str, lineno: int = -1, column: int = -1):
60
60
  assert isinstance(val, str)
61
61
  self.val = val
62
62
  self.hash = hash(val)
63
+ self.lineno = lineno
64
+ self.column = column
63
65
 
64
66
  def __str__(self) -> str:
65
67
  return self.val
@@ -124,6 +124,19 @@ def make_timeline(
124
124
  src_index = np.array([], dtype=np.int32)
125
125
  concat = np.concatenate
126
126
 
127
+ try:
128
+ stdenv = __import__("auto_editor.lang.stdenv", fromlist=["lang"])
129
+ env.update(stdenv.make_standard_env())
130
+ except ImportError:
131
+ func = log.error if args.config else log.debug
132
+ func("Failed to import standard env")
133
+
134
+ if args.config:
135
+ # Edit `env` with user-defined code.
136
+ with open("config.pal") as file:
137
+ parser = Parser(Lexer("config.pal", file.read()))
138
+ interpret(env, parser)
139
+
127
140
  for i, src in enumerate(sources):
128
141
  try:
129
142
  parser = Parser(Lexer("`--edit`", args.edit_based_on))
@@ -131,6 +144,7 @@ def make_timeline(
131
144
  log.debug(f"edit: {parser}")
132
145
 
133
146
  env["timebase"] = tb
147
+ env["src"] = f"{src.path}"
134
148
  env["@levels"] = Levels(src, tb, bar, args.no_cache, log, len(sources) < 2)
135
149
 
136
150
  results = interpret(env, parser)
@@ -83,7 +83,9 @@ class SubtitleParser:
83
83
  def edit(self, chunks: Chunks) -> None:
84
84
  for cut in reversed(chunks):
85
85
  the_speed = cut[2]
86
- speed_factor = 1 if the_speed == 99999 else 1 - (1 / the_speed)
86
+ speed_factor = (
87
+ 1 if (the_speed == 0 or the_speed >= 99999) else 1 - (1 / the_speed)
88
+ )
87
89
 
88
90
  new_content = []
89
91
  for content in self.contents:
@@ -57,21 +57,6 @@ allowed_pix_fmt = {
57
57
  }
58
58
 
59
59
 
60
- def apply_anchor(x: int, y: int, w: int, h: int, anchor: str) -> tuple[int, int]:
61
- if anchor == "ce":
62
- x = (x * 2 - w) // 2
63
- y = (y * 2 - h) // 2
64
- if anchor == "tr":
65
- x -= w
66
- if anchor == "bl":
67
- y -= h
68
- if anchor == "br":
69
- x -= w
70
- y -= h
71
- # Use 'tl' by default
72
- return x, y
73
-
74
-
75
60
  def make_solid(width: int, height: int, pix_fmt: str, bg: str) -> av.VideoFrame:
76
61
  hex_color = bg.lstrip("#").upper()
77
62
  rgb_color = tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4))
@@ -292,7 +277,7 @@ def render_av(
292
277
  frame = graph.vpull()
293
278
  elif isinstance(obj, TlRect):
294
279
  graph = av.filter.Graph()
295
- x, y = apply_anchor(obj.x, obj.y, obj.width, obj.height, obj.anchor)
280
+ x, y = obj.x, obj.y
296
281
  graph.link_nodes(
297
282
  graph.add_buffer(template=my_stream),
298
283
  graph.add(
@@ -307,9 +292,7 @@ def render_av(
307
292
  array = frame.to_ndarray(format="rgb24")
308
293
 
309
294
  overlay_h, overlay_w, _ = img.shape
310
- x_pos, y_pos = apply_anchor(
311
- obj.x, obj.y, overlay_w, overlay_h, obj.anchor
312
- )
295
+ x_pos, y_pos = obj.x, obj.y
313
296
 
314
297
  x_start = max(x_pos, 0)
315
298
  y_start = max(y_pos, 0)
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import sys
4
4
 
5
5
  from auto_editor.lang.palet import Lexer, Parser, env, interpret
6
+ from auto_editor.lang.stdenv import make_standard_env
6
7
  from auto_editor.lib.err import MyError
7
8
 
8
9
 
@@ -11,6 +12,7 @@ def main(sys_args: list[str] = sys.argv[1:]) -> None:
11
12
  with open(sys_args[0], encoding="utf-8", errors="ignore") as file:
12
13
  program_text = file.read()
13
14
 
15
+ env.update(make_standard_env())
14
16
  try:
15
17
  interpret(env, Parser(Lexer(sys_args[0], program_text, True)))
16
18
  except (MyError, ZeroDivisionError) as e:
@@ -8,6 +8,7 @@ import auto_editor
8
8
  from auto_editor.analyze import Levels
9
9
  from auto_editor.ffwrapper import initFileInfo
10
10
  from auto_editor.lang.palet import ClosingError, Lexer, Parser, env, interpret
11
+ from auto_editor.lang.stdenv import make_standard_env
11
12
  from auto_editor.lib.data_structs import print_str
12
13
  from auto_editor.lib.err import MyError
13
14
  from auto_editor.utils.bar import Bar
@@ -67,6 +68,7 @@ def main(sys_args: list[str] = sys.argv[1:]) -> None:
67
68
  env["timebase"] = tb
68
69
  env["@levels"] = Levels(src, tb, bar, False, log, strict)
69
70
 
71
+ env.update(make_standard_env())
70
72
  print(f"Auto-Editor {auto_editor.__version__}")
71
73
  text = None
72
74
 
@@ -85,8 +87,7 @@ def main(sys_args: list[str] = sys.argv[1:]) -> None:
85
87
  continue
86
88
 
87
89
  try:
88
- lexer = Lexer("repl", text)
89
- parser = Parser(lexer)
90
+ parser = Parser(Lexer("repl", text))
90
91
  if args.debug_parser:
91
92
  print(f"parser: {parser}")
92
93
 
@@ -13,6 +13,7 @@ import numpy as np
13
13
 
14
14
  from auto_editor.ffwrapper import FileInfo, initFileInfo
15
15
  from auto_editor.lang.palet import Lexer, Parser, env, interpret
16
+ from auto_editor.lang.stdenv import make_standard_env
16
17
  from auto_editor.lib.data_structs import Char
17
18
  from auto_editor.lib.err import MyError
18
19
  from auto_editor.utils.log import Log
@@ -551,6 +552,8 @@ def main(sys_args: list[str] | None = None):
551
552
  )
552
553
 
553
554
  def palet_python_bridge():
555
+ env.update(make_standard_env())
556
+
554
557
  def cases(*cases: tuple[str, Any]) -> None:
555
558
  for text, expected in cases:
556
559
  try:
auto_editor/timeline.py CHANGED
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from auto_editor.lib.contracts import *
7
7
  from auto_editor.utils.cmdkw import Required, pAttr, pAttrs
8
- from auto_editor.utils.types import anchor, color, natural, number, threshold
8
+ from auto_editor.utils.types import color, natural, number, threshold
9
9
 
10
10
  if TYPE_CHECKING:
11
11
  from collections.abc import Iterator
@@ -88,7 +88,6 @@ class TlImage:
88
88
  y: int
89
89
  width: int
90
90
  opacity: float
91
- anchor: str
92
91
 
93
92
  def as_dict(self) -> dict:
94
93
  return {
@@ -100,7 +99,6 @@ class TlImage:
100
99
  "y": self.y,
101
100
  "width": self.width,
102
101
  "opacity": self.opacity,
103
- "anchor": self.anchor,
104
102
  }
105
103
 
106
104
 
@@ -112,7 +110,6 @@ class TlRect:
112
110
  y: int
113
111
  width: int
114
112
  height: int
115
- anchor: str
116
113
  fill: str
117
114
 
118
115
  def as_dict(self) -> dict:
@@ -124,7 +121,6 @@ class TlRect:
124
121
  "y": self.y,
125
122
  "width": self.width,
126
123
  "height": self.height,
127
- "anchor": self.anchor,
128
124
  "fill": self.fill,
129
125
  }
130
126
 
@@ -157,7 +153,6 @@ img_builder = pAttrs(
157
153
  pAttr("y", Required, is_int, int),
158
154
  pAttr("width", 0, is_nat, natural),
159
155
  pAttr("opacity", 1, is_threshold, threshold),
160
- pAttr("anchor", "ce", is_str, anchor),
161
156
  )
162
157
  rect_builder = pAttrs(
163
158
  "rect",
@@ -167,7 +162,6 @@ rect_builder = pAttrs(
167
162
  pAttr("y", Required, is_int, int),
168
163
  pAttr("width", Required, is_int, int),
169
164
  pAttr("height", Required, is_int, int),
170
- pAttr("anchor", "ce", is_str, anchor),
171
165
  pAttr("fill", "#c4c4c4", is_str, color),
172
166
  )
173
167
  visual_objects = {
@@ -177,8 +177,7 @@ def parse_with_palet(
177
177
  def parse_method(
178
178
  name: str, text: str, env: Env
179
179
  ) -> tuple[str, list[Any], dict[str, Any]]:
180
- from auto_editor.lang.palet import Lexer, Parser, interpret
181
- from auto_editor.lib.err import MyError
180
+ from auto_editor.lang.palet import Lexer, Parser
182
181
 
183
182
  # Positional Arguments
184
183
  # audio:0.04,0,6,3
@@ -197,18 +196,13 @@ def parse_method(
197
196
  if "=" in arg:
198
197
  key, val = arg.split("=", 1)
199
198
 
200
- results = interpret(env, Parser(Lexer(name, val)))
201
- if not results:
202
- raise MyError("Results must be of length > 0")
203
-
204
- kwargs[key] = results[-1]
199
+ result = Parser(Lexer(name, val)).expr()
200
+ kwargs[key] = result
205
201
  allow_positional_args = False
206
202
 
207
203
  elif allow_positional_args:
208
- results = interpret(env, Parser(Lexer(name, arg)))
209
- if not results:
210
- raise MyError("Results must be of length > 0")
211
- args.append(results[-1])
204
+ result = Parser(Lexer(name, arg)).expr()
205
+ args.append(result)
212
206
  else:
213
207
  raise ParserError(f"{name} positional argument follows keyword argument.")
214
208
 
@@ -148,13 +148,6 @@ def time(val: str, tb: Fraction) -> int:
148
148
  return int(num)
149
149
 
150
150
 
151
- def anchor(val: str) -> str:
152
- allowed = ("tl", "tr", "bl", "br", "ce")
153
- if val not in allowed:
154
- raise CoerceError(f"Anchor must be: {' '.join(allowed)}")
155
- return val
156
-
157
-
158
151
  def margin(val: str) -> tuple[str, str]:
159
152
  vals = val.strip().split(",")
160
153
  if len(vals) == 1:
@@ -251,6 +244,7 @@ class Args:
251
244
  progress: str = "modern"
252
245
  version: bool = False
253
246
  debug: bool = False
247
+ config: bool = False
254
248
  show_ffmpeg_commands: bool = False
255
249
  show_ffmpeg_output: bool = False
256
250
  quiet: bool = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auto-editor
3
- Version: 25.0.1
3
+ Version: 25.2.0
4
4
  Summary: Auto-Editor: Effort free video editing!
5
5
  Author-email: WyattBlue <wyattblue@auto-editor.com>
6
6
  License: Unlicense
@@ -8,11 +8,11 @@ Project-URL: Bug Tracker, https://github.com/WyattBlue/auto-editor/issues
8
8
  Project-URL: Source Code, https://github.com/WyattBlue/auto-editor
9
9
  Project-URL: homepage, https://auto-editor.com
10
10
  Keywords: video,audio,media,editor,editing,processing,nonlinear,automatic,silence-detect,silence-removal,silence-speedup,motion-detection
11
- Requires-Python: >=3.10
11
+ Requires-Python: <3.14,>=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: numpy >=1.23.0
15
- Requires-Dist: pyav ==12.3.*
14
+ Requires-Dist: numpy <3.0,>=1.23.0
15
+ Requires-Dist: pyav ==13.0.*
16
16
  Requires-Dist: ae-ffmpeg ==1.2.*
17
17
 
18
18
  <p align="center"><img src="https://auto-editor.com/img/auto-editor-banner.webp" title="Auto-Editor" width="700"></p>
@@ -1,55 +1,58 @@
1
- auto_editor/__init__.py,sha256=HQ6qfTf_xOT2gRqJKN_PWXCV49oRXl228FqZ7w9Haeg,23
2
- auto_editor/__main__.py,sha256=aXFUlP7v15CzBeYtLdEPyIX2hxtynXo_UKWUQlxQGbM,9852
1
+ auto_editor/__init__.py,sha256=d15hyX45hKLmfvXLeIkyhpZzJZLdjD4LHXV2_hYYiiM,23
2
+ auto_editor/__main__.py,sha256=OlPCTG3t8phhLnyXT8bQlqsA4O97mDhmJTanJCgb82Q,9964
3
3
  auto_editor/analyze.py,sha256=pHoSZ_-wyV1hLJyJpPg9Ha7oecjdGHGJ0a4hbKnb9NY,11779
4
- auto_editor/edit.py,sha256=fe6YT6O8B_hPOb4r4FdubvswbTuyx4_qlzlJTyMKuVc,11267
4
+ auto_editor/edit.py,sha256=-AtEOHTvBnLlvvYkDyDbh9weGOOui6vsbyJZbEoYljI,11447
5
5
  auto_editor/ffwrapper.py,sha256=NnhD4TvKyaap0Y2MQ7aIUQfeLJwfNbjTj5bLUpoMEI4,7888
6
6
  auto_editor/help.py,sha256=BFiP7vBz42TUzum4-zaQIrV1OY7kHeN0pe0MPE0T5xw,7997
7
- auto_editor/make_layers.py,sha256=ybTxPRD6bDbEX-7e9qu4OYUvYkrdNb4BjnN9hzwkRiQ,8496
7
+ auto_editor/make_layers.py,sha256=8uFy5SvMArAP-5slYJrxa_iGAEwimQBFeM-T01VORVw,8995
8
8
  auto_editor/output.py,sha256=D8NCJwwmcjDf5rvoBnWKu5XY7QtxF3thxbnTxKAxGu8,8043
9
9
  auto_editor/preview.py,sha256=noWkgyzdE14zwG8ZDYxLDual5iVt6zYTt4HTe-QAgFY,3029
10
- auto_editor/timeline.py,sha256=d9Qhup2pBwsj7j9kF-Iw22xHbQvGx-keDq2eLI11Mt4,7117
10
+ auto_editor/timeline.py,sha256=gZHJT7Iugpz0LPH06cRPgcEWF4iXTltUwTXmS3ShtfQ,6921
11
11
  auto_editor/validate_input.py,sha256=_9vtbNxodhVPf4PzTAH67LSj2K-HS6kShJOARmUMJdY,2904
12
12
  auto_editor/vanparse.py,sha256=f0vViZ-aYtDxEyVrFHJ5X2pPTQAfqtw3N2gZgzn51kU,10002
13
13
  auto_editor/wavfile.py,sha256=7N2LX_WfFVRnoXrKveLvuyTYpIz2htpGqfCD8tR4kJ8,9168
14
14
  auto_editor/formats/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- auto_editor/formats/fcp11.py,sha256=VwJWJs1qNDIVC8-pswipmKCk0e4V3LnE5fAMA0pPWVg,5857
16
- auto_editor/formats/fcp7.py,sha256=fH86sxhlUysWisjvlqzZJgDrRpj3dSzFG-Eho2sehdc,17610
15
+ auto_editor/formats/fcp11.py,sha256=Sff8fLZw0s0G88EVeBsn9vwzzga_KHIt2pGMww3V5jA,5411
16
+ auto_editor/formats/fcp7.py,sha256=vd7cW8vwoTvFlp4Tc5DYSn-A7i9ck3jJJdKNqWVtFVQ,20285
17
17
  auto_editor/formats/json.py,sha256=Br-xHVHj59C0OPP2FwfJeht_fImepRXsaw0iDFvK7-w,7693
18
18
  auto_editor/formats/shotcut.py,sha256=-ES854LLFCMCBe100JRJedDmuk8zPev17aQMTrzPv-g,4923
19
19
  auto_editor/formats/utils.py,sha256=GIZw28WHuCIaZ_zMI0v6Kxbq0QaIpbLsdSegdYwQxQ8,1990
20
20
  auto_editor/lang/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  auto_editor/lang/json.py,sha256=OsNcYlfEj8ZLlzLK-gkLcrCCKI7mJz9rpe-6XLr4f9U,9231
22
+ auto_editor/lang/libintrospection.py,sha256=6H1rGp0wqaCud5IPaoEmzULGnYt6ec7_0h32ATcw2oY,261
22
23
  auto_editor/lang/libmath.py,sha256=z33A161Oe6vYYK7R6pgYjdZZe63dQkN38Qf36TL3prg,847
23
- auto_editor/lang/palet.py,sha256=m22TQnKomUM2quxIH4bz7ya_gM166rbJ5pW7Ei-43IA,59712
24
+ auto_editor/lang/palet.py,sha256=5S6RVNH8SHa3K7mf9GjWlLsnswmdp7xomkOR4LHV3Dg,24330
25
+ auto_editor/lang/stdenv.py,sha256=2pd1br3ijuIayXHKOitU6DOm-5yBxQFA1aCJgq_XWfU,43972
24
26
  auto_editor/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- auto_editor/lib/contracts.py,sha256=a3ZT-bGMa3-UjWKKFrEwLayw2Gl-rhqd5Bmvmrj85oE,7413
26
- auto_editor/lib/data_structs.py,sha256=xyB6aEcpdB9NNWp_dU3d2ds5Z8zOfHXNX4mNQLh2pNw,6977
27
+ auto_editor/lib/contracts.py,sha256=lExGQymcQUmwG5lC1lO4qm4GY8W0q_yzK_miTaAoPA4,7586
28
+ auto_editor/lib/data_structs.py,sha256=dcsXgsLLzbmFDUZucoirzewPALsKzoxz7z5L22_QJM8,7091
27
29
  auto_editor/lib/err.py,sha256=UlszQJdzMZwkbT8x3sY4GkCV_5x9yrd6uVVUzvA8iiI,35
28
30
  auto_editor/render/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
31
  auto_editor/render/audio.py,sha256=darKvlglNXkknSUaPnH-qEUyccM1Awnv03_Px4yY81I,8844
30
- auto_editor/render/subtitle.py,sha256=g195kDN0LcwKlZeQMCflXPH5n_74iwCk1RPLSQ5eP34,4373
31
- auto_editor/render/video.py,sha256=gMVcLehC_QpdtIzNLR_7tv2CZmYeEWisS_5as4ceHV0,12971
32
+ auto_editor/render/subtitle.py,sha256=CNcU_hmLwfZ2yvmSllIK-pB7ge_YdXHR-fnnOVUO9m8,4425
33
+ auto_editor/render/video.py,sha256=OWtziP6l9AuMdeb3I7CBv8SlgaXS5BcRilCX47BkadU,12492
32
34
  auto_editor/subcommands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
35
  auto_editor/subcommands/desc.py,sha256=GDrKJYiHMaeTrplZAceXl1JwoqD78XsV2_5lc0Xd7po,869
34
36
  auto_editor/subcommands/info.py,sha256=t5n43HLt9hpMFSIfGV777X4zIPBAFugOKlpCfRjiKxY,6921
35
37
  auto_editor/subcommands/levels.py,sha256=ZB8_9jbOA5s1AQUcUNZDiLAjyJOKl7Be2YeVWdkOr0Q,4071
36
- auto_editor/subcommands/palet.py,sha256=tbQoRWoT4jR3yu0etGApfprM-oQgXIjC-rIY-QG3nM0,655
37
- auto_editor/subcommands/repl.py,sha256=OfxIOBjE7W12UemfaaxMnzHcmV5cUTt7g5328R7rAYU,3116
38
+ auto_editor/subcommands/palet.py,sha256=ONzTqemaQq9YEfIOsDRNnwzfqnEMUMSXIQrETxyroRU,749
39
+ auto_editor/subcommands/repl.py,sha256=hpdF-CrOzdkChmj7zhx8P-lNWLmFfVR_VAnSUt0aaNU,3176
38
40
  auto_editor/subcommands/subdump.py,sha256=af_XBf7kaevqHn1A71z8C-7x8pS5WKD9FE_ugkCw6rk,665
39
- auto_editor/subcommands/test.py,sha256=d-StLyIZHkvJVaiXmr1gYTzUIwLhbG34tJfYosobmps,25227
41
+ auto_editor/subcommands/test.py,sha256=PdJAIR6HRTL_FGVPYlQMq4uW-5U4Hz515O29nPbSZyg,25322
40
42
  auto_editor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
43
  auto_editor/utils/bar.py,sha256=RJqkJ8gNr8op_Z-2hh48ExjSonmTPX-RshctK_itv14,3988
42
44
  auto_editor/utils/chunks.py,sha256=J-eGKtEz68gFtRrj1kOSgH4Tj_Yz6prNQ7Xr-d9NQJw,52
43
- auto_editor/utils/cmdkw.py,sha256=XApxw7FZBOEJV9N4LHhdw1GVfHbFfCjr-zCZ1gJsSvY,6002
45
+ auto_editor/utils/cmdkw.py,sha256=uW_qDGQ6UzLPRbB20HTLrCmhMlWVXSfgyQMr4MyGErU,5734
44
46
  auto_editor/utils/container.py,sha256=RnpoMmMYmn7o69LmMbBFHW4TsP3K52jYDhG9qzWXmAs,2720
45
47
  auto_editor/utils/encoder.py,sha256=auNYo7HXbcU4iTUCc0LE5lpwFmSvdWvBm6-5KIaRK8w,2983
46
48
  auto_editor/utils/func.py,sha256=kcxCOqe-tg6k-kxutIran8LpffRiHDjKB6rm-ngFiSU,4460
47
49
  auto_editor/utils/log.py,sha256=M2QKeQHMRNLm3HMVUKedZPRprT2u5dipOStiO4miPBk,3613
48
50
  auto_editor/utils/subtitle_tools.py,sha256=TjjVPiT8bWzZJcrZjF7ddpgfIsVkLE4LyxXzBswHAGU,693
49
- auto_editor/utils/types.py,sha256=JdAwfuT9Ty_FXUm89GUTo0M8FPFrXbqnlk-g4pWP1_k,11609
50
- auto_editor-25.0.1.dist-info/LICENSE,sha256=yiq99pWITHfqS0pbZMp7cy2dnbreTuvBwudsU-njvIM,1210
51
- auto_editor-25.0.1.dist-info/METADATA,sha256=FsEPvrdesILZ7duMkfSr7kRBhXEEN6dJ2ttjSr4Z9qw,6137
52
- auto_editor-25.0.1.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
53
- auto_editor-25.0.1.dist-info/entry_points.txt,sha256=-H7zdTw4MqnAcwrN5xTNkGIhzZtJMxS9r6lTMeR9-aA,240
54
- auto_editor-25.0.1.dist-info/top_level.txt,sha256=ky1HUkqq9i034c4CUU_0wBw0xZsxxyGEak1eTbdvpyA,12
55
- auto_editor-25.0.1.dist-info/RECORD,,
51
+ auto_editor/utils/types.py,sha256=49V5Fo6LlQIPWU7Gzsl8Y5_c0lsZOIJuEVWp__TWL5M,11450
52
+ docs/build.py,sha256=8nJM_CgkSL5ilvzcJDGNjzoWpCphPJKZKguHazG6YK8,1641
53
+ auto_editor-25.2.0.dist-info/LICENSE,sha256=yiq99pWITHfqS0pbZMp7cy2dnbreTuvBwudsU-njvIM,1210
54
+ auto_editor-25.2.0.dist-info/METADATA,sha256=EFLXuvw_VPO4Jhrku1AuiRpir3uQb8PUyC_cxBN0_f0,6148
55
+ auto_editor-25.2.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
56
+ auto_editor-25.2.0.dist-info/entry_points.txt,sha256=-H7zdTw4MqnAcwrN5xTNkGIhzZtJMxS9r6lTMeR9-aA,240
57
+ auto_editor-25.2.0.dist-info/top_level.txt,sha256=jBV5zlbWRbKOa-xaWPvTD45QL7lGExx2BDzv-Ji4dTw,17
58
+ auto_editor-25.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
docs/build.py ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import os
4
+ import sys
5
+
6
+ # Put 'auto_editor' in Python path
7
+ sys.path.append(os.path.dirname(os.path.dirname(__file__)))
8
+
9
+ import auto_editor.vanparse as vanparse
10
+ from auto_editor.__main__ import main_options
11
+ from auto_editor.lang.palet import Lexer, Parser, env, interpret
12
+ from auto_editor.lang.stdenv import make_standard_env
13
+ from auto_editor.vanparse import OptionText
14
+
15
+
16
+ def main():
17
+ parser = vanparse.ArgumentParser("Auto-Editor")
18
+ parser = main_options(parser)
19
+
20
+ with open("src/ref/options.html", "w") as file:
21
+ file.write(
22
+ '{{ header-desc "Options" "These are the options and flags that auto-editor uses." }}\n'
23
+ "<body>\n"
24
+ "{{ nav }}\n"
25
+ '<section class="section">\n'
26
+ '<div class="container">\n'
27
+ )
28
+ for op in parser.args:
29
+ if isinstance(op, OptionText):
30
+ file.write(f"<h2>{op.text}</h2>\n")
31
+ else:
32
+ file.write(f"<h3><code>{op.names[0]}</code></h3>\n")
33
+ if len(op.names) > 1:
34
+ file.write(
35
+ "<h4><code>"
36
+ + "</code> <code>".join(op.names[1:])
37
+ + "</code></h4>\n"
38
+ )
39
+
40
+ file.write(f"<p>{op.help}</p>\n")
41
+
42
+ file.write("</div>\n</section>\n</body>\n</html>\n\n")
43
+
44
+ env.update(make_standard_env())
45
+ with open("doc.pal") as sourcefile:
46
+ try:
47
+ interpret(env, Parser(Lexer("doc.pal", sourcefile.read())))
48
+ except Exception as e:
49
+ print(e)
50
+ quit(1)
51
+
52
+ if __name__ == "__main__":
53
+ main()