Commit 37e27101 authored by Kliment Yanev's avatar Kliment Yanev

Merge branch 'master' of github.com:kliment/Printrun into experimental

Conflicts:
	gcoder.py
parents 659cc031 71e5da00
...@@ -180,3 +180,5 @@ GNU General Public License for more details. ...@@ -180,3 +180,5 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Printrun. If not, see <http://www.gnu.org/licenses/>. along with Printrun. If not, see <http://www.gnu.org/licenses/>.
``` ```
All scripts should contain this license note, if not, feel free to ask us. Please note that files where it is difficult to state this license note (such as images) are distributed under the same terms.
...@@ -340,8 +340,9 @@ def main(): ...@@ -340,8 +340,9 @@ def main():
print "usage: %s filename.gcode" % sys.argv[0] print "usage: %s filename.gcode" % sys.argv[0]
return return
d = [i.replace("\n","") for i in open(sys.argv[1])] # d = [i.replace("\n","") for i in open(sys.argv[1])]
gcode = GCode(d) # gcode = GCode(d)
gcode = GCode(list(open(sys.argv[1])))
gcode.measure() gcode.measure()
...@@ -355,4 +356,3 @@ def main(): ...@@ -355,4 +356,3 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()
...@@ -388,7 +388,7 @@ if __name__ == '__main__': ...@@ -388,7 +388,7 @@ if __name__ == '__main__':
while p.printing: while p.printing:
time.sleep(1) time.sleep(1)
if statusreport: if statusreport:
sys.stdout.write("\b\b\b\b%02.1f%%" % (100 * float(p.queueindex) / len(p.mainqueue),) ) sys.stdout.write("%02.1f%%\r" % (100 * float(p.queueindex) / len(p.mainqueue),) )
sys.stdout.flush() sys.stdout.flush()
p.disconnect() p.disconnect()
sys.exit(0) sys.exit(0)
......
#!/usr/bin/env python #!/usr/bin/env python
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
from skeinforge.fabmetheus_utilities import archive from skeinforge.fabmetheus_utilities import archive
from skeinforge.fabmetheus_utilities import settings from skeinforge.fabmetheus_utilities import settings
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
# create a simple image slide show using the # create a simple image slide show using the
# wx.PaintDC surface as a canvas and # wx.PaintDC surface as a canvas and
# DrawBitmap(bitmap, x, y, bool transparent) # DrawBitmap(bitmap, x, y, bool transparent)
......
...@@ -18,26 +18,20 @@ url: ...@@ -18,26 +18,20 @@ url:
__author__ = 'Daniel Keep <daniel.keep.sp4msux0rz@gmail.com>' __author__ = 'Daniel Keep <daniel.keep.sp4msux0rz@gmail.com>'
__license__ = """ __license__ = """
This library is free software; you can redistribute it and/or This file is part of the Printrun suite.
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the Printrun is free software: you can redistribute it and/or modify
License, or (at your option) any later version. it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
As a special exception, the copyright holders of this library (at your option) any later version.
hereby recind Section 3 of the GNU Lesser General Public License. This
means that you MAY NOT apply the terms of the ordinary GNU General Printrun is distributed in the hope that it will be useful,
Public License instead of this License to any given copy of the but WITHOUT ANY WARRANTY; without even the implied warranty of
Library. This has been done to prevent users of the Library from being MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
denied access or the ability to use future improvements. GNU General Public License for more details.
This library is distributed in the hope that it will be useful, but You should have received a copy of the GNU General Public License
WITHOUT ANY WARRANTY; without even the implied warranty of along with Printrun. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
__all__ = ['BufferedCanvas'] __all__ = ['BufferedCanvas']
......
#!/usr/bin/python #!/usr/bin/python
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
#Interactive RepRap e axis calibration program #Interactive RepRap e axis calibration program
#(C) Nathan Zadoks 2011 #(C) Nathan Zadoks 2011
#Licensed under CC-BY-SA or GPLv2 and higher - Pick your poison.
s = 300 #Extrusion speed (mm/min) s = 300 #Extrusion speed (mm/min)
n = 100 #Default length to extrude n = 100 #Default length to extrude
m= 0 #User-entered measured extrusion length m= 0 #User-entered measured extrusion length
......
#!/usr/bin/python #!/usr/bin/python
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import os import os
import math import math
import wx import wx
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import os, sys import os, sys
import gettext import gettext
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
Parsers for specific attributes Parsers for specific attributes
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import from __future__ import absolute_import
from .transform import transformList from .transform import transformList
from .inline import inlineStyle from .inline import inlineStyle
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" CSS at-rules""" """ CSS at-rules"""
from pyparsing import Literal, Combine from pyparsing import Literal, Combine
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
CSS blocks CSS blocks
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
Parsing for CSS colour values. Parsing for CSS colour values.
Supported formats: Supported formats:
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" Parse CSS identifiers. More complicated than it sounds""" """ Parse CSS identifiers. More complicated than it sounds"""
from pyparsing import Word, Literal, Regex, Combine, Optional, White, oneOf, ZeroOrMore from pyparsing import Word, Literal, Regex, Combine, Optional, White, oneOf, ZeroOrMore
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" Parser for inline CSS in style attributes """ """ Parser for inline CSS in style attributes """
def inlineStyle(styleString): def inlineStyle(styleString):
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
Parsing for CSS and CSS-style values, such as transform and filter attributes. Parsing for CSS and CSS-style values, such as transform and filter attributes.
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
Parser for various kinds of CSS values as per CSS2 spec section 4.3 Parser for various kinds of CSS values as per CSS2 spec section 4.3
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
SVGDocument SVGDocument
""" """
......
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
""" """
SVG path data parser SVG path data parser
......
#!/usr/bin/python #!/usr/bin/python
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import pronterface import pronterface
import cherrypy, re, ConfigParser, threading, sys import cherrypy, re, ConfigParser, threading, sys
import os.path import os.path
......
...@@ -28,6 +28,7 @@ except: ...@@ -28,6 +28,7 @@ except:
import sys, glob, time, datetime, threading, traceback, cStringIO, subprocess import sys, glob, time, datetime, threading, traceback, cStringIO, subprocess
from printrun.pronterface_widgets import * from printrun.pronterface_widgets import *
from serial import SerialException
StringIO = cStringIO StringIO = cStringIO
...@@ -72,7 +73,11 @@ class Tee(object): ...@@ -72,7 +73,11 @@ class Tee(object):
self.target(data) self.target(data)
except: except:
pass pass
self.stdout.write(data.encode("utf-8")) try:
data = data.encode("utf-8")
except:
pass
self.stdout.write(data)
def flush(self): def flush(self):
self.stdout.flush() self.stdout.flush()
...@@ -1420,7 +1425,19 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1420,7 +1425,19 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.paused = 0 self.paused = 0
if self.sdprinting: if self.sdprinting:
self.p.send_now("M26 S0") self.p.send_now("M26 S0")
self.p.connect(port, baud) try:
self.p.connect(port, baud)
except SerialException as e:
# Currently, there is no errno, but it should be there in the future
if e.errno == 2:
print _("Error: You are trying to connect to a non-exisiting port.")
elif e.errno == 8:
print _("Error: You don't have permission to open %s.") % port
print _("You might need to add yourself to the dialout group.")
else:
print e
# Kill the scope anyway
return
self.statuscheck = True self.statuscheck = True
if port != self.settings.port: if port != self.settings.port:
self.set("port", port) self.set("port", port)
......
...@@ -112,7 +112,7 @@ if sys.argv[1] in ("install", "uninstall") and len (prefix): ...@@ -112,7 +112,7 @@ if sys.argv[1] in ("install", "uninstall") and len (prefix):
sys.argv += ["--prefix", prefix] sys.argv += ["--prefix", prefix]
target_images_path = "share/pronterface/images/" target_images_path = "share/pronterface/images/"
data_files = [('share/pixmaps/', ['P-face.ico','plater.ico'])] data_files = [('share/pixmaps/', ['P-face.ico','plater.ico','pronsole.ico'])]
for basedir, subdirs, files in os.walk("images"): for basedir, subdirs, files in os.walk("images"):
images = [] images = []
...@@ -145,7 +145,7 @@ setup ( ...@@ -145,7 +145,7 @@ setup (
license = "GPLv3", license = "GPLv3",
data_files = data_files, data_files = data_files,
packages = ["printrun", "printrun.svg"], packages = ["printrun", "printrun.svg"],
scripts = ["pronsole.py", "pronterface.py", "plater.py", "printcore.py"], scripts = ["pronsole.py", "pronterface.py", "plater.py", "printcore.py", "gcoder.py"],
cmdclass = {"uninstall" : uninstall, cmdclass = {"uninstall" : uninstall,
"install" : install, "install" : install,
"install_data" : install_data} "install_data" : install_data}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment