1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-01-16 20:38:15 +01:00
Mendel90/set_machine.py
Chris Palmer de869520a9 Added set_machine.py.
Corrected usage messages to include dibond.
2016-01-02 13:54:07 +00:00

24 lines
550 B
Python

#!/usr/bin/env python
from __future__ import print_function
import sys
def set_machine(machine):
text = "include <%s_config.scad>\n" % machine;
f = open("scad/conf/machine.scad","rt")
line = f.read()
f.close()
if line != text:
f = open("scad/conf/machine.scad","wt")
f. write(text);
f.close()
if __name__ == '__main__':
args = len(sys.argv)
if args == 2:
set_machine(sys.argv[1])
else:
print("usage: set_machine dibond|mendel|sturdy|huxley|your_machine")
sys.exit(1)