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
e73e11d5
Commit
e73e11d5
authored
Jul 15, 2012
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow unicode characters in custom button command names
parent
da2a0269
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
pronsole.py
pronsole.py
+4
-4
pronterface.py
pronterface.py
+20
-10
No files found.
pronsole.py
View file @
e73e11d5
...
...
@@ -18,7 +18,7 @@
import
cmd
,
printcore
,
sys
import
glob
,
os
,
time
import
sys
,
subprocess
import
math
import
math
,
codecs
from
math
import
sqrt
import
gettext
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
...
...
@@ -492,7 +492,7 @@ class pronsole(cmd.Cmd):
def
load_rc
(
self
,
rc_filename
):
self
.
processing_rc
=
True
try
:
rc
=
open
(
rc_filename
)
rc
=
codecs
.
open
(
rc_filename
,
"r"
,
"utf-8"
)
self
.
rc_filename
=
os
.
path
.
abspath
(
rc_filename
)
for
rc_cmd
in
rc
:
if
not
rc_cmd
.
lstrip
()
.
startswith
(
"#"
):
...
...
@@ -534,8 +534,8 @@ class pronsole(cmd.Cmd):
if
os
.
path
.
exists
(
self
.
rc_filename
):
import
shutil
shutil
.
copy
(
self
.
rc_filename
,
self
.
rc_filename
+
"~bak"
)
rci
=
open
(
self
.
rc_filename
+
"~bak"
,
"r
"
)
rco
=
open
(
self
.
rc_filename
,
"w
"
)
rci
=
codecs
.
open
(
self
.
rc_filename
+
"~bak"
,
"r"
,
"utf-8
"
)
rco
=
codecs
.
open
(
self
.
rc_filename
,
"w"
,
"utf-8
"
)
if
rci
is
not
None
:
overwriting
=
False
for
rc_cmd
in
rci
:
...
...
pronterface.py
View file @
e73e11d5
...
...
@@ -1940,16 +1940,26 @@ class ButtonEdit(wx.Dialog):
def
macrob_enabler
(
self
,
e
):
macro
=
self
.
command
.
GetValue
()
valid
=
False
if
macro
==
""
:
valid
=
True
elif
self
.
pronterface
.
macros
.
has_key
(
macro
):
valid
=
True
elif
hasattr
(
self
.
pronterface
.
__class__
,
"do_"
+
macro
):
valid
=
False
elif
len
([
c
for
c
in
macro
if
not
c
.
isalnum
()
and
c
!=
"_"
]):
valid
=
False
else
:
valid
=
True
try
:
if
macro
==
""
:
valid
=
True
elif
self
.
pronterface
.
macros
.
has_key
(
macro
):
valid
=
True
elif
hasattr
(
self
.
pronterface
.
__class__
,
u"do_"
+
macro
):
valid
=
False
elif
len
([
c
for
c
in
macro
if
not
c
.
isalnum
()
and
c
!=
"_"
]):
valid
=
False
else
:
valid
=
True
except
:
if
macro
==
""
:
valid
=
True
elif
self
.
pronterface
.
macros
.
has_key
(
macro
):
valid
=
True
elif
len
([
c
for
c
in
macro
if
not
c
.
isalnum
()
and
c
!=
"_"
]):
valid
=
False
else
:
valid
=
True
self
.
macrob
.
Enable
(
valid
)
def
macrob_handler
(
self
,
e
):
macro
=
self
.
command
.
GetValue
()
...
...
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