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
2cfca605
Commit
2cfca605
authored
Jul 23, 2012
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fail more cleanly on non-ascii macro name
parent
e73e11d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
pronterface.py
pronterface.py
+5
-5
No files found.
pronterface.py
View file @
2cfca605
...
@@ -485,14 +485,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -485,14 +485,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
macro
==
""
:
return
self
.
new_macro
()
if
macro
==
""
:
return
self
.
new_macro
()
if
self
.
macros
.
has_key
(
macro
):
if
self
.
macros
.
has_key
(
macro
):
old_def
=
self
.
macros
[
macro
]
old_def
=
self
.
macros
[
macro
]
elif
hasattr
(
self
.
__class__
,
"do_"
+
macro
):
elif
len
([
c
for
c
in
macro
.
encode
(
"ascii"
,
"replace"
)
if
not
c
.
isalnum
()
and
c
!=
"_"
]):
print
_
(
"Name '
%
s' is being used by built-in command"
)
%
macro
print
_
(
"Macro name may contain only ASCII alphanumeric symbols and underscores"
)
return
elif
len
([
c
for
c
in
macro
if
not
c
.
isalnum
()
and
c
!=
"_"
]):
print
_
(
"Macro name may contain only alphanumeric symbols and underscores"
)
if
webavail
:
if
webavail
:
self
.
webInterface
.
AddLog
(
"Macro name may contain only alphanumeric symbols and underscores"
)
self
.
webInterface
.
AddLog
(
"Macro name may contain only alphanumeric symbols and underscores"
)
return
return
elif
hasattr
(
self
.
__class__
,
"do_"
+
macro
):
print
_
(
"Name '
%
s' is being used by built-in command"
)
%
macro
return
else
:
else
:
old_def
=
""
old_def
=
""
self
.
start_macro
(
macro
,
old_def
)
self
.
start_macro
(
macro
,
old_def
)
...
...
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