From 2421824535f466127851fe7dccd3dd4918e52250 Mon Sep 17 00:00:00 2001 From: Ross Hendrickson Date: Sun, 18 Aug 2013 01:19:55 -0500 Subject: [PATCH] Outputing ini file parameters to the subprocess --- octoprint/cura/__init__.py | 4 +++- octoprint/cura/parser.py | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/octoprint/cura/__init__.py b/octoprint/cura/__init__.py index 6e9f34c0..7b60968d 100644 --- a/octoprint/cura/__init__.py +++ b/octoprint/cura/__init__.py @@ -57,12 +57,14 @@ class CuraEngine(object): logging.info("Slicing call back complete:%s" % str(call_back)) - args = [self.cura_path, '-o', gcode, file_path] + args = [self.cura_path, '-o', gcode] settings = parser.process_profile_ini(config) args.extend(settings) + args.extend([file_path]) + logging.info('CuraEngine args:%s' % str(args)) thread = threading.Thread(target=start_thread, args=(call_back, diff --git a/octoprint/cura/parser.py b/octoprint/cura/parser.py index f8d7ea5b..86e509fa 100644 --- a/octoprint/cura/parser.py +++ b/octoprint/cura/parser.py @@ -1,4 +1,5 @@ import logging +from StringIO import StringIO def process_profile_ini(filename): @@ -18,7 +19,6 @@ def process_profile_ini(filename): logging.info("Processing %s" % filename) for line in profile: - if _is_multi_start(line): read_multi_line(line, profile, data) @@ -32,7 +32,6 @@ def read_multi_line(line, profile, data): multi_line = line line = profile.readline() - if _is_multi_continue(line): multi_line += line @@ -44,7 +43,6 @@ def read_multi_line(line, profile, data): while(_is_multi_continue(line)): line = profile.readline() - if not line: break @@ -126,7 +124,7 @@ def format_data_for_command(data): def read_filename(filename): lines = open(filename, 'r').read() - return lines + return StringIO(lines) def _is_multi_start(line):