Added gtkgui_helpers.escape_underscore to not require re module

This commit is contained in:
Travis Shirk 2006-02-08 05:13:26 +00:00
parent 2da7a542f8
commit cd1993037a
2 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,6 @@
##
import os
import re
import time
import gtk
import gtk.glade
@ -1037,7 +1036,7 @@ class GroupchatControl(ChatControlBase):
sectext = _('If you close this window, you will be disconnected '
'from this room.')
escaped_name = re.subn("_", "__", self.name)[0]
escaped_name = gtkgui_helpers.escape_underscore(self.name)
dialog = dialogs.ConfirmationDialogCheck(pritext, sectext,
_('Do _not ask me about closing "%s" again' %\
escaped_name))

View File

@ -572,3 +572,8 @@ icon=gajim
Description=xmpp
''' % command)
f.close()
def escape_underscore(s):
'''Escape underlines to prevent them from being interpreted
as keyboard accelerators'''
return s.replace('_', '__')