0

I' m now able to display the licence in the last tab but impossible for the first, second and third tab. In fact, it is the same thing than the first tab.

Even it is a secondary GUI (displayed in the main window when she is called). Here the code of the credits screen.

I've tried several things but I don't get an output (under a mysterious Sig Error). I've tried too the python module faulthandler without any success.

Did you have an idea about what I've done wrong ?

By Advance Thanks.

import os

from PyQt5.QtWidgets import QDialog

from ui.creditsui import Ui_creditscreen

OG = {'name': 'Olivier Girard', 'email': 'olivier@ecrxxxxx.org'}
CREDITS = {'code': [OG],
       'documentation': [OG],
       'translation': [OG],
       }
path_licence = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


class Credits(QDialog):

def __init__(self, parent=None):

    super(Credits, self).__init__(parent)
    self.setupUi()
    self.showLicense()
    self.showAuthors()

def setupUi(self):

    self.ui = Ui_creditscreen()
    self.ui.setupUi(self)

def showLicense(self):

    # path_li = os.path.join(path_licence, "licence.txt")

    with open('licence.txt', 'r') as my_licence:
        text = my_licence.read()
        self.ui.textBrowserlicense.setPlainText(text)
        # self.ui.textBrowserlicense.setText(text)

def showAuthors(self):

    authors = []
    for person in CREDITS['code']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowserwritten.setText(authors)

def showDocumenters(self):

    authors = []
    for person in CREDITS['documentation']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowserdocumented.setText(authors)

def showTranslators(self):

    authors = []
    for person in CREDITS['translation']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowsertranslated(authors)
  • Could you include the definition of `Ui_creditscreen`? – Heike Jul 01 '19 at 16:20
  • @ Heike There are too much characters for posting here but you can get the code here : [link](https://github.com/olielvewen/Mockups/blob/master/MX%205000/mx5000/ui/creditsui.py) – olielvewen Jul 02 '19 at 16:54
  • @eyllanesc I hope that's what you expect : ```OG = {'name': 'Olivier Girard', 'email': 'olivier@ecrxxxxx.org'} CREDITS = {'code': [OG], } def showAuthors(self): authors = [] for person in CREDITS['code']: name = person['name'] email = person['email'] authors.append("{} <{}>".format(name, email)) #self.ui.textBrowserwritten.setText(authors) self.ui.textBrowserwritten.setPlainText(authors)``` – olielvewen Jul 02 '19 at 17:03
  • I answer myself. Besides space errors in the dictionary, I created a specific function for each (authors, documentaries, translator). That works pretty well but however, I still have a problem as you can see on the screenshot. I end up with parentheses and quotes like if I was in console. I have not thinking at this behaviour. How can I get rid of it? Here the problem: http://pix.toile-libre.org/?img=1591802786.png – olielvewen Jun 10 '20 at 14:24

0 Answers0