Re: [PyQt] Pylupdate4 does not parse tr(u) ?
On Mon, 13 Jun 2011 14:43:05 +0200, Giuseppe Corbelli giuseppe.corbe...@copanitalia.com wrote: On 10/06/2011 10:52, Giuseppe Corbelli wrote: So it seems that pylupdate4 does NOT parse tr(u) stuff. Is it by design? Sorry but I can't dive into it at present. Seems that I was right, rare stuff indeed. Look into pylupdate/fetchtr.cpp, around line 380 You will see a case '(': if (yyParenDepth == 0) yyParenLineNo = yyCurLineNo; yyParenDepth++; yyCh = getChar(); return Tok_LeftParen; Replace with: case '(': if (yyParenDepth == 0) yyParenLineNo = yyCurLineNo; yyParenDepth++; yyCh = getChar(); //It may be a tr(uwhatever), skip the 'u' if (yyCh == 'u') yyCh = getChar(); return Tok_LeftParen; It seems to work (just eats one more char). If you find it useful please apply into the main line. This is fixed (differently) in tonight's snapshot. Thanks, Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Pylupdate4 does not parse tr(u) ?
On 10/06/2011 10:52, Giuseppe Corbelli wrote: So it seems that pylupdate4 does NOT parse tr(u) stuff. Is it by design? Sorry but I can't dive into it at present. Seems that I was right, rare stuff indeed. Look into pylupdate/fetchtr.cpp, around line 380 You will see a case '(': if (yyParenDepth == 0) yyParenLineNo = yyCurLineNo; yyParenDepth++; yyCh = getChar(); return Tok_LeftParen; Replace with: case '(': if (yyParenDepth == 0) yyParenLineNo = yyCurLineNo; yyParenDepth++; yyCh = getChar(); //It may be a tr(uwhatever), skip the 'u' if (yyCh == 'u') yyCh = getChar(); return Tok_LeftParen; It seems to work (just eats one more char). If you find it useful please apply into the main line. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666104 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Pylupdate4 does not parse tr(u) ?
On 10/06/2011 19:46, Detlev Offenbach wrote: On Freitag, 10. Juni 2011, Giuseppe Corbelli wrote: Hi all I have a couple of classes like these: class CAntibiogram_AlarmData(WaspCore.Common.Alarm.CAlarmData): __alarm_name__ = ALARM_Antibiogram_Table __defaults__ = { 'name': None, 'address': (1602, 0x4000), 'description': tr(Sezione allarmi TAVOLA ANTIBIOGRAMMA), 'section_name': _section_name, 'section_description': tr(Tavola Antibiogramma), 'active': False } class C1667_0AlarmData(WaspCore.Common.Alarm.CAlarmData): __alarm_name__ = ALARM_1667.0 __defaults__ = { 'name': None, 'address': (1667, 0x0001), 'description': tr(uRichiesto ciclo con brodi di arricchimento), 'section_name': _section_name, 'section_description': tr(uTavola Antibiogramma), 'active': True } When I run pylupdate4 -verbose WaspCore/Alarms/BATable.py -ts test.ts I get Updating 'test.ts'... Found 2 source texts (0 new and 2 already existing) So it seems that pylupdate4 does NOT parse tr(u) stuff. Is it by design? Sorry but I can't dive into it at present. Python 2.6.6 QT 4.7.1 PyQt 4.8.3 Linux 2.6 Have you tried it with trUtf8()? Exactly the same result. Probably the flex/yacc/whatever parser does not handle the u tag. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666104 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Pylupdate4 does not parse tr(u) ?
On Freitag, 10. Juni 2011, Giuseppe Corbelli wrote: Hi all I have a couple of classes like these: class CAntibiogram_AlarmData(WaspCore.Common.Alarm.CAlarmData): __alarm_name__ = ALARM_Antibiogram_Table __defaults__ = { 'name': None, 'address': (1602, 0x4000), 'description': tr(Sezione allarmi TAVOLA ANTIBIOGRAMMA), 'section_name': _section_name, 'section_description': tr(Tavola Antibiogramma), 'active': False } class C1667_0AlarmData(WaspCore.Common.Alarm.CAlarmData): __alarm_name__ = ALARM_1667.0 __defaults__ = { 'name': None, 'address': (1667, 0x0001), 'description': tr(uRichiesto ciclo con brodi di arricchimento), 'section_name': _section_name, 'section_description': tr(uTavola Antibiogramma), 'active': True } When I run pylupdate4 -verbose WaspCore/Alarms/BATable.py -ts test.ts I get Updating 'test.ts'... Found 2 source texts (0 new and 2 already existing) So it seems that pylupdate4 does NOT parse tr(u) stuff. Is it by design? Sorry but I can't dive into it at present. Python 2.6.6 QT 4.7.1 PyQt 4.8.3 Linux 2.6 Have you tried it with trUtf8()? Detlev -- Detlev Offenbach det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt