fail more cleanly on non-ascii macro name
parent
e73e11d554
commit
2cfca605c2
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue