diff facturation.py @ 5:10333ba7d53a draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/facturation_ibps commit 2f48d2b0d72cdd8f521ff4dee38590e91afc4bf8
author artbio
date Wed, 09 Jan 2019 13:16:44 -0500
parents ddc7b8073704
children b8460b9f4253
line wrap: on
line diff
--- a/facturation.py	Thu Nov 22 07:55:53 2018 -0500
+++ b/facturation.py	Wed Jan 09 13:16:44 2019 -0500
@@ -15,11 +15,13 @@
                             help="input html code to convert to xlsx")
     the_parser.add_argument('--output', '-o', action='store', type=str,
                             help='xlsx converted file')
+    the_parser.add_argument('--template', '-t', action='store', type=str,
+                            help='xlsx template file')
     args = the_parser.parse_args()
     return args
 
 
-def main(input_file, output_file):
+def main(template, input_file, output_file):
     """Script de parsing des fichiers de facturation de l'IBPS"""
 
     # ouverture fichier input
@@ -64,7 +66,7 @@
 
     # ouverture fichier output
     facture_output = openpyxl.load_workbook(
-        'template_facture.xlsx', data_only=False, keep_vba=False)
+        template, data_only=False, keep_vba=False)
     ws = facture_output.worksheets[0]
 
     # rajout de l'image de SU qui ne survit pas à la conversion
@@ -105,4 +107,4 @@
 
 if __name__ == '__main__':
     args = Parser()
-    main(args.input, args.output)
+    main(args.template, args.input, args.output)