Refactor UI imports and clean up unused code
- Removed unnecessary imports from various UI files to streamline the codebase. - Deleted the unused documentation viewer implementation in `documentationview.py`. - Cleaned up imports in `files.py` by removing `LOG_DIR` as it was not used. - Removed the temporary script `temp.py` as it was no longer needed.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
__all__ = [
|
||||
"Icon",
|
||||
"SemesterDocument",
|
||||
"app_sort",
|
||||
"name_sort",
|
||||
]
|
||||
|
||||
from .icon import Icon
|
||||
from .sortgenerator import app_sort, name_sort
|
||||
from .richtext import SemesterDocument
|
||||
from .sortgenerator import app_sort, name_sort
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# from PySide6 import Webview
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QTabWidget
|
||||
|
||||
documentation_path = "docs"
|
||||
|
||||
|
||||
class DocumentationViewer(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Documentation Viewer")
|
||||
self.setGeometry(100, 100, 800, 600)
|
||||
|
||||
self.tabs = QTabWidget()
|
||||
self.setCentralWidget(self.tabs)
|
||||
|
||||
self.set_documentation_tabs()
|
||||
|
||||
def set_documentation_tabs(self):
|
||||
files = [
|
||||
os.path.join(documentation_path, file)
|
||||
for file in os.listdir(documentation_path)
|
||||
if file.endswith(".html")
|
||||
]
|
||||
for file in files:
|
||||
with open(file, "r") as f:
|
||||
html_content = f.read()
|
||||
tab_name = os.path.basename(file).split(".")[0]
|
||||
self.load_documentation(tab_name, html_content)
|
||||
|
||||
def load_documentation(
|
||||
self,
|
||||
tab_name="Documentation",
|
||||
html_content="<h1>Documentation</h1><p>Your HTML documentation content goes here.</p>",
|
||||
):
|
||||
# open documentation
|
||||
name = tab_name
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
viewer = DocumentationViewer()
|
||||
viewer.show()
|
||||
sys.exit(app.exec())
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from src import LOG_DIR, settings
|
||||
from src import settings
|
||||
from src.database import Database
|
||||
from src.shared.logging import log
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
template = "{{sap{}_prof}} ({{sap_{}_name}})"
|
||||
result = "\n".join(template.format(i, i) for i in range(1, 201))
|
||||
|
||||
print(result)
|
||||
Reference in New Issue
Block a user