Skip to content

Commit

Permalink
Ensure examples really pass unicode (use 'u' prefix)
Browse files Browse the repository at this point in the history
Strings are default unicode in python3 not so in python2, for strings
that really are unicode we need to use the prefix so they really are
passed as unicode in  py2.

Signed-off-by: Noel Power <noel.power@suse.com>
  • Loading branch information
noelpower committed Feb 8, 2023
1 parent 4d5d51b commit ba03974
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions examples/Label1_cs.py
Expand Up @@ -7,8 +7,8 @@ class Label1CsClient:
def main(self):
UI.OpenDialog(
VBox(
Label("\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7"),
PushButton("&OK\u011B\u0161")
Label(u"\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7"),
PushButton(u"&OK\u011B\u0161")
)
)
UI.UserInput()
Expand Down
4 changes: 2 additions & 2 deletions examples/Label1_de.py
Expand Up @@ -8,9 +8,9 @@ def main(self):
UI.OpenDialog(
VBox(
Label(
"\u00DF\u00F6\u00F6\u00F6\u00F6\u00F6\u00F6\u00DC\u00DC\u00DC\u00DC\u00DC\u00F6\u00DF\u00DF\u00DF\u00DF\u00E4\u00C4\u00C4\u00C4\u00C4"
u"\u00DF\u00F6\u00F6\u00F6\u00F6\u00F6\u00F6\u00DC\u00DC\u00DC\u00DC\u00DC\u00F6\u00DF\u00DF\u00DF\u00DF\u00E4\u00C4\u00C4\u00C4\u00C4"
),
PushButton("\u00C4&\u00D6\u00E4")
PushButton(u"\u00C4&\u00D6\u00E4")
)
)
UI.UserInput()
Expand Down
2 changes: 1 addition & 1 deletion examples/Label1_ja.py
Expand Up @@ -5,7 +5,7 @@
from yast import *
class Label1JaClient:
def main(self):
UI.OpenDialog(VBox(Label("\u5B8C\u6642"), PushButton("&OK\u5B8C\u6642")))
UI.OpenDialog(VBox(Label(u"\u5B8C\u6642"), PushButton(u"&OK\u5B8C\u6642")))
UI.UserInput()
UI.CloseDialog()

Expand Down
4 changes: 2 additions & 2 deletions examples/Label2_ml.py
Expand Up @@ -8,8 +8,8 @@ def main(self):
UI.OpenDialog(
VBox(
Label(
"\u00DF\u00F6\u00F6\u00F6\u00F6\u00F6\u00F6\u00DC\u00DC\u00DC\u00DC\u00DC\u00F6\u00DF\u00DF\u00DF\u00DF\u00E4\u00C4\u00C4\u00C4\u00C4\n" +
"\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7\n" +
u"\u00DF\u00F6\u00F6\u00F6\u00F6\u00F6\u00F6\u00DC\u00DC\u00DC\u00DC\u00DC\u00F6\u00DF\u00DF\u00DF\u00DF\u00E4\u00C4\u00C4\u00C4\u00C4\n" +
u"\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7\n" +
"multiple lines."
),
PushButton("&OK")
Expand Down
2 changes: 1 addition & 1 deletion examples/RichText1_cs.py
Expand Up @@ -12,7 +12,7 @@ def main(self):
RichText(
"<h3>RichText example</h3>" +
"<p>This is a <i>RichText</i> widget.</p>" +
"<p>It's czech: \u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7<i>HTML</i>, or german \u00F6\u00F6\u00E4\u00E4\u00E4</p>" +
u"<p>It's czech: \u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7<i>HTML</i>, or german \u00F6\u00F6\u00E4\u00E4\u00E4</p>" +
"<p><b>bold</b> and <i>italic</i> you can rely on.</p>" + "<p>" +
"<font color=blue>colored\t</font>" +
"<font color=red>\ttext \t</font>" +
Expand Down
12 changes: 6 additions & 6 deletions examples/SetLanguage.py
Expand Up @@ -52,12 +52,12 @@ def main(self):
Heading("Test Dialog"),
Label(
"Fonts may have changed\n" +
"Gr\u00FC\u00DF Gott\n" +
"Czech (\u010Desky)\n" +
"Greek (\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC)\n" +
"Russian (\u0420\u0443\u0441\u0441\u043A\u0438\u0439)\n" +
"\u6F22\u5B57\u304B\u306A\u76F4\n" +
"Hangul (\uD55C\uAE00)"
u"Gr\u00FC\u00DF Gott\n" +
u"Czech (\u010Desky)\n" +
u"Greek (\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC)\n" +
u"Russian (\u0420\u0443\u0441\u0441\u043A\u0438\u0439)\n" +
u"\u6F22\u5B57\u304B\u306A\u76F4\n" +
u"Hangul (\uD55C\uAE00)"
),
PushButton(Opt("default"), "&OK")
)
Expand Down
2 changes: 1 addition & 1 deletion examples/ShortcutConflict6.py
Expand Up @@ -10,7 +10,7 @@ def main(self):

UI.OpenDialog(
HBox(
PushButton("&\u00A7\u00A7"),
PushButton(u"&\u00A7\u00A7"),
PushButton("&???"),
PushButton("?&??"),
PushButton("&!!!"),
Expand Down
20 changes: 10 additions & 10 deletions examples/Table1_utf8.py
Expand Up @@ -7,28 +7,28 @@ class Table1Utf8Client:
def main(self):
UI.OpenDialog(
VBox(
Label("\u00D6\u00DFemsflk\u00C4\u00C4"),
Label(u"\u00D6\u00DFemsflk\u00C4\u00C4"),
MinSize(
25,
7,
Table(
Header(
"\u00C4nerhe\u00DF",
"\u00C4\u00DF\u00F6\u00F6\u00E4\u00E4\u00E4\u00E4\u00E4"
u"\u00C4nerhe\u00DF",
u"\u00C4\u00DF\u00F6\u00F6\u00E4\u00E4\u00E4\u00E4\u00E4"
),
[
Item(
Id('1'),
"\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7",
u"\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u02C7",
6
),
Item(Id(2), "\u011B\u0161\u0159\u017E", None),
Item(Id(3), "\u00C4nder\u00DF\u00DF\u00DF", 8),
Item(Id(4), "\u5B8C\u6642", 12),
Item(Id(2), u"\u011B\u0161\u0159\u017E", None),
Item(Id(3), u"\u00C4nder\u00DF\u00DF\u00DF", 8),
Item(Id(4), u"\u5B8C\u6642", 12),
Item(Id(5), "Zoo", 25),
Item(Id(6), "\u017D\u010D\u0159", 6),
Item(Id(7), "\u00E1\u0161\u0159", 8),
Item(Id(8), "\u00C1lklsd", 7),
Item(Id(6), u"\u017D\u010D\u0159", 6),
Item(Id(7), u"\u00E1\u0161\u0159", 8),
Item(Id(8), u"\u00C1lklsd", 7),
Item(Id(9), "Alphaphet", 15),
Item(Id(10), "an", 1)
]
Expand Down

0 comments on commit ba03974

Please sign in to comment.