diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100644 index 0000000..ff6ad07 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,3 @@ +#!/bin/bash +echo "Formatting all python files with Black" +black . \ No newline at end of file diff --git a/README.md b/README.md index 6119057..955bd72 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# Nginx configurator (patent for that name is pending...) \ No newline at end of file +# Nginx configurator (patent for that name is pending...) + + + +# Contributions +Please use `black` formatter. \ No newline at end of file diff --git a/n-gen.py b/n-gen.py index f910d40..dfe72a2 100755 --- a/n-gen.py +++ b/n-gen.py @@ -1,17 +1,18 @@ import json import pyinputplus as pyip +from jinja2 import Environment, PackageLoader, select_autoescape # Get clusters from json config with open("clusters.json") as json_file: CLUSTERS = json.load(json_file)["clusters"] # Setup Jinja2 -from jinja2 import Environment, PackageLoader, select_autoescape jin = Environment(loader=PackageLoader("n-gen"), autoescape=select_autoescape()) -# ID of next config - TBD +# ID of next config - TBD - read this from list of configs and increment! CONF_ID = 1 + def get_domains(): new_domain = True domains = []