foundrytools-cli 2.1.0__py3-none-any.whl → 2.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.
@@ -1,3 +1,3 @@
1
- VERSION = __version__ = "2.1.0"
1
+ VERSION = __version__ = "2.2.0"
2
2
 
3
3
  __all__ = ["VERSION"]
@@ -36,5 +36,5 @@ from foundrytools_cli.commands.utils import cli as utils
36
36
  },
37
37
  )
38
38
  @click.version_option()
39
- def cli() -> None: # pylint: disable=missing-function-docstring
39
+ def cli() -> None:
40
40
  pass
@@ -1,4 +1,3 @@
1
- # pylint: disable=import-outside-toplevel
2
1
  from pathlib import Path
3
2
  from typing import Any, cast
4
3
 
@@ -1,4 +1,3 @@
1
- # pylint: disable=import-outside-toplevel
2
1
  from collections.abc import Callable
3
2
  from pathlib import Path
4
3
  from typing import Any, cast
@@ -56,16 +55,6 @@ cli = click.Group(help="Miscellaneous utilities.")
56
55
  6: Macintosh LWFN (LaserWriter Font Naming) using 5:3:3 rule
57
56
  """,
58
57
  )
59
- @click.option(
60
- "-o",
61
- "--overwrite",
62
- "overwrite",
63
- is_flag=True,
64
- help="""
65
- Allow overwriting output files. THIS MIGHT POTENTIALLY RESULT IN LOSS OF FILES.
66
- USE WITH CARE.
67
- """,
68
- )
69
58
  @recursive_flag()
70
59
  def font_renamer(input_path: Path, **options: dict[str, Any]) -> None:
71
60
  """
@@ -116,7 +116,7 @@ def _get_file_stem(font: Font, source: int = 1) -> str:
116
116
  return sanitize_filename(file_name, platform="auto")
117
117
 
118
118
 
119
- def main(font: Font, source: int = 1, overwrite: bool = False) -> None:
119
+ def main(font: Font, source: int = 1) -> None:
120
120
  """
121
121
  Renames the given font files.
122
122
  """
@@ -128,25 +128,28 @@ def main(font: Font, source: int = 1, overwrite: bool = False) -> None:
128
128
  f"source=4 and source=5 can be used for OTF files only. Using source=1 for "
129
129
  f"{old_file.name}"
130
130
  )
131
+
131
132
  new_file_name = sanitize_filename(_get_file_stem(font=font, source=source))
132
133
  new_file = font.get_file_path(
133
134
  file=Path(new_file_name),
134
135
  extension=font.get_file_ext(),
135
136
  output_dir=old_file.parent,
136
- overwrite=overwrite,
137
+ overwrite=True,
137
138
  )
138
139
  if new_file == old_file:
139
140
  logger.skip(f"{old_file.name} is already named correctly") # type: ignore
140
141
  return
142
+
141
143
  if new_file.exists():
142
144
  logger.warning(f"Another file named {new_file.name} already exists")
143
145
  logger.skip(f"{old_file.name} was not renamed") # type: ignore
144
146
  return
147
+
145
148
  try:
146
149
  old_file.rename(new_file)
147
150
  logger.opt(colors=True).info(
148
151
  f"<light-black>{old_file.name}</> --> <bold><magenta>{new_file.name}</></>"
149
152
  )
150
- except Exception as e: # pylint: disable=broad-except
153
+ except Exception as e:
151
154
  logger.error(f"Error renaming {old_file.name}: {e}")
152
155
  return
@@ -1,4 +1,3 @@
1
- # pylint: disable=import-outside-toplevel
2
1
  import os
3
2
  import platform
4
3
  from pathlib import Path
@@ -19,7 +18,7 @@ if platform.system() == "Windows":
19
18
  from win32_setctime import setctime
20
19
 
21
20
  SETCTIME = setctime
22
- except (ImportError, Exception) as exc: # pylint: disable=broad-except
21
+ except (ImportError, Exception) as exc:
23
22
  SETCTIME = None
24
23
  IMPORT_ERROR = exc
25
24
 
@@ -98,7 +97,7 @@ def _set_windows_ctime(path: Path, timestamp: int) -> None:
98
97
  try:
99
98
  SETCTIME(path, timestamp + epoch_diff)
100
99
  logger.info(f"created timestamp : {timestampToString(timestamp)}")
