1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-08-26 06:24:24 +02:00

Merge pull request #2 from sevikkk/linux-run

Changes to make linux happy
This commit is contained in:
Chris
2012-03-12 15:48:10 -07:00
4 changed files with 17 additions and 6 deletions

4
bom.py
View File

@@ -1,7 +1,7 @@
import os import os
import subprocess
import sys import sys
import shutil import shutil
import openscad
class BOM(): class BOM():
def __init__(self): def __init__(self):
@@ -95,7 +95,7 @@ def boms(machine):
f. write("include <%s_config.scad>\n" % machine); f. write("include <%s_config.scad>\n" % machine);
f.close() f.close()
subprocess.call(["openscad_cl", "-o", "dummy.stl", "scad/bom.scad"]) openscad.run("-o", "dummy.csg", "scad/bom.scad")
print "Generating bom ...", print "Generating bom ...",
main = BOM() main = BOM()

11
openscad.py Normal file
View File

@@ -0,0 +1,11 @@
import subprocess
import os
def run(*args):
if os.name == "nt":
subprocess.call(["openscad_cl"] + list(args))
else:
log = open("openscad.log", "w")
subprocess.call(["openscad"] + list(args), stdout = log, stderr = log)
log.close()

View File

@@ -1,5 +1,5 @@
import os import os
import subprocess import openscad
import shutil import shutil
import sys import sys
from dxf import * from dxf import *
@@ -49,7 +49,7 @@ def sheets(machine):
# Run openscad on the created file # Run openscad on the created file
# #
dxf_name = target_dir + "/" + module[:-4] + ".dxf" dxf_name = target_dir + "/" + module[:-4] + ".dxf"
subprocess.call(["openscad_cl", "-o", dxf_name, dxf_maker_name]) openscad.run("-o", dxf_name, dxf_maker_name)
dxf_to_svg(dxf_name) dxf_to_svg(dxf_name)
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -1,5 +1,5 @@
import os import os
import subprocess import openscad
import shutil import shutil
import sys import sys
@@ -58,7 +58,7 @@ def stls(machine):
# Run openscad on the created file # Run openscad on the created file
# #
stl_name = target_dir + "/" + module[:-4] + ".stl" stl_name = target_dir + "/" + module[:-4] + ".stl"
subprocess.call(["openscad_cl", "-o", stl_name, stl_maker_name]) openscad.run("-o", stl_name, stl_maker_name)
targets.remove(module) targets.remove(module)
# #