File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 20
20
import sys
21
21
import traceback
22
22
from pathlib import Path
23
- from typing import Generator , Tuple
23
+ from typing import Generator , Optional , Tuple
24
24
25
25
from pypdf import (
26
26
PageObject ,
33
33
def main (
34
34
filename : Path ,
35
35
output : Path ,
36
- inside_cover_file : Path ,
37
- centerfold_file : Path ,
36
+ inside_cover_file : Optional [ Path ] ,
37
+ centerfold_file : Optional [ Path ] ,
38
38
) -> None :
39
39
try :
40
40
# Set up the streams
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ def cat(
98
98
) -> None :
99
99
pdfly .cat .main (filename , fn_pgrgs , output , verbose )
100
100
101
+
101
102
@entry_point .command (name = "booklet" , help = pdfly .booklet .__doc__ ) # type: ignore[misc]
102
103
def booklet (
103
104
filename : Annotated [
@@ -114,27 +115,29 @@ def booklet(
114
115
dir_okay = False ,
115
116
exists = False ,
116
117
resolve_path = False ,
117
- )
118
+ ),
118
119
],
119
120
blank_page : Annotated [
120
121
Optional [Path ],
121
122
typer .Option (
122
- "-b" , "--blank-page-file" ,
123
+ "-b" ,
124
+ "--blank-page-file" ,
123
125
help = "page added if input is odd number of pages" ,
124
126
dir_okay = False ,
125
127
exists = True ,
126
128
resolve_path = True ,
127
129
),
128
130
] = None ,
129
131
centerfold : Annotated [
130
- Path ,
132
+ Optional [ Path ] ,
131
133
typer .Option (
132
- "-c" , "--centerfold-file" ,
134
+ "-c" ,
135
+ "--centerfold-file" ,
133
136
help = "double-page added if input is missing >= 2 pages" ,
134
137
dir_okay = False ,
135
138
exists = True ,
136
139
resolve_path = True ,
137
- )
140
+ ),
138
141
] = None ,
139
142
) -> None :
140
143
pdfly .booklet .main (filename , output , blank_page , centerfold )
You can’t perform that action at this time.
0 commit comments