From: Zaur Molotnikov Date: Fri, 30 Oct 2015 10:13:21 +0000 (+0100) Subject: Update to include preamble handling X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=7934f87b41c58bdd38a99297038bcc492c5471ba;p=stevenblack-hosts.git Update to include preamble handling --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..1baeb4f38 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +myhosts diff --git a/myhosts b/myhosts new file mode 100644 index 000000000..e69de29bb diff --git a/updateHostsFile.py b/updateHostsFile.py index a78825ddb..18a797db9 100755 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -277,6 +277,12 @@ def writeOpeningHeader(finalFile): writeData(finalFile, '\n') writeData(finalFile, '127.0.0.1 localhost\n') writeData(finalFile, '\n') + + preamble = os.path.join(BASEDIR_PATH, "myhosts"); + if os.path.isfile(preamble): + with open(preamble, "r") as f: + writeData(finalFile, f.read()); + finalFile.write(fileContents) def updateReadme(numberOfRules):