Jump to content


Photo

skin_display_et8500.xml generate an error during .po creation process


  • Please log in to reply
5 replies to this topic

#1 Pr2

  • PLi® Contributor
  • 6,179 posts

+261
Excellent

Posted 18 August 2015 - 19:20

Hi,

 

While generating the .po file there is an error caused by the file .../data/skin_display_et8500.xml

 

Can you please have a look at this and fix it.

 

If in the po folder typing:

 

/usr/bin/python xml2po.py ../data/skin_display_et8500.xml
Traceback (most recent call last):
  File "xml2po.py", line 52, in <module>
    parser.parse(arg)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "xml2po.py", line 30, in startElement
    k = str(attrs[x])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position 0: ordinal not in range(128)

 

Thanks,

 

Pr2


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: skin_display_et8500.xml generate an error during .po creation process #2 Pr2

  • PLi® Contributor
  • 6,179 posts

+261
Excellent

Posted 19 August 2015 - 13:34

Hi,

 

Here is one possible solution that makes xml2po.py more robust against such problem.

 

diff --git a/po/xml2po.py b/po/xml2po.py
index 7eeebc2..9b71b89 100755
--- a/po/xml2po.py
+++ b/po/xml2po.py
@@ -27,9 +27,10 @@ class parseXML(ContentHandler, LexicalHandler):
  def startElement(self, name, attrs):
  for x in ["text", "title", "value", "caption", "description"]:
  try:
- k = str(attrs[x])
+ z = attrs[x].encode('utf-8')
+ k = str(z)
  if k.strip() != "" and not self.ishex.match(k):
- attrlist.add((attrs[x], self.last_comment))
+ attrlist.add((k, self.last_comment))
  self.last_comment = None
  except KeyError:
  pass
 

With this change the output is now:

 

/usr/bin/python xml2po.py ../data/skin_display_et8500.xml 

 

#: ../data/skin_display_et8500.xml

msgid "EtPortal"

msgstr ""

 

#: ../data/skin_display_et8500.xml

msgid "®"

msgstr ""

 

 

 

But I just wonder why the ® (u\xae) is detected in the ../data/skin_display_et8500.xml  file.

 

Regards,

 

Pr2

Attached Files


Edited by Pr2, 19 August 2015 - 13:37.

NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: skin_display_et8500.xml generate an error during .po creation process #3 Pr2

  • PLi® Contributor
  • 6,179 posts

+261
Excellent

Posted 19 August 2015 - 14:04

Hi,

 

line 44  in skin_display_et8500.xml

 

<widget source="session.RecordState" render="FixedLabel" text="&#174;" position="334,140" foregroundColor="#ff0000" size="40,46" font="FdLcD;50" halign="left" valign="center" zPosition="22">

 

line 89:

<widget source="parent.RecordState" render="FixedLabel" text="&#174;" position="334,140" foregroundColor="#ff0000" size="50,46" font="FdLcD;40" halign="left" valign="center" zPosition="22">

 

line 285:

<widget source="session.RecordState" render="FixedLabel" text="&#174;" position="600,470" foregroundColor="#ff0000" size="80,80" font="FdLcD;80" halign="center" valign="center" zPosition="1">

 

that generate the problem.

 

Regards,

 

Pr2


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: skin_display_et8500.xml generate an error during .po creation process #4 Tech

  • Forum Moderator
    PLi® Core member
  • 14,917 posts

+486
Excellent

Posted 20 August 2015 - 14:58

So it hangs on the &#174; because it isn't an utf8 symbol?


Aan de rand van de afgrond is een stap voorwaarts niet altijd vooruitgang....

On the edge of the abyss, a step forward is not always progress....

Hardware: 2x Daily used Vu+ Ultimo 4K - Vu+ Duo 4K SE and a lot more.... - VisioSat BiBigsat - Jultec Unicable Multiswitch 4 positions: 19.2/23.5/28.2 East - Diseqc motorized flatdish antenna

Software : HomeBuild OpenPLi Develop and Scarthgap builds, local cards driven by OsCam

Press the Geplaatste afbeelding button on the buttom right of this message ;)

Have you tried our wiki yet? Many answers can be found in our OpenPLi wiki


Re: skin_display_et8500.xml generate an error during .po creation process #5 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,603 posts

+62
Good

Posted 20 August 2015 - 15:10

no &@174 is not a plain ascii character. Thas is causing the issue.

xml2po.py  patch commited. thansk Pr2.


Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: skin_display_et8500.xml generate an error during .po creation process #6 Pr2

  • PLi® Contributor
  • 6,179 posts

+261
Excellent

Posted 20 August 2015 - 19:18

Hi,

 

Thanks for the commit but would be nice to review also the skin_display_et8500.xml to perform something better for the record symbol.

et8500 has a full LCD color display (like the VU+ Duo2) so I guess that we can use a .png file for recording instead of using the symbol: ®

 

Pr2


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 



4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users