<commit_before>import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import makerbot_driver

import serial
import serial.tools.list_ports as lp
import optparse

parser = optparse.OptionParser()
parser.add_option("-f", "--filename", dest="filename",
                  help="gcode file to print", default=False)
parser.add_option("-s", "--gcode_start_end_sequences", dest="start_end_sequences",
                  help="run gcode start and end proceeses", default=True)
parser.add_option("-m", "--machine", dest="machine",
                  help="machine you want to connect to", default="ReplicatorDual")
(options, args) = parser.parse_args()

md = makerbot_driver.MachineDetector()
md.scan(options.machine)
port = md.get_first_machine()
if port is None:
  print "Cant Find %s" %(options.machine)
  sys.exit()

factory = makerbot_driver.BotFactory()
r, prof = factory.build_from_port(port)

assembler = makerbot_driver.GcodeAssembler(prof)
start, end, variables = assembler.assemble_recipe()
start_gcode = assembler.assemble_start_sequence(start)
end_gcode = assembler.assemble_end_sequence(end)

parser = makerbot_driver.Gcode.GcodeParser()
parser.environment.update(variables)<commit_msg>fixed machien name<commit_after>import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import makerbot_driver

import serial
import serial.tools.list_ports as lp
import optparse

parser = optparse.OptionParser()
parser.add_option("-f", "--filename", dest="filename",
                  help="gcode file to print", default=False)
parser.add_option("-s", "--gcode_start_end_sequences", dest="start_end_sequences",
                  help="run gcode start and end proceeses", default=True)
parser.add_option("-m", "--machine", dest="machine",
                  help="machine you want to connect to", default="The Replicator")
(options, args) = parser.parse_args()

md = makerbot_driver.MachineDetector()
md.scan(options.machine)
port = md.get_first_machine()
if port is None:
  print "Cant Find %s" %(options.machine)
  sys.exit()

factory = makerbot_driver.BotFactory()
r, prof = factory.build_from_port(port)

assembler = makerbot_driver.GcodeAssembler(prof)
start, end, variables = assembler.assemble_recipe()
start_gcode = assembler.assemble_start_sequence(start)
end_gcode = assembler.assemble_end_sequence(end)

parser = makerbot_driver.Gcode.GcodeParser()
parser.environment.update(variables)
{'fraction_non_alphanumeric': 0.12648870636550308, 'fraction_numerical': 0.0, 'mean_word_length': 5.1206030150753765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1068754', 'n_tokens_mistral': 781, 'n_tokens_neox': 771, 'n_words': 168}