1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-08-20 03:51:20 +02:00

Added set_machine.py.

Corrected usage messages to include dibond.
This commit is contained in:
Chris Palmer
2016-01-02 13:54:07 +00:00
parent 83c6659172
commit de869520a9
4 changed files with 33 additions and 11 deletions

23
set_machine.py Normal file
View File

@@ -0,0 +1,23 @@
#!/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)