def __init__(self, path, stitches_only=False, show_jumps=False): self.jef = jef.Pattern(path) self.stitches_only = stitches_only self.show_jumps = show_jumps self.move_pen = QPen() self.move_pen.setStyle(Qt.DotLine)
def openFile(self, path): path = unicode(path) self.pattern = jef.Pattern(path) qApp.setOverrideCursor(Qt.WaitCursor) self.path = path self.colourDockWidget.setPattern(self.pattern) self.canvas.setRenderer( Renderer(self.pattern, self.colourModel, self.stitches_only)) self.setWindowTitle( self.tr("%1 - Viewer for Janome Embroidery Files [*]").arg(path)) qApp.restoreOverrideCursor()
def open_file(self, path): # TODO unicode # path = unicode(path) self.pattern = jef.Pattern(path) # TODO Check this self.info_popup.update_values(self.pattern) qApp.setOverrideCursor(Qt.WaitCursor) self.path = path self.colorDockWidget.set_pattern(self.pattern) self.canvas.setRenderer( Renderer(self.pattern, self.colorModel, self.stitches_only)) self.setWindowTitle( "{} - Viewer for Janome Embroidery Files [*]".format(path)) qApp.restoreOverrideCursor()
so, si = subprocess.Popen(['find', path, '-name "', pattern, '"']) si.close() return so.readlines() if __name__ == "__main__": if len(sys.argv) != 2: sys.stderr.write("Usage: %s <search path>\n" % sys.argv[0]) sys.exit(1) search_path = sys.argv[1] paths = [] paths += map(lambda line: line.strip(), find_files(search_path, "*.jef")) paths += map(lambda line: line.strip(), find_files(search_path, "*.JEF")) for path in paths: j = jef.Pattern(path) for i in range(len(j.colors)): if not jef.jef_colors.colors.has_key(j.colors[i]): if jef.jef_colors.measured_colors.colors.has_key(j.colors[i]): print path, i + 1, hex(j.colors[i]), "(measured value)" else: print path, i + 1, hex(j.colors[i]) sys.exit()
def __init__(self, path, stitches_only=False): self.jef = jef.Pattern(path) self.stitches_only = stitches_only self.rect = QRect()
elif len(sys.argv) == 4: max_stitch_length = min(max(1.0, float(sys.argv[1])), 127.0) svg_file = sys.argv[2] jef_file = sys.argv[3] else: max_stitch_length = 127.0 svg_file = sys.argv[1] jef_file = sys.argv[2] app = QCoreApplication(sys.argv) reader = PathReader(svg_file) paths = reader.read() pattern = jef.Pattern() pattern.threads = len(paths) groups, known, default, mappings = jef_colours.read_colours() inverse_mappings = {} for internal_code, group_colour in mappings.items(): for group, colour_code in group_colour.items(): inverse_mappings[(group, colour_code)] = internal_code colours = {} for group in groups: if not known.has_key(group): continue