1
1
#!/usr/bin/env python3
2
2
3
3
"""
4
- The app.py module defines a main() function that includes the logic for the `font-line` command line executable.
4
+ The app.py module defines a main() function that includes the logic for the `font-line`
5
+ command line executable.
5
6
6
- This command line executable modifies the line spacing metrics in one or more fonts that are provided as command
7
+ This command line executable modifies the line spacing metrics in one or more fonts that
8
+ are provided as command
7
9
line arguments to the executable. It currently supports .ttf and .otf font builds.
8
10
"""
9
11
20
22
)
21
23
from fontline .utilities import file_exists , is_supported_filetype
22
24
23
- # TODO: support integer addition and subtraction to the metrics values through new sub-commands
24
- # TODO: JSON formatted metrics output
25
-
26
25
27
26
def main ():
28
27
"""Defines the logic for the `font-line` command line executable"""
@@ -48,7 +47,8 @@ def main():
48
47
if c .subcmd == "report" :
49
48
if c .argc < 2 :
50
49
stderr (
51
- "[font-line] ERROR: Missing file path argument(s) after the report subcommand."
50
+ "[font-line] ERROR: Missing file path argument(s) after the "
51
+ "report subcommand."
52
52
)
53
53
sys .exit (1 )
54
54
else :
@@ -84,13 +84,14 @@ def main():
84
84
) # test that the argument can be cast to an integer value
85
85
if percent_int <= 0 :
86
86
stderr (
87
- "[font-line] ERROR: Please enter a percent value that is greater than zero."
87
+ "[font-line] ERROR: Please enter a percent value that is "
88
+ "greater than zero."
88
89
)
89
90
sys .exit (1 )
90
91
if percent_int > 100 :
91
92
stdout (
92
- "[font-line] Warning: You entered a percent value over 100%. Please confirm that this is "
93
- "your intended metrics modification."
93
+ "[font-line] Warning: You entered a percent value over 100%. "
94
+ "Please confirm that this is your intended metrics modification."
94
95
)
95
96
except ValueError :
96
97
stderr (
@@ -131,7 +132,7 @@ def main():
131
132
)
132
133
else :
133
134
stderr (
134
- "[font-lines] ERROR: You used an unsupported argument to the executable. Please review the "
135
- " `font-line --help` documentation and try again."
135
+ "[font-lines] ERROR: You used an unsupported argument to the executable. "
136
+ "Please review the `font-line --help` documentation and try again."
136
137
)
137
138
sys .exit (1 )
0 commit comments