treescript-builder 0.1.8__py3-none-any.whl → 0.1.9__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.
@@ -9,7 +9,6 @@ The Default Input Reader.
9
9
  - Comments are filtered out by starting a line with the # character. A comment after a file name is also filtered.
10
10
  Author: DK96-OS 2024 - 2025
11
11
  """
12
- from itertools import groupby, takewhile
13
12
  from sys import exit
14
13
  from typing import Generator
15
14
 
@@ -41,15 +40,10 @@ def read_input_tree(
41
40
  **Raises:**
42
41
  SystemExit - When any Line cannot be read successfully.
43
42
  """
44
- line_number = 1
45
- for is_newline, group in groupby(input_tree_data, lambda x: x in ["\n", "\r"]):
46
- if is_newline:
47
- line_number += sum(1 for _ in group) # Line number increase by size of group
48
- else:
49
- line = ''.join(group)
50
- if len(lstr := line.lstrip()) == 0 or lstr.startswith('#'):
51
- continue
52
- yield _process_line(line_number, line)
43
+ for line_number, line in enumerate(input_tree_data.splitlines(), start=1):
44
+ if len(lstr := line.lstrip()) == 0 or lstr.startswith('#'):
45
+ continue
46
+ yield _process_line(line_number, line)
53
47
 
54
48
 
55
49
  def _process_line(
@@ -150,9 +144,11 @@ def _calculate_depth(line: str) -> int:
150
144
  **Returns:**
151
145
  int - The depth of the line in the tree structure, or -1 if space count is invalid.
152
146
  """
153
- space_count = len(list(
154
- takewhile(lambda c: c in SPACE_CHARS, line)
155
- ))
147
+ space_count = 0
148
+ for char in line:
149
+ if char not in SPACE_CHARS:
150
+ break
151
+ space_count += 1
156
152
  # Bit Shift Shuffle Equivalence Validation (space_count is divisible by 2)
157
153
  if (depth := space_count >> 1) << 1 == space_count:
158
154
  return depth
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: treescript-builder
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Builds File Trees from TreeScript. If DataLabels are present in TreeScript, a DataDirectory argument is required.
5
5
  Home-page: https://github.com/DK96-OS/treescript-builder
6
6
  Author: DK96-OS
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
19
20
  Requires-Python: >=3.11
20
21
  Description-Content-Type: text/markdown
21
22
  License-File: LICENSE
@@ -11,16 +11,16 @@ treescript_builder/input/argument_data.py,sha256=PFacb8g-RXh4-RH8foW4eINms6REWpm
11
11
  treescript_builder/input/argument_parser.py,sha256=ARPI-EFO5MkXSQqLjyiQPkxg-sB2jP14wf6K4y64Tog,2795
12
12
  treescript_builder/input/file_validation.py,sha256=m0zxntGDkkzWLb3PQKKsxfRSSDgd0dhK35IbaUmN_gw,2404
13
13
  treescript_builder/input/input_data.py,sha256=mP8FAI26UDRwfuEFWXsJJnw77Qxv_yjkuy4NFiTZVOg,479
14
- treescript_builder/input/line_reader.py,sha256=BqsxwxpWndwsOibcm8339q8SPaLgIjueCMPwlErXQEM,5696
14
+ treescript_builder/input/line_reader.py,sha256=RDft2rW2Apkd56rQJ8_ngkVyrp3DOh2KtJT6DamXlqI,5492
15
15
  treescript_builder/input/string_validation.py,sha256=6H17UWamTPp2aBC-EVX1P58E0a-F6eD1--HH8CWrmIQ,5020
16
16
  treescript_builder/tree/__init__.py,sha256=3YgyrVcplTYEtFL9PuEM2k08LM8N8xsdRmNJR0rbA4s,1884
17
17
  treescript_builder/tree/build_validation.py,sha256=huO_FRnq_anqGTaQaDfcmc_zU9pIuVaa0orglNDgQIc,4167
18
18
  treescript_builder/tree/tree_builder.py,sha256=0OiJ_Rjpm9Ux1DXvP4d6lHw9CoUCpu6lTfxTmLVOTfQ,1862
19
19
  treescript_builder/tree/tree_trimmer.py,sha256=4cYrnAPX4WQi9JW60K20KPWb9aAtkPYTZWeZ4scEjps,1581
20
20
  treescript_builder/tree/trim_validation.py,sha256=Q49ufnISQxZDzsnvMWrF5cMxRSZQYAhgpY_2XdIjnzI,3353
21
- treescript_builder-0.1.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- treescript_builder-0.1.8.dist-info/METADATA,sha256=QnfZHITKtHGwBGMcjsWPE7Y3kmWcN1rmld6w7H88SHI,5299
23
- treescript_builder-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- treescript_builder-0.1.8.dist-info/entry_points.txt,sha256=eOmYzJQPcGaH2GGBfwwU6UH_33tGtsK_ogxB4DnVrFI,111
25
- treescript_builder-0.1.8.dist-info/top_level.txt,sha256=parytS3LU7PXBsMVe_puiTOva14bUCzvFwcIwF_Y3Ks,19
26
- treescript_builder-0.1.8.dist-info/RECORD,,
21
+ treescript_builder-0.1.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ treescript_builder-0.1.9.dist-info/METADATA,sha256=G25tjXNH71GnYyOsMqchowmS1H3z3lw4kD4rrfjC6WE,5350
23
+ treescript_builder-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ treescript_builder-0.1.9.dist-info/entry_points.txt,sha256=eOmYzJQPcGaH2GGBfwwU6UH_33tGtsK_ogxB4DnVrFI,111
25
+ treescript_builder-0.1.9.dist-info/top_level.txt,sha256=parytS3LU7PXBsMVe_puiTOva14bUCzvFwcIwF_Y3Ks,19
26
+ treescript_builder-0.1.9.dist-info/RECORD,,