def mod_idx(self):
        """Passes Module Index to front-end PS tab."""

        with open(meipass("documentation/Resources/mod.html"), "r", errors="ignore") as f:
            mod = f.read()

        self.ui.text_browser_PS.setText(
            """
            {}
        """.format(
                mod
            )
        )
    def firmware(self):
        """Passes firmware changelog to front-end PS tab."""

        with open(meipass("documentation/Resources/changelog.html"), "r", errors="ignore") as f:
            logs = f.read()

        self.ui.text_browser_PS.setText(
            """
            {}
        """.format(
                logs
            )
        )
    def tips(self):
        """Passes Tips & Tricks to front-end PS tab."""

        with open(meipass("documentation/Resources/tips.html"), "r", errors="ignore") as f:
            tips = f.read()

        self.ui.text_browser_PS.setText(
            """
            {}
        """.format(
                tips
            )
        )
    def faq(self):
        """Passes FAQ to the front-end PS tab."""

        with open(meipass("documentation/Resources/faq.html"), "r", errors="ignore") as f:
            faq = f.read()

        self.ui.text_browser_PS.setText(
            """
            {}
        """.format(
                faq
            )
        )
    def documentation(self):
        """Passes documentation to the front-end PS tab."""

        with open(meipass("documentation/Resources/manual.html"), "r", errors="ignore") as f:
            manual = f.read()

        self.ui.text_browser_PS.setText(
            """
            {}
        """.format(
                manual
            )
        )
    def toggle_dark(self):
        """Toggles the theme for the application.
        Currently triggered via a menu action.
        """

        app = QApplication.instance()
        # Pick the right stylesheet based on the OS.
        sheet = {
            ("darwin", True): "osx-light.css",
            ("windows", True): "light.css",
            ("linux", True): "light.css",
            ("darwin", False): "osx-dark.css",
            ("windows", False): "dark.css",
            ("linux", False): "dark.css",
        }[(platform.system().lower(), self.dark)]

        with open(meipass(os.path.join("zoia_lib", "UI", "resources", sheet)), "r") as f:
            data = f.read()

        self.dark = not self.dark
        app.setStyleSheet(data)
        self.change_font(self.font)
Esempio n. 7
0
import json
import struct

from zoia_lib.backend.patch import Patch
from zoia_lib.backend.utilities import meipass
from zoia_lib.common import errors

with open(meipass("zoia_lib/common/schemas/ModuleIndex.json")) as f:
    mod = json.load(f)


class PatchBinary(Patch):
    """The PatchBinary class is a child of the Patch class. It is
    responsible for ZOIA patch binary analysis.
    """
    def __init__(self):
        """"""
        super().__init__()

    def parse_data(self, byt):
        """Parses the binary data of a patch for information relating
        to the patch. This information is collected into a string that
        is returned such that it can be displayed via the frontend.
        The returned data will specify the following:
        - Preset size
        - Patch name
        - Module count
          - For each module:
            - Module name
            - Module type
            - Module version
Esempio n. 8
0
import os
import sys

from PySide2.QtGui import QPixmap, Qt
from PySide2.QtWidgets import QApplication, QSplashScreen, QStyleFactory

from zoia_lib.backend.utilities import meipass
from zoia_lib.UI.ZOIALibrarian_main import ZOIALibrarianMain

# Entry point for the application.
if __name__ == "__main__":
    app = QApplication(sys.argv)

    # Set style
    app.setStyle(QStyleFactory.create("Fusion"))

    file_path = meipass(
        os.path.join(os.getcwd(), "zoia_lib", "UI", "resources", "splash.png"))

    # Create and display the splash screen
    img = QPixmap(file_path)
    splash = QSplashScreen(img, Qt.WindowStaysOnTopHint)
    splash.show()

    # Show the window after it finishes setting up and close the splash.
    window = ZOIALibrarianMain()
    window.show()
    splash.finish(window)

    sys.exit(app.exec_())