101
- except Exception as e: # pylint: disable=broad-except
100
+ except Exception as e:
102
101
  logger.error(f"Error setting file creation time: {e}")
103
102
 
104
103
 
@@ -107,7 +106,7 @@ def _set_mtime_and_atime(path: Path, timestamp: int) -> None:
107
106
  os.utime(path, (timestamp + epoch_diff, timestamp + epoch_diff))
108
107
  logger.info(f"modified timestamp : {timestampToString(timestamp)}")
109
108
  logger.info(f"access timestamp : {timestampToString(timestamp)}")
110
- except Exception as e: # pylint: disable=broad-except
109
+ except Exception as e:
111
110
  logger.error(f"Error setting file timestamps: {e}")
112
111
 
113
112
 
@@ -35,7 +35,7 @@ class SaveOptions:
35
35
  overwrite: bool = False
36
36
 
37
37
 
38
- class TaskRunnerConfig: # pylint: disable=too-few-public-methods
38
+ class TaskRunnerConfig:
39
39
  """
40
40
  Handle options for TaskRunner.
41
41
  """
@@ -85,7 +85,7 @@ class TaskRunnerConfig: # pylint: disable=too-few-public-methods
85
85
  setattr(options_group, key, value)
86
86
 
87
87
 
88
- class TaskRunner: # pylint: disable=too-few-public-methods
88
+ class TaskRunner:
89
89
  """
90
90
  A class for running tasks on multiple fonts.
91
91
 
@@ -162,7 +162,7 @@ class TaskRunner: # pylint: disable=too-few-public-methods
162
162
  def _execute_task(self, font: Font) -> bool:
163
163
  try:
164
164
  return bool(self.task(font, **self.config.task_options))
165
- except Exception as e: # pylint: disable=broad-except
165
+ except Exception as e:
166
166
  self._log_error(e)
167
167
  return False
168
168
 
@@ -181,7 +181,7 @@ class TaskRunner: # pylint: disable=too-few-public-methods
181
181
  out_file = self._get_out_file_name(font)
182
182
  font.save(out_file, reorder_tables=self.config.save_options.reorder_tables)
183
183
  logger.success(f"File saved to {out_file}")
184
- except Exception as e: # pylint: disable=broad-except
184
+ except Exception as e:
185
185
  self._log_error(e)
186
186
 
187
187
  def _get_out_file_name(self, font: Font) -> Path:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: foundrytools-cli
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: A set of command line tools to inspect, manipulate and convert font files
5
5
  Author: Cesare Gilento
6
6
  Author-email: Cesare Gilento <ftcli@proton.me>
@@ -11,23 +11,25 @@ Classifier: Intended Audience :: End Users/Desktop
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
19
- Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3.15
20
19
  Classifier: Topic :: Text Processing :: Fonts
21
- Requires-Dist: afdko>=4.0.3
22
- Requires-Dist: click>=8.3.1
20
+ Requires-Dist: afdko==4.0.3
21
+ Requires-Dist: click>=8.5.0
23
22
  Requires-Dist: foundrytools>=0.1.6
24
23
  Requires-Dist: loguru>=0.7.3
25
24
  Requires-Dist: pathvalidate>=3.3.1
26
- Requires-Dist: rich>=14.3.0
27
- Requires-Dist: ufolib2>=0.18.1
28
- Requires-Dist: win32-setctime>=1.2.0 ; sys_platform >= 'win32'
29
- Requires-Python: >=3.10
25
+ Requires-Dist: rich>=15.0.0
26
+ Requires-Dist: ufolib2>=0.19.0
27
+ Requires-Dist: win32-setctime>=1.2.0 ; sys_platform == 'win32'
28
+ Requires-Dist: sphinx-click>=6.2.0 ; extra == 'docs'
29
+ Requires-Dist: sphinx-rtd-theme>=3.0.2 ; extra == 'docs'
30
+ Requires-Python: >=3.11
30
31
  Project-URL: Homepage, https://github.com/ftCLI/FoundryTools-CLI
32
+ Provides-Extra: docs
31
33
  Description-Content-Type: text/markdown
32
34
 
33
35
  # FoundryTools-CLI
@@ -54,10 +56,7 @@ rendered by [rich](https://github.com/Textualize/rich).
54
56
 
55
57
  ## Installation
56
58
 
57
- FoundryTools-CLI requires Python 3.10 or later.
58
-
59
- **IMPORTANT**: If you have Python 2.x installed in your system, you may have to use `python3`
60
- (instead of `python`) in the commands below.
59
+ FoundryTools-CLI requires Python 3.11 or later.
61
60
 
62
61
  ### pip
63
62
 
@@ -71,25 +70,20 @@ python -m pip install foundrytools-cli
71
70
  ### Editable mode
72
71
 
73
72
  If you would like to contribute to the development, you can clone the repository from GitHub,
74
- install the package in 'editable' mode and modify the source code in place. We strongly recommend
75
- using a virtual environment.
73
+ install the package in 'editable' mode and modify the source code in place. Install
74
+ [uv](https://docs.astral.sh/uv/getting-started/installation/) first to create the project
75
+ environment.
76
76
 
77
77
  ```
78
78
  # clone the repository:
79
79
  git clone https://github.com/ftCLI/foundrytools-cli.git
80
80
  cd foundrytools-cli
81
81
 
82
- # create new virtual environment named e.g. ftcli-venv, or whatever you prefer:
83
- python -m venv ftcli-venv
84
-
85
- # to activate the virtual environmtnet in macOS and Linux, do:
86
- . ftcli-venv/bin/activate
87
-
88
- # to activate the virtual environment in Windows, do:
89
- ftcli-venv\Scripts\activate.bat
82
+ # install the project and development tools in a managed environment:
83
+ uv sync --locked --group dev
90
84
 
91
- # install in 'editable' mode
92
- python -m pip install -e .
85
+ # run the CLI:
86
+ uv run ftcli --help
93
87
  ```
94
88
 
95
89
  ## Documentation
@@ -1,5 +1,5 @@
1
- foundrytools_cli/__init__.py,sha256=i1uy8O-ZaC0VuzLXA73K93OtyWZxyI5uM66NadI4q9s,55
2
- foundrytools_cli/__main__.py,sha256=KbGmBzK1G41I6uLPlw4tOWcN4KBdN3t-9JP7-JdiBa8,1319
1
+ foundrytools_cli/__init__.py,sha256=piRNIMDwxlVsenO9vEcQRdlc_hlbUDikT3wDfiEQIEI,55
2
+ foundrytools_cli/__main__.py,sha256=wN2lDr2iQyzfnOP00_P3DyXIxEBbf6K_cuzX5YFH5Fg,1273
3
3
  foundrytools_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  foundrytools_cli/commands/cff.py,sha256=6eEZydw0ZyISjYuV0JObmNBI7ijdEvVatKwWc8FM5vw,3386
5
5
  foundrytools_cli/commands/cmap.py,sha256=ZJYtBScffEfcUYaz0RDyL7dwO6X8klJJXVMSQ_AZJ8I,1236
@@ -7,7 +7,7 @@ foundrytools_cli/commands/converter/__init__.py,sha256=4p2HoanTsHRDQBYod4dYIFreH
7
7
  foundrytools_cli/commands/converter/cli.py,sha256=COKL9P908wYcRpyO5l7KxCmLVwdfF-RVsp9WtvmMCWk,12994
8
8
  foundrytools_cli/commands/converter/ttf_to_otf.py,sha256=O_TllaYLymwOEImhbq8PRE2IpWVdkiajYmCmAxRamBo,7622
9
9
  foundrytools_cli/commands/fix/__init__.py,sha256=1kJOW26OAkCYYvYDG2H9sCSqqQUQEtwzyxAqCrNfKeU,69
10
- foundrytools_cli/commands/fix/cli.py,sha256=lKdpDt0zyvx4czBEVOWk1XeL9CHQ68sntt1zJPXv_oE,17620
10
+ foundrytools_cli/commands/fix/cli.py,sha256=bcmppksAZ_vkV5ZyHiCw-B3ukEbul20h5i3A5NfcYhA,17578
11
11
  foundrytools_cli/commands/fix/legacy_accents.py,sha256=pUHWxV-a2GZgI8W_K2u-lu2yMQt5YKEpQHUD9FyKl8A,2094
12
12
  foundrytools_cli/commands/fix/vertical_metrics.py,sha256=j563oWfe3znOKuEW333Yx60d_14Nt0cGdXg3mkCTIN8,691
13
13
  foundrytools_cli/commands/font.py,sha256=Ee5yi_QkvfpCJv-HruHa3F9L0jXSXJYXVXvHuAumK_A,8240
@@ -24,15 +24,15 @@ foundrytools_cli/commands/print/font_names.py,sha256=x2g8wjFK7qx8wLBLV5URNWARAmf
24
24
  foundrytools_cli/commands/print/vf_instances.py,sha256=vpp3sMyCcNh9f6CBbOn5lnWr4nzNaIX_ANvyw6R2zWY,1398
25
25
  foundrytools_cli/commands/ttf.py,sha256=0ZJc36MM8m12_reMVD6GS5ZpSt84g_9RpXrKz_zqqfI,2151
26
26
  foundrytools_cli/commands/utils/__init__.py,sha256=bF8Ue4I4QAaDplSpDSMvtb4AZMWjcYsTNIL5ZBp6-t8,71
27
- foundrytools_cli/commands/utils/cli.py,sha256=On8hr-x7ZFobaQPws76b4_l1mxMvsdFZulNZxNDIhbY,3941
27
+ foundrytools_cli/commands/utils/cli.py,sha256=OKX4FEzcDP9DZHyAk0tN2vuFoQ__BtmvIfP34hbsEYE,3685
28
28
  foundrytools_cli/commands/utils/font_organizer.py,sha256=9biz8Cxg81qNGtK53zp4xhgncbItE5xRXBL1Y1ZWHqg,4096
29
- foundrytools_cli/commands/utils/font_renamer.py,sha256=2b9AW98uhwaHc_fWdy8NRVuWcRhWqgi_XIqDuqG_c4I,5814
30
- foundrytools_cli/commands/utils/sync_timestamps.py,sha256=mgmuX6-X07c1mw0pyBqG694_mQiBZjpPolBEjxa8Wvc,4127
29
+ foundrytools_cli/commands/utils/font_renamer.py,sha256=eEWT_1CCXu0mRXTOx5okUQ1NJrqs2RiG-TsRhbAMoRw,5755
30
+ foundrytools_cli/commands/utils/sync_timestamps.py,sha256=h9BMafxlmFllXKyrqBwibQIupS_d2Rp0TXEIfjk7UZQ,3989
31
31
  foundrytools_cli/utils/__init__.py,sha256=m-jBbONfS-_WMbpql8GV_1KufNoWOLQuNQtqErH-WmQ,7962
32
32
  foundrytools_cli/utils/logger.py,sha256=ZjVgZ1AmzwwH1GEnBU1HP-pFvZv0BKkVV93P2gYvnLc,525
33
- foundrytools_cli/utils/task_runner.py,sha256=_lulXNBbjNoTgIXpnoqPeuBFWDI0K8v2roAdX8y-mOI,7113
33
+ foundrytools_cli/utils/task_runner.py,sha256=CXVItMJTslNuie_rhPpZrQBX5rgkWbAWX805dFIBInA,6965
34
34
  foundrytools_cli/utils/timer.py,sha256=i_E1nM4KuooZwT2_2bkNJCxLrSKBaQCIMaHxTHY-Hzs,1870
35
- foundrytools_cli-2.1.0.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
36
- foundrytools_cli-2.1.0.dist-info/entry_points.txt,sha256=sNn6z8yZnx3Koh85LS6BYDqzaXZSP4KEvN3AdFGYRao,57
37
- foundrytools_cli-2.1.0.dist-info/METADATA,sha256=F1K8Lg3yy70RIbeVm0ruGdMMarsQmcONCOYotIW17nM,3982
38
- foundrytools_cli-2.1.0.dist-info/RECORD,,
35
+ foundrytools_cli-2.2.0.dist-info/WHEEL,sha256=9IUYslYuG_asT4WlWvfk_K76nveuLvSTKDoLeL0cV-Q,80
36
+ foundrytools_cli-2.2.0.dist-info/entry_points.txt,sha256=sNn6z8yZnx3Koh85LS6BYDqzaXZSP4KEvN3AdFGYRao,57
37
+ foundrytools_cli-2.2.0.dist-info/METADATA,sha256=qe-pXLQXlBlh_7Z9QUQAv5VPIk6mkszxwcGvrsHfa5I,3777
38
+ foundrytools_cli-2.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.26
2
+ Generator: uv 0.13.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any