fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing toc items.
[librarian.git]
/
src
/
librarian
/
command_line.py
diff --git
a/src/librarian/command_line.py
b/src/librarian/command_line.py
index
91196f1
..
e7021bb
100644
(file)
--- a/
src/librarian/command_line.py
+++ b/
src/librarian/command_line.py
@@
-9,7
+9,7
@@
def main(*args, **kwargs):
parser.add_argument(
'builder',
parser.add_argument(
'builder',
- choices=
[b.identifier for b in builders]
,
+ choices=
builders.keys()
,
help="Builder"
)
parser.add_argument('input_file')
help="Builder"
)
parser.add_argument('input_file')
@@
-22,7
+22,15
@@
def main(*args, **kwargs):
help='specifies the directory for output'
)
help='specifies the directory for output'
)
+ parser.add_argument(
+ '--mp3',
+ metavar="FILE",
+ nargs="*",
+ help='specifies an MP3 file, if needed'
+ )
+
args = parser.parse_args()
args = parser.parse_args()
+ builder = builders[args.builder]
if args.output_file:
output_file_path = args.output_file
if args.output_file:
output_file_path = args.output_file
@@
-38,6
+46,12
@@
def main(*args, **kwargs):
))
document = WLDocument(filename=args.input_file)
))
document = WLDocument(filename=args.input_file)
- output = document.build(args.builder)
+
+ builder = builders[args.builder]
+ kwargs = {
+ "mp3": args.mp3,
+ }
+
+ output = document.build(builder, **kwargs)
with open(output_file_path, 'wb') as f:
f.write(output.get_bytes())
with open(output_file_path, 'wb') as f:
f.write(output.get_bytes())