printrun-src/printrun/pronterface.py

changeset 19
234037fbca4b
parent 16
36d478bde840
child 20
03b34402d405
equal deleted inserted replaced
18:11f6d97f83b0 19:234037fbca4b
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details. 16 # GNU General Public License for more details.
17 # 17 #
18 # You should have received a copy of the GNU General Public License 18 # You should have received a copy of the GNU General Public License
19 # along with Printrun. If not, see <http://www.gnu.org/licenses/>. 19 # along with Printrun. If not, see <http://www.gnu.org/licenses/>.
20
21 from laser import Lasercutter
22 20
23 import os 21 import os
24 import Queue 22 import Queue
25 import sys 23 import sys
26 import time 24 import time
1377 recent_files = recent_files[:5] 1375 recent_files = recent_files[:5]
1378 self.set("recentfiles", json.dumps(recent_files)) 1376 self.set("recentfiles", json.dumps(recent_files))
1379 except: 1377 except:
1380 self.logError(_("Could not update recent files list:") + 1378 self.logError(_("Could not update recent files list:") +
1381 "\n" + traceback.format_exc()) 1379 "\n" + traceback.format_exc())
1380
1381 # import the library local so we dont have to restart the whole app when making code changes
1382 from laser import Lasercutter
1383
1382 if name.lower().endswith(".stl") or name.lower().endswith(".obj"): 1384 if name.lower().endswith(".stl") or name.lower().endswith(".obj"):
1383 self.slice(name) 1385 self.slice(name)
1384 elif name.lower().endswith(".png") or name.lower().endswith(".jpg") or name.lower().endswith(".gif"): 1386 elif name.lower().endswith(".png") or name.lower().endswith(".jpg") or name.lower().endswith(".gif"):
1385 # Generate GCODE from IMAGE 1387 # Generate GCODE from IMAGE
1386 lc = Lasercutter(pronterwindow = self) 1388 lc = Lasercutter(pronterwindow = self)

mercurial