2 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 # + This file is part of enGrid. +
6 # + Copyright 2008-2014 enGits GmbH +
8 # + enGrid is free software: you can redistribute it and/or modify +
9 # + it under the terms of the GNU General Public License as published by +
10 # + the Free Software Foundation, either version 3 of the License, or +
11 # + (at your option) any later version. +
13 # + enGrid is distributed in the hope that it will be useful, +
14 # + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 # + GNU General Public License for more details. +
18 # + You should have received a copy of the GNU General Public License +
19 # + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25 def get_path(command
):
26 parts
= command
.split("/")
28 for i
in range(len(parts
) - 1):
29 path
= path
+ parts
[i
] + "/"
33 file_name
= get_path(sys
.argv
[0]) + "../licence_header.txt"
34 read_buf
= open(file_name
, "r").read()
35 lines
= read_buf
.split("\n")
38 lic
= lic
+ "// " + line
+ "\n"
41 def write_h(class_name
):
42 f
= open(class_name
.lower() + ".h", "w")
44 f
.write("#ifndef " + class_name
.upper() + "_H\n")
45 f
.write("#define " + class_name
.upper() + "_H\n")
47 f
.write("#include \"operation.h\"\n")
49 f
.write("class " + class_name
+ ";\n")
52 f
.write("class " + class_name
+ "\n")
56 f
.write("#endif // " + class_name
.upper() + "_H\n")
58 def write_cpp(class_name
):
59 f
= open(class_name
.lower() + ".cpp", "w")
61 f
.write("#include \"" + class_name
.lower() + ".h\"\n")
65 class_name
= sys
.argv
[1]