Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
61be7b17
Commit
61be7b17
authored
Aug 18, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open GCode files with rU flag to handle weird newline combinations
parent
42818bcd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
gcoder.py
printrun/gcoder.py
+1
-1
gviz.py
printrun/gviz.py
+1
-1
pronsole.py
printrun/pronsole.py
+1
-1
pronterface.py
printrun/pronterface.py
+2
-2
No files found.
printrun/gcoder.py
View file @
61be7b17
...
@@ -497,7 +497,7 @@ def main():
...
@@ -497,7 +497,7 @@ def main():
return
return
print
"Line object size:"
,
sys
.
getsizeof
(
Line
(
"G0 X0"
))
print
"Line object size:"
,
sys
.
getsizeof
(
Line
(
"G0 X0"
))
gcode
=
GCode
(
open
(
sys
.
argv
[
1
]))
gcode
=
GCode
(
open
(
sys
.
argv
[
1
]
,
"rU"
))
print
"Dimensions:"
print
"Dimensions:"
xdims
=
(
gcode
.
xmin
,
gcode
.
xmax
,
gcode
.
width
)
xdims
=
(
gcode
.
xmin
,
gcode
.
xmax
,
gcode
.
width
)
...
...
printrun/gviz.py
View file @
61be7b17
...
@@ -524,6 +524,6 @@ class Gviz(wx.Panel):
...
@@ -524,6 +524,6 @@ class Gviz(wx.Panel):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
import
sys
import
sys
app
=
wx
.
App
(
False
)
app
=
wx
.
App
(
False
)
main
=
GvizWindow
(
open
(
sys
.
argv
[
1
]))
main
=
GvizWindow
(
open
(
sys
.
argv
[
1
]
,
"rU"
))
main
.
Show
()
main
.
Show
()
app
.
MainLoop
()
app
.
MainLoop
()
printrun/pronsole.py
View file @
61be7b17
...
@@ -820,7 +820,7 @@ class pronsole(cmd.Cmd):
...
@@ -820,7 +820,7 @@ class pronsole(cmd.Cmd):
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
exists
(
filename
):
self
.
logError
(
"File not found!"
)
self
.
logError
(
"File not found!"
)
return
return
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
))
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
,
"rU"
))
self
.
filename
=
filename
self
.
filename
=
filename
self
.
log
(
"Loaded
%
s,
%
d lines."
%
(
filename
,
len
(
self
.
fgcode
)))
self
.
log
(
"Loaded
%
s,
%
d lines."
%
(
filename
,
len
(
self
.
fgcode
)))
...
...
printrun/pronterface.py
View file @
61be7b17
...
@@ -1614,7 +1614,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1614,7 +1614,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
fn
=
self
.
filename
fn
=
self
.
filename
try
:
try
:
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
))
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
,
"rU"
))
if
self
.
p
.
online
:
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
...
@@ -1684,7 +1684,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1684,7 +1684,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
skein
(
name
)
self
.
skein
(
name
)
else
:
else
:
self
.
filename
=
name
self
.
filename
=
name
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
))
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
,
"rU"
))
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment