rename some script
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
Using this script it is possible to generate form letters from a template and an SQL query.
|
Using this script it is possible to generate form letters from a template and an SQL query.
|
||||||
|
|
||||||
A template file with some placeholder variables is required and an SQL query to be executed
|
A template file with some placeholder variables is required and an SQL query to be executed
|
||||||
against a MariaDB database. The column names from the query correspond to the variable names
|
against a MariaDB/MySQL database. The column names from the query correspond to the variable names
|
||||||
in the template.
|
in the template.
|
||||||
|
|
||||||
The template is processed using the Cheetah template (https://cheetahtemplate.org/) module, so simple variable placeholder
|
The template is processed using the Cheetah template (https://cheetahtemplate.org/) module, so simple variable placeholder
|
||||||
@ -58,5 +58,6 @@ configuration file.
|
|||||||
|
|
||||||
## Required modules
|
## Required modules
|
||||||
|
|
||||||
|
* Python 3
|
||||||
* mariadb
|
* mariadb
|
||||||
* cheetah3
|
* cheetah3
|
||||||
|
6
serienbrief.py → serienbrief
Normal file → Executable file
6
serienbrief.py → serienbrief
Normal file → Executable file
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import configparser
|
import configparser
|
||||||
import mariadb
|
import mariadb
|
||||||
@ -35,8 +37,8 @@ args = parser.parse_args()
|
|||||||
configFile = args.config
|
configFile = args.config
|
||||||
|
|
||||||
localConfig = {}
|
localConfig = {}
|
||||||
localConfig["queryFile"] = args.query
|
localConfig["queryFile"] = args.queryFile
|
||||||
localConfig["templateFile"] = args.template
|
localConfig["templateFile"] = args.templateFile
|
||||||
localConfig["outputPrefix"] = args.outputPrefix
|
localConfig["outputPrefix"] = args.outputPrefix
|
||||||
localConfig["outputSuffix"] = args.outputSuffix
|
localConfig["outputSuffix"] = args.outputSuffix
|
||||||
verbose = args.verbose
|
verbose = args.verbose
|
Reference in New Issue
Block a user