2 # ______ _____ _ _ _____ _
3 # | ___ \ / ___| | | | |_ _| | |
4 # | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___
5 # | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __|
6 # | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \
7 # \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/
11 # Ryzom - MMORPG Framework <https://ryzom.com/dev/>
12 # Copyright (C) 2019 Winch Gate Property Limited
13 # This program is free software: read https://ryzom.com/dev/copying.html for more details
15 # This script is a helper to generate the configurations files of a ryzom shard
16 # just reading fields in a globals.cfg file and replacing it in all final cfgs files
18 # Usage are ./create_cfgs.py SHARD_PATH
27 dir_path
= os
.path
.dirname(os
.path
.realpath(__file__
))
29 templatepath
= dir_path
+"/templates/"
30 finalpath
= dstpath
+"/cfgs/"
34 with
open(dstpath
+"/globals.cfg", 'r', encoding
=enc
) as fd
:
36 lines
= fd
.read().split("\n")
44 for f
in os
.listdir(templatepath
):
45 with
open(templatepath
+f
, 'r', encoding
=enc
) as content
:
47 content
= content
.read()
49 content
= content
.replace(k
, v
)
50 with
open(finalpath
+f
, 'w') as fd
: