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
8a4bdc92
Commit
8a4bdc92
authored
Nov 18, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix path handling when frozen (__file__ should be avoided in the future, this is a workaround)
parent
2bd23180
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
xybuttons.py
xybuttons.py
+8
-2
zbuttons.py
zbuttons.py
+6
-1
No files found.
xybuttons.py
View file @
8a4bdc92
import
wx
,
os
,
math
import
wx
,
os
,
math
from
bufferedcanvas
import
*
from
bufferedcanvas
import
*
def
imagefile
(
filename
):
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
filename
)
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
):
def
sign
(
n
):
if
n
<
0
:
return
-
1
if
n
<
0
:
return
-
1
elif
n
>
0
:
return
1
elif
n
>
0
:
return
1
...
@@ -254,6 +258,8 @@ class XYButtons(BufferedCanvas):
...
@@ -254,6 +258,8 @@ class XYButtons(BufferedCanvas):
self
.
quadrant
=
2
self
.
quadrant
=
2
elif
evt
.
GetKeyCode
()
==
wx
.
WXK_RIGHT
:
elif
evt
.
GetKeyCode
()
==
wx
.
WXK_RIGHT
:
self
.
quadrant
=
0
self
.
quadrant
=
0
elif
evt
.
GetKeyCode
()
==
wx
.
WXK_SPACE
:
pass
else
:
else
:
evt
.
Skip
()
evt
.
Skip
()
return
return
...
...
zbuttons.py
View file @
8a4bdc92
...
@@ -2,7 +2,12 @@ import wx, os, math
...
@@ -2,7 +2,12 @@ import wx, os, math
from
bufferedcanvas
import
*
from
bufferedcanvas
import
*
def
imagefile
(
filename
):
def
imagefile
(
filename
):
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"images"
,
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
):
def
sign
(
n
):
if
n
<
0
:
return
-
1
if
n
<
0
:
return
-
1
...
...
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