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
888143be
Commit
888143be
authored
Jul 31, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial work towards a setup.py build system
parent
f63752d7
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
189 additions
and
44 deletions
+189
-44
plater.py
plater.py
+6
-7
SkeinforgeQuickEditDialog.py
printrun/SkeinforgeQuickEditDialog.py
+0
-0
__init__.py
printrun/__init__.py
+0
-0
bmpDisplay.py
printrun/bmpDisplay.py
+0
-0
bufferedcanvas.py
printrun/bufferedcanvas.py
+0
-0
calibrateextruder.py
printrun/calibrateextruder.py
+0
-0
gcview.py
printrun/gcview.py
+0
-0
graph.py
printrun/graph.py
+0
-0
gviz.py
printrun/gviz.py
+7
-4
printcore.py
printrun/printcore.py
+0
-0
printrun_utils.py
printrun/printrun_utils.py
+28
-0
projectlayer.py
printrun/projectlayer.py
+0
-0
stltool.py
printrun/stltool.py
+0
-0
stlview.py
printrun/stlview.py
+0
-0
webinterface.py
printrun/webinterface.py
+0
-0
xybuttons.py
printrun/xybuttons.py
+1
-7
zbuttons.py
printrun/zbuttons.py
+1
-8
zscaper.py
printrun/zscaper.py
+0
-0
pronsole.py
pronsole.py
+5
-6
pronterface.py
pronterface.py
+11
-12
setup.py
setup.py
+130
-0
No files found.
plater.py
View file @
888143be
...
...
@@ -17,12 +17,10 @@
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
import
os
,
gettext
,
Queue
,
re
import
os
,
Queue
,
re
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
gettext
.
install
(
'plater'
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
else
:
gettext
.
install
(
'plater'
,
'./locale'
,
unicode
=
1
)
from
printrun.printrun_utils
import
install_locale
install_locale
(
'plater'
)
import
wx
import
time
...
...
@@ -31,7 +29,8 @@ import threading
import
math
import
sys
import
stltool
from
printrun
import
stltool
from
printrun.printrun_utils
import
pixmapfile
glview
=
False
if
"-nogl"
not
in
sys
.
argv
:
...
...
@@ -245,7 +244,7 @@ class showstl(wx.Window):
class
stlwin
(
wx
.
Frame
):
def
__init__
(
self
,
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
):
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
_
(
"Plate building tool"
),
size
=
size
)
self
.
SetIcon
(
wx
.
Icon
(
"plater.ico"
,
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
pixmapfile
(
"plater.ico"
)
,
wx
.
BITMAP_TYPE_ICO
))
self
.
mainsizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
(
150
,
600
),
pos
=
(
0
,
0
))
#self.panel.SetBackgroundColour((10, 10, 10))
...
...
SkeinforgeQuickEditDialog.py
→
printrun/
SkeinforgeQuickEditDialog.py
View file @
888143be
File moved
__init__.py
→
printrun/
__init__.py
View file @
888143be
File moved
bmpDisplay.py
→
printrun/
bmpDisplay.py
View file @
888143be
File moved
bufferedcanvas.py
→
printrun/
bufferedcanvas.py
View file @
888143be
File moved
calibrateextruder.py
→
printrun/
calibrateextruder.py
View file @
888143be
File moved
gcview.py
→
printrun/
gcview.py
View file @
888143be
File moved
graph.py
→
printrun/
graph.py
View file @
888143be
File moved
gviz.py
→
printrun/
gviz.py
View file @
888143be
...
...
@@ -13,6 +13,9 @@
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import
wx
,
time
from
printrun_utils
import
imagefile
ID_ABOUT
=
101
ID_EXIT
=
110
class
window
(
wx
.
Frame
):
...
...
@@ -22,11 +25,11 @@ class window(wx.Frame):
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
toolbar
=
wx
.
ToolBar
(
self
,
-
1
,
style
=
wx
.
TB_HORIZONTAL
|
wx
.
NO_BORDER
)
toolbar
.
AddSimpleTool
(
1
,
wx
.
Image
(
'./images/zoom_in.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Zoom In [+]'
,
''
)
toolbar
.
AddSimpleTool
(
2
,
wx
.
Image
(
'./images/zoom_out.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Zoom Out [-]'
,
''
)
toolbar
.
AddSimpleTool
(
1
,
wx
.
Image
(
imagefile
(
'zoom_in.png'
)
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Zoom In [+]'
,
''
)
toolbar
.
AddSimpleTool
(
2
,
wx
.
Image
(
imagefile
(
'zoom_out.png'
)
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Zoom Out [-]'
,
''
)
toolbar
.
AddSeparator
()
toolbar
.
AddSimpleTool
(
3
,
wx
.
Image
(
'./images/arrow_up.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Up a Layer [U]'
,
''
)
toolbar
.
AddSimpleTool
(
4
,
wx
.
Image
(
'./images/arrow_down.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Down a Layer [D]'
,
''
)
toolbar
.
AddSimpleTool
(
3
,
wx
.
Image
(
imagefile
(
'arrow_up.png'
)
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Up a Layer [U]'
,
''
)
toolbar
.
AddSimpleTool
(
4
,
wx
.
Image
(
imagefile
(
'arrow_down.png'
)
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Down a Layer [D]'
,
''
)
toolbar
.
AddSimpleTool
(
5
,
wx
.
EmptyBitmap
(
16
,
16
),
'Reset view'
,
''
)
toolbar
.
AddSeparator
()
#toolbar.AddSimpleTool(5, wx.Image('./images/inject.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Insert Code at start of this layer', '')
...
...
printcore.py
→
print
run/print
core.py
View file @
888143be
File moved
printrun/printrun_utils.py
0 → 100644
View file @
888143be
import
os
import
gettext
def
install_locale
(
domain
):
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
gettext
.
install
(
domain
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
elif
os
.
path
.
exists
(
'/usr/local/share/pronterface/locale'
):
gettext
.
install
(
domain
,
'/usr/local/share/pronterface/locale'
,
unicode
=
1
)
else
:
gettext
.
install
(
domain
,
'./locale'
,
unicode
=
1
)
def
imagefile
(
filename
):
for
prefix
in
[
'/usr/local/share/pronterface/images'
,
'/usr/share/pronterface/images'
]:
candidate
=
os
.
path
.
join
(
prefix
,
filename
)
if
os
.
path
.
exists
(
candidate
):
return
candidate
local_candidate
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)
if
os
.
path
.
exists
(
local_candidate
):
return
local_candidate
else
:
return
os
.
path
.
join
(
os
.
path
.
split
(
os
.
path
.
split
(
__file__
)[
0
])[
0
],
"images"
,
filename
)
def
pixmapfile
(
filename
):
for
prefix
in
[
'/usr/local/share/pixmaps'
,
'/usr/share/pixmaps'
]:
candidate
=
os
.
path
.
join
(
prefix
,
filename
)
if
os
.
path
.
exists
(
candidate
):
return
candidate
return
filename
projectlayer.py
→
pr
intrun/pr
ojectlayer.py
View file @
888143be
File moved
stltool.py
→
printrun/
stltool.py
View file @
888143be
File moved
stlview.py
→
printrun/
stlview.py
View file @
888143be
File moved
webinterface.py
→
printrun/
webinterface.py
View file @
888143be
File moved
xybuttons.py
→
printrun/
xybuttons.py
View file @
888143be
...
...
@@ -15,14 +15,8 @@
import
wx
,
os
,
math
from
bufferedcanvas
import
*
from
printrun_utils
import
*
def
imagefile
(
filename
):
if
os
.
path
.
exists
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)):
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)
else
:
return
os
.
path
.
join
(
os
.
path
.
split
(
os
.
path
.
split
(
__file__
)[
0
])[
0
],
"images"
,
filename
)
def
sign
(
n
):
if
n
<
0
:
return
-
1
elif
n
>
0
:
return
1
...
...
zbuttons.py
→
printrun/
zbuttons.py
View file @
888143be
...
...
@@ -15,14 +15,7 @@
import
wx
,
os
,
math
from
bufferedcanvas
import
*
def
imagefile
(
filename
):
if
os
.
path
.
exists
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)):
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)
else
:
return
os
.
path
.
join
(
os
.
path
.
split
(
os
.
path
.
split
(
__file__
)[
0
])[
0
],
"images"
,
filename
)
from
printrun_utils
import
*
def
sign
(
n
):
if
n
<
0
:
return
-
1
...
...
zscaper.py
→
printrun/
zscaper.py
View file @
888143be
File moved
pronsole.py
View file @
888143be
...
...
@@ -15,16 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import
cmd
,
printcore
,
sys
import
cmd
,
sys
import
glob
,
os
,
time
import
sys
,
subprocess
import
math
,
codecs
from
math
import
sqrt
import
gettext
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
gettext
.
install
(
'pronterface'
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
else
:
gettext
.
install
(
'pronterface'
,
'./locale'
,
unicode
=
1
)
from
printrun
import
printcore
from
printrun.printrun_utils
import
install_locale
install_locale
(
'pronterface'
)
if
os
.
name
==
"nt"
:
try
:
...
...
pronterface.py
View file @
888143be
...
...
@@ -17,19 +17,17 @@
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
import
os
,
gettext
,
Queue
,
re
import
os
,
Queue
,
re
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
gettext
.
install
(
'pronterface'
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
else
:
gettext
.
install
(
'pronterface'
,
'./locale'
,
unicode
=
1
)
from
printrun.printrun_utils
import
install_locale
install_locale
(
'pronterface'
)
try
:
import
wx
except
:
print
_
(
"WX is not installed. This program requires WX to run."
)
raise
import
printcore
,
sys
,
glob
,
time
,
threading
,
traceback
,
gviz
,
traceback
,
cStringIO
,
subprocess
import
sys
,
glob
,
time
,
threading
,
traceback
,
cStringIO
,
subprocess
try
:
os
.
chdir
(
os
.
path
.
split
(
__file__
)[
0
])
except
:
...
...
@@ -49,16 +47,17 @@ if os.name=="nt":
pass
from
xybuttons
import
XYButtons
from
zbuttons
import
ZButtons
from
graph
import
Graph
from
printrun
import
printcore
,
gviz
from
printrun.xybuttons
import
XYButtons
from
printrun.zbuttons
import
ZButtons
from
printrun.graph
import
Graph
from
printrun.printrun_utils
import
pixmapfile
import
pronsole
webavail
=
False
try
:
if
webavail
:
import
cherrypy
,
webinterface
import
cherrypy
,
printrun
.
webinterface
from
threading
import
Thread
except
:
print
_
(
"CherryPy is not installed. Web Interface Disabled."
)
...
...
@@ -109,7 +108,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
filename
=
filename
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
_
(
"Printer Interface"
),
size
=
size
);
self
.
SetIcon
(
wx
.
Icon
(
"P-face.ico"
,
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
pixmapfile
(
"P-face.ico"
)
,
wx
.
BITMAP_TYPE_ICO
))
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
size
)
self
.
statuscheck
=
False
...
...
setup.py
0 → 100755
View file @
888143be
#!/usr/bin/env python
import
sys
,
os
,
glob
import
subprocess
from
stat
import
*
from
distutils.core
import
setup
from
distutils.command.install
import
install
as
_install
from
distutils.command.install_data
import
install_data
as
_install_data
INSTALLED_FILES
=
"installed_files"
class
install
(
_install
):
def
run
(
self
):
_install
.
run
(
self
)
outputs
=
self
.
get_outputs
()
length
=
0
if
self
.
root
:
length
+=
len
(
self
.
root
)
if
self
.
prefix
:
length
+=
len
(
self
.
prefix
)
if
length
:
for
counter
in
xrange
(
len
(
outputs
)):
outputs
[
counter
]
=
outputs
[
counter
][
length
:]
data
=
"
\n
"
.
join
(
outputs
)
try
:
file
=
open
(
INSTALLED_FILES
,
"w"
)
except
:
self
.
warn
(
"Could not write installed files list
%
s"
%
\
INSTALLED_FILES
)
return
file
.
write
(
data
)
file
.
close
()
class
install_data
(
_install_data
):
def
run
(
self
):
def
chmod_data_file
(
file
):
try
:
os
.
chmod
(
file
,
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IROTH
)
except
:
self
.
warn
(
"Could not chmod data file
%
s"
%
file
)
_install_data
.
run
(
self
)
map
(
chmod_data_file
,
self
.
get_outputs
())
class
uninstall
(
_install
):
def
run
(
self
):
try
:
file
=
open
(
INSTALLED_FILES
,
"r"
)
except
:
self
.
warn
(
"Could not read installed files list
%
s"
%
\
INSTALLED_FILES
)
return
files
=
file
.
readlines
()
file
.
close
()
prepend
=
""
if
self
.
root
:
prepend
+=
self
.
root
if
self
.
prefix
:
prepend
+=
self
.
prefix
if
len
(
prepend
):
for
counter
in
xrange
(
len
(
files
)):
files
[
counter
]
=
prepend
+
files
[
counter
]
.
rstrip
()
for
file
in
files
:
print
"Uninstalling
%
s"
%
file
try
:
os
.
unlink
(
file
)
except
:
self
.
warn
(
"Could not remove file
%
s"
%
file
)
ops
=
(
"install"
,
"build"
,
"sdist"
,
"uninstall"
,
"clean"
)
if
len
(
sys
.
argv
)
<
2
or
sys
.
argv
[
1
]
not
in
ops
:
print
"Please specify operation :
%
s"
%
" | "
.
join
(
ops
)
raise
SystemExit
prefix
=
None
if
len
(
sys
.
argv
)
>
2
:
i
=
0
for
o
in
sys
.
argv
:
if
o
.
startswith
(
"--prefix"
):
if
o
==
"--prefix"
:
if
len
(
sys
.
argv
)
>=
i
:
prefix
=
sys
.
argv
[
i
+
1
]
sys
.
argv
.
remove
(
prefix
)
elif
o
.
startswith
(
"--prefix="
)
and
len
(
o
[
9
:]):
prefix
=
o
[
9
:]
sys
.
argv
.
remove
(
o
)
i
+=
1
if
not
prefix
and
"PREFIX"
in
os
.
environ
:
prefix
=
os
.
environ
[
"PREFIX"
]
if
not
prefix
or
not
len
(
prefix
):
prefix
=
"/usr/local"
if
sys
.
argv
[
1
]
in
(
"install"
,
"uninstall"
)
and
len
(
prefix
):
sys
.
argv
+=
[
"--prefix"
,
prefix
]
target_images_path
=
"share/pronterface/images/"
data_files
=
[(
'share/pixmaps/'
,
[
'P-face.ico'
,
'plater.ico'
])]
for
basedir
,
subdirs
,
files
in
os
.
walk
(
"images"
):
images
=
[]
for
filename
in
files
:
if
filename
.
find
(
".svg"
)
or
filename
.
find
(
".png"
):
file_path
=
os
.
path
.
join
(
basedir
,
filename
)
images
.
append
(
file_path
)
data_files
.
append
((
target_images_path
+
basedir
[
len
(
"images/"
):],
images
))
for
basedir
,
subdirs
,
files
in
os
.
walk
(
"locale"
):
if
not
basedir
.
endswith
(
"LC_MESSAGES"
):
continue
destpath
=
os
.
path
.
join
(
"share"
,
"pronterface"
,
basedir
)
files
=
filter
(
lambda
x
:
x
.
endswith
(
".mo"
),
files
)
files
=
map
(
lambda
x
:
os
.
path
.
join
(
basedir
,
x
),
files
)
data_files
.
append
((
destpath
,
files
))
setup
(
name
=
"Printrun"
,
description
=
"Host software for 3D printers"
,
author
=
"Kliment Yanev"
,
url
=
"http://github.com/kliment/Printrun/"
,
license
=
"GPLv3"
,
data_files
=
data_files
,
packages
=
[
"printrun"
],
scripts
=
[
"pronsole.py"
,
"pronterface.py"
,
"plater.py"
],
cmdclass
=
{
"uninstall"
:
uninstall
,
"install"
:
install
,
"install_data"
:
install_data
}
)
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