コード例 #1
0
    def potraceBitmap(self):
        p = os.getcwd()
        systemType = platform.system()
        th = float(self.ui.slideThr.value()) / 100
        self.svgout = self.bitmapFile + ".svg"
        if "Windows" in systemType:
            #cmd = "potrace.exe -k %f -t 5 -s -o %s %s" %(th,self.svgout,self.bitmapFile)
            p = robot_gui.getPkgPath("potrace.exe")
            cmd = "%s -k %f -t 5 -s -o %s %s" % (p, th, self.svgout,
                                                 self.bitmapFile)

        elif "Darwin" in systemType:
            p = robot_gui.getPkgPath("potrace")
            cmd = "%s -k %f -t 5 -s -o %s %s" % (p, th, self.svgout,
                                                 self.bitmapFile)
        # todo: work in unicode only??
        print cmd.__class__
        print cmd.encode('utf-8')
        p = subprocess.Popen(cmd,
                             stdin=subprocess.PIPE,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE,
                             shell=True)
        p.wait()
        self.convertSig.emit("potrace")
        """
コード例 #2
0
ファイル: SvgConverter.py プロジェクト: abos/mDrawBot
 def potraceBitmap(self):
     p = os.getcwd()
     systemType = platform.system()
     th = float(self.ui.slideThr.value())/100
     self.svgout = self.bitmapFile+".svg"
     if "Windows" in systemType:
         #cmd = "potrace.exe -k %f -t 5 -s -o %s %s" %(th,self.svgout,self.bitmapFile)
         p  = robot_gui.getPkgPath("potrace.exe")
         cmd = "%s -k %f -t 5 -s -o %s %s" %(p,th,self.svgout,self.bitmapFile)
         
     elif "Darwin" in systemType:
         p  = robot_gui.getPkgPath("potrace")
         cmd = "%s -k %f -t 5 -s -o %s %s" %(p,th,self.svgout,self.bitmapFile)
     # todo: work in unicode only??
     print cmd.__class__
     print cmd.encode('utf-8')
     p = subprocess.Popen(cmd,stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
     p.wait()
     self.convertSig.emit("potrace")
     """
コード例 #3
0
ファイル: HexDownloader.py プロジェクト: Carlitos71/mDrawBot
 def startDownloadUno(self, com, hexfile):
     systemType = platform.system()
     if "Windows" in systemType:
         avrdudepath = robot_gui.getPkgPath("avrdude.exe")
         confpath = robot_gui.getPkgPath("avrdude.conf")
         hexfile = robot_gui.getPkgPath(hexfile)
     elif "Darwin" in systemType:
         avrdudepath = robot_gui.getPkgPath("avrdude")
         confpath = robot_gui.getPkgPath("avrdude.conf")
         hexfile = robot_gui.getPkgPath(hexfile)
     elif "Linux" in systemType:
         avrdudepath = '/usr/bin/avrdude'
         confpath = robot_gui.getPkgPath("avrdude.linux.conf")
         hexfile = robot_gui.getPkgPath(hexfile)
     cmd = u"%s -C%s -v -v -v -v -patmega328p -carduino -P%s -b115200 -D -Uflash:w:%s:i" %(avrdudepath,confpath,com,hexfile)
     self.moveListThread = WorkInThread(self.downloadThread,cmd)
     self.moveListThread.setDaemon(True)
     self.moveListThread.start()
コード例 #4
0
 def startDownloadUno(self, com, hexfile):
     systemType = platform.system()
     if "Windows" in systemType:
         avrdudepath = robot_gui.getPkgPath("avrdude.exe")
         confpath = robot_gui.getPkgPath("avrdude.conf")
         hexfile = robot_gui.getPkgPath(hexfile)
     elif "Darwin" in systemType:
         avrdudepath = robot_gui.getPkgPath("avrdude")
         confpath = robot_gui.getPkgPath("avrdude.conf")
         hexfile = robot_gui.getPkgPath(hexfile)
     cmd = u"%s -C%s -v -v -v -v -patmega328p -carduino -P%s -b115200 -D -Uflash:w:%s:i" %(avrdudepath,confpath,com,hexfile)
     self.moveListThread = WorkInThread(self.downloadThread,cmd)
     self.moveListThread.setDaemon(True)
     self.moveListThread.start()