[jhbuild] misc: allow unaccented characters when approving for wipe
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] misc: allow unaccented characters when approving for wipe
- Date: Wed, 27 Jan 2016 15:46:58 +0000 (UTC)
commit 21b4c85a78aeb354cad781ff7d0372c4ae12d14a
Author: Frédéric Péters <fpeters 0d be>
Date: Wed Jan 27 16:45:56 2016 +0100
misc: allow unaccented characters when approving for wipe
https://bugzilla.gnome.org/show_bug.cgi?id=690016
jhbuild/frontends/terminal.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/frontends/terminal.py b/jhbuild/frontends/terminal.py
index 0b77cba..e4d3a9d 100644
--- a/jhbuild/frontends/terminal.py
+++ b/jhbuild/frontends/terminal.py
@@ -22,6 +22,7 @@ import sys
import os
import signal
import subprocess
+import unicodedata
import locale
from jhbuild.frontends import buildscript
@@ -362,7 +363,9 @@ class TerminalBuildScript(buildscript.BuildScript):
val = raw_input(uencode(_('Type "yes" to confirm the action: ')))
val = udecode(val)
val = val.strip()
- if val.lower() in ('yes', _('yes').lower()):
+ def normalize(s):
+ return unicodedata.normalize('NFKD', s).encode('ascii', 'ignore').lower()
+ if normalize(val) in ('yes', normalize(_('yes')), _('yes').lower()):
return selected_phase
continue
return selected_phase
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]