[Python-modules-team] Bug#845573: pyside-lupdate: get disorderd if a line starts with comment sign

Volker Groll volker.groll at web.de
Thu Nov 24 19:03:09 UTC 2016


Package: pyside-tools
Version: 0.2.15-1
Severity: normal

Dear maintainer,

the attached code produces a ts-file with an 'unnamed context'.
If I create a qm-file from this the translation will not be found
by the python script.
If the comment line starts with a whitespace everything works like normal.

Greetings, Volker


>>>>>>>>>>
#!/usr/bin/python3

from PySide.QtCore import *
from PySide.QtGui  import *
import sys

class CMainWindow(QMainWindow):

    def __init__(self, parent=None):

        super(CMainWindow, self).__init__(parent)

        button1 = QPushButton("Show M1")
        button2 = QPushButton("Show M2")
        button1.clicked.connect(self.m1)
        button2.clicked.connect(self.m2)

        widget = QWidget()
        layout = QVBoxLayout()
        layout.addWidget(button1)
        layout.addWidget(button2)
        widget.setLayout(layout)

        self.setCentralWidget(widget)

    def m1(self):
        QMessageBox.about(self, "MessageBox 1", self.tr("Translation of first String"))

# troublesome comment

    def m2(self):
        QMessageBox.about(self, "MessageBox 2", self.tr("Translation of second String"))
        


app = QApplication(sys.argv)
translator = QTranslator(app)
translator.load(QLocale().system().name())
app.installTranslator(translator)

form = CMainWindow()
form.show()
app.exec_()
<<<<<<<<<<

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages pyside-tools depends on:
ii  libc6                 2.24-5
ii  libgcc1               1:6.2.1-4
ii  libqt4-xml            4:4.8.7+dfsg-11
ii  libqtcore4            4:4.8.7+dfsg-11
ii  libqtgui4             4:4.8.7+dfsg-11
ii  libstdc++6            6.2.1-4
ii  python                2.7.11-2
ii  python-pyside.qtcore  1.2.2-2+b1

Versions of packages pyside-tools recommends:
ii  python-pyside  1.2.2-2

pyside-tools suggests no packages.

-- no debconf information



More information about the Python-modules-team mailing list