Commit e038d1ae authored by Nicolas Chauvat's avatar Nicolas Chauvat

Make pybill executable with python -m

parent 6cceb8ccac4
Pipeline #10954 passed with stage
in 41 seconds
#!/usr/bin/env python
from pybill import main
main.run()
#!/bin/sh
exec python3 -m pybill $@
# -*- coding: utf-8 -*-
"""
``pybill.main`` is a module that contains the main program of PyBill.
Basically, this program just contains the correct run function that will be run
by the binary scripts. Currently, this run function is the
:func:`~pybill.commandline.ui.run` function from :mod:`pybill.commandline.ui`
module.
This module can be executed and just runs the run function described above.
"""
__docformat__ = "restructuredtext en"
from pybill.commandline.ui import run
if __name__ == "__main__":
run()
......@@ -53,7 +53,7 @@ def run():
uses an :class:`optparse.OptionParser` object.
"""
# Defines the parser of the command line options
usage = "Usage: %prog [options] accounting_files"
usage = "Usage: pybill [options] file1.xml [file2.xml] [...]"
desc = (
"Generate a PDF representation of accounting documents (bills, "
"etc.) The accounting documents are XML documents in a 'PyBill "
......@@ -157,7 +157,9 @@ def run():
)
if options.gen_entries:
controller.export_accounting_entries_to_xml_file(
[doc for doc, _ in acc_docs], options.entries_file, options.xml_encoding
[doc for doc, _ in acc_docs],
options.entries_file,
options.xml_encoding,
)
except PyBillException as exc:
if not options.debug:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment