-
Notifications
You must be signed in to change notification settings - Fork 12
/
gen_oasis.py
64 lines (46 loc) · 1.63 KB
/
gen_oasis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ************************************************************
#
# IMITATOR
#
# Create the _oasis file for IMITATOR
#
# Etienne Andre
#
# Université Sorbonne Paris Nord, LIPN, CNRS, France
#
# Created : 2014/08/18
# Last modified: 2014/08/18
# ************************************************************
# This script copies oasis-config into _oasis
# ************************************************************
# IMPORTS
# ************************************************************
from __future__ import print_function
# ************************************************************
# CONSTANTS
# ************************************************************
# Files
input_file_path = 'oasis-config'
output_file_path = '_oasis'
# WARNING: the rest of this file is identical to gen_oasis_distr.py
header = """\
############################################################
# WARNING! This file has been automatically generated; do not modify it!
# Modify {} instead
############################################################
""".format(input_file_path)
def write_to_oasis(input_file, output_file):
# Open file
with open(input_file) as old_file, open(output_file, 'w') as new_file:
# Add header
new_file.write(header)
# Copy file
new_file.write(old_file.read())
print('Successfully generated file %s.' % output_file_path)
# ************************************************************
# GO
# ************************************************************
if __name__ == '__main__':
write_to_oasis(input_file_path, output_file_path)