Last active
September 12, 2015 13:47
-
-
Save AlexandreProenca/caa7ae4914d8bebd0dc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open(args.project_name + r'/settings.py', 'wt') as fout: | |
with open(resource_filename('robot_rest', 'settings.tpl'), 'rt') as fin: | |
for line in fin: | |
if '@projeto@' in line: | |
fout.write(line.replace('@projeto@', args.project_name)) | |
elif '@HOST@' in line: | |
fout.write(line.replace('@HOST@', args.database_host)) | |
elif '@USER@' in line: | |
fout.write(line.replace('@USER@', args.database_user)) | |
elif '@PASSWORD@' in line: | |
fout.write(line.replace('@PASSWORD@', args.database_password)) | |
elif '@NAME@' in line: | |
fout.write(line.replace('@NAME@', args.database_name)) | |
else: | |
fout.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment