diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-02 12:40:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-02 12:40:39 +0300 |
commit | 8dc2b2020ec745d33575c35821f8279d351519f2 (patch) | |
tree | a3c9a8f779bfa9513f123e48dd86df8594614878 /hercules/code/configutils.py | |
parent | 58d6b3709c95a0ea1b3f97c99a29f7b529e647dc (diff) | |
download | tools-8dc2b2020ec745d33575c35821f8279d351519f2.tar.gz tools-8dc2b2020ec745d33575c35821f8279d351519f2.tar.bz2 tools-8dc2b2020ec745d33575c35821f8279d351519f2.tar.xz tools-8dc2b2020ec745d33575c35821f8279d351519f2.zip |
hercules: move config write functions to separate file.
Diffstat (limited to 'hercules/code/configutils.py')
-rw-r--r-- | hercules/code/configutils.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hercules/code/configutils.py b/hercules/code/configutils.py new file mode 100644 index 0000000..a20f3a0 --- /dev/null +++ b/hercules/code/configutils.py @@ -0,0 +1,27 @@ +# -*- coding: utf8 -*- +# +# Copyright (C) 2014 Evol Online +# Author: Andrei Karas (4144) + +def writeIntField(w, name, value): + if value == "": + value = "0" + w.write(" {0}: {1}\n".format(name, value)) + +def writeStrField(w, name, value): + w.write(" {0}: \"{1}\"\n".format(name, value)) + +def writeSubField(w, name, value): + w.write(" {0}: {1}\n".format(name, value)); + +def writeStartBlock(w, text): + w.write(" {0}: {{\n".format(text)); + +def writeEndBlock(w): + w.write(" }\n"); + +def writeStartScript(w, name): + w.write(" {0}: <\"\n".format(name)) + +def writeEndScript(w): + w.write(" \">\n") |