Skip to content

Commit 9520522

Browse files
author
Earth1283
committed
removed trailing space
1 parent 2cb3feb commit 9520522

16 files changed

Lines changed: 219 additions & 219 deletions

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def start_splash():
1313

1414
if __name__ == "__main__":
1515
splash_proc = start_splash()
16-
16+
1717
# hack to stop the python interpterter of compiling imports
1818
if True == True:
1919
try:

pymcl/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create_actions(self):
1313
self.launch_action = QAction("Launch Game", self.main_window)
1414
self.launch_action.setShortcut(QKeySequence("Ctrl+L"))
1515
self.launch_action.triggered.connect(self.main_window.launch_page.launch_button.click)
16-
16+
1717
self.open_data_folder_action = QAction("Open Data Folder", self.main_window)
1818
self.open_data_folder_action.triggered.connect(self.main_window.settings_page.open_data_directory)
1919

@@ -114,7 +114,7 @@ def create_menu_bar(self):
114114
# Tools Menu
115115
tools_menu = menu_bar.addMenu("&Tools")
116116
tools_menu.addAction(self.clear_cache_action)
117-
117+
118118
# Help Menu
119119
help_menu = menu_bar.addMenu("&Help")
120120
help_menu.addAction(self.about_action)

pymcl/animated_widgets.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class AnimatedButton(QPushButton):
66
def __init__(self, text="", parent=None, is_secondary=False, is_destructive=False):
77
super().__init__(text, parent)
88
self.setCursor(Qt.CursorShape.PointingHandCursor)
9-
9+
1010
self.default_color = QColor("#4a9eff")
1111
self.hover_color = QColor("#5badff")
1212
self.pressed_color = QColor("#3a8eef")
13-
13+
1414
if is_secondary:
1515
self.default_color = QColor("#3c3c3c")
1616
self.hover_color = QColor("#4a4a4a")
@@ -19,17 +19,17 @@ def __init__(self, text="", parent=None, is_secondary=False, is_destructive=Fals
1919
self.default_color = QColor(200, 50, 50)
2020
self.hover_color = QColor(220, 70, 70)
2121
self.pressed_color = QColor(180, 40, 40)
22-
22+
2323
self._bg_color = self.default_color
24-
25-
# Stylesheet base - we handle background color via animation,
24+
25+
# Stylesheet base - we handle background color via animation,
2626
# so remove background-color from stylesheet if we want pure py animation,
2727
# OR we just animate a property that updates stylesheet.
2828
# But QPropertyAnimation on "styleSheet" is inefficient.
2929
# Better: use QObject property and paint event override OR simple qss transition?
3030
# PyQt doesn't support CSS transitions.
3131
# We will use a custom property for background color.
32-
32+
3333
self.setStyleSheet(f"""
3434
QPushButton {{
3535
color: white;
@@ -40,7 +40,7 @@ def __init__(self, text="", parent=None, is_secondary=False, is_destructive=Fals
4040
border: none;
4141
}}
4242
""")
43-
43+
4444
def _get_bg_color(self):
4545
return self._bg_color
4646

@@ -97,29 +97,29 @@ def __init__(self, parent=None):
9797
self.default_border = QColor("#3a3a3a")
9898
self.focus_border = QColor("#4a9eff")
9999
self.error_border = QColor("#f44336")
100-
100+
101101
# Initial style updates happen via qss usually, but we want to animate border.
102102
# Animatng border in QSS is hard via property.
103-
# We'll just stick to QSS with simple state changes for now,
103+
# We'll just stick to QSS with simple state changes for now,
104104
# OR animate a "borderColor" property.
105-
105+
106106
def shake(self):
107107
# Simple shake animation
108108
key_pos = self.pos()
109109
x = key_pos.x()
110110
y = key_pos.y()
111-
111+
112112
self.anim = QPropertyAnimation(self, b"pos")
113113
self.anim.setDuration(50)
114114
self.anim.setLoopCount(5)
115-
115+
116116
# Shake sequence: left, right, left, right...
117117
# Note: 'pos' animation on a widget in a layout might be fought by layout.
118118
# Better to simple set style to error and flash it.
119119
self.setProperty("error", True)
120120
self.style().unpolish(self)
121121
self.style().polish(self)
122-
122+
123123
QTimer.singleShot(500, self.clear_error)
124124

125125
def clear_error(self):

pymcl/background_widget.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ class BackgroundWidget(QWidget):
1212
def __init__(self, parent=None):
1313
super().__init__(parent)
1414
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents)
15-
15+
1616
self.layout = QStackedLayout(self)
1717
self.layout.setStackingMode(QStackedLayout.StackingMode.StackOne)
1818
self.layout.setContentsMargins(0, 0, 0, 0)
19-
19+
2020
# Image/GIF Label
2121
self.image_label = QLabel()
2222
self.image_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
2323
self.image_label.setScaledContents(True)
2424
self.layout.addWidget(self.image_label)
25-
25+
2626
# Video
2727
self.video_widget = QVideoWidget()
2828
self.video_widget.setAspectRatioMode(Qt.AspectRatioMode.KeepAspectRatioByExpanding)
@@ -32,40 +32,40 @@ def __init__(self, parent=None):
3232
self.player.setVideoOutput(self.video_widget)
3333
self.player.errorOccurred.connect(self._on_media_error)
3434
self.layout.addWidget(self.video_widget)
35-
35+
3636
self.movie = None
3737

3838
def _on_media_error(self, error, error_string):
3939
print(f"Media Player Error: {error} - {error_string}")
40-
40+
4141
def set_image(self, path):
4242
self.player.stop()
4343
if self.movie:
4444
self.movie.stop()
4545
self.movie = None
46-
46+
4747
pixmap = QPixmap(path)
4848
self.image_label.setPixmap(pixmap)
4949
self.layout.setCurrentWidget(self.image_label)
50-
50+
5151
def set_gif(self, path):
5252
self.player.stop()
5353
if self.movie:
5454
self.movie.stop()
55-
55+
5656
self.movie = QMovie(path)
5757
self.image_label.setMovie(self.movie)
5858
self.movie.start()
5959
self.layout.setCurrentWidget(self.image_label)
60-
60+
6161
def set_video(self, path, loop=True, mute=True):
6262
if self.movie:
6363
self.movie.stop()
6464
self.movie = None
65-
65+
6666
self.player.setSource(QUrl.fromLocalFile(path))
6767
self.player.setLoops(QMediaPlayer.Loops.Infinite if loop else 1)
6868
self.audio_output.setMuted(mute)
69-
69+
7070
self.layout.setCurrentWidget(self.video_widget)
7171
self.player.play()

pymcl/console_window.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,62 @@ def __init__(self, parent=None):
1818
self.setWindowTitle("Game Console")
1919
self.resize(900, 650)
2020
self.auto_scroll = True
21-
21+
2222
layout = QVBoxLayout(self)
2323
layout.setContentsMargins(0, 0, 0, 0)
2424
layout.setSpacing(0)
25-
25+
2626
# Toolbar
2727
toolbar = QFrame()
2828
toolbar.setStyleSheet("background-color: #252526; border-bottom: 1px solid #333;")
2929
toolbar_layout = QHBoxLayout(toolbar)
3030
toolbar_layout.setContentsMargins(10, 8, 10, 8)
31-
31+
3232
title = QLabel("Output Log")
3333
title.setStyleSheet("font-weight: bold; color: #ddd; font-size: 13px;")
3434
toolbar_layout.addWidget(title)
35-
35+
3636
toolbar_layout.addStretch(1)
37-
37+
3838
self.auto_scroll_check = QCheckBox("Auto-scroll")
3939
self.auto_scroll_check.setChecked(True)
4040
self.auto_scroll_check.setStyleSheet("color: #ccc;")
4141
self.auto_scroll_check.toggled.connect(self.set_auto_scroll)
4242
toolbar_layout.addWidget(self.auto_scroll_check)
43-
43+
4444
self.copy_btn = QPushButton("Copy")
4545
self.copy_btn.setCursor(Qt.CursorShape.PointingHandCursor)
4646
self.copy_btn.clicked.connect(self.copy_logs)
4747
toolbar_layout.addWidget(self.copy_btn)
48-
48+
4949
self.clear_btn = QPushButton("Clear")
5050
self.clear_btn.setCursor(Qt.CursorShape.PointingHandCursor)
5151
self.clear_btn.clicked.connect(self.clear_logs)
5252
toolbar_layout.addWidget(self.clear_btn)
53-
53+
5454
layout.addWidget(toolbar)
55-
55+
5656
# Console Output
5757
self.text_edit = QTextEdit()
5858
self.text_edit.setReadOnly(True)
5959
self.text_edit.setObjectName("console_output")
6060
self.text_edit.setLineWrapMode(QTextEdit.LineWrapMode.NoWrap) # Logs are better without wrap usually
61-
61+
6262
# Font selection
6363
preferred_fonts = ["JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", "Menlo", "Courier New"]
6464
font_family = "Monospace"
6565
for font in preferred_fonts:
6666
if font in QFontDatabase.families():
6767
font_family = font
6868
break
69-
69+
7070
font = QFont(font_family)
7171
font.setStyleHint(QFont.StyleHint.Monospace)
7272
font.setPointSize(10)
7373
self.text_edit.setFont(font)
74-
74+
7575
layout.addWidget(self.text_edit)
76-
76+
7777
# Apply Dark Theme
7878
self.setStyleSheet("""
7979
QWidget {
@@ -141,18 +141,18 @@ def set_auto_scroll(self, checked):
141141
def append_log(self, text):
142142
# Basic color highlighting
143143
color = "#cccccc" # default gray
144-
if "[ERROR]" in text or "Exception" in text or "at " in text or "FATAL" in text:
144+
if "[ERROR]" in text or "Exception" in text or "at " in text or "FATAL" in text:
145145
color = "#ff6b6b" # soft red
146146
elif "[WARN]" in text:
147147
color = "#f1c40f" # yellow
148148
elif "[INFO]" in text:
149149
color = "#6ab04c" # green
150150
elif "DEBUG" in text:
151151
color = "#569cd6" # blue
152-
152+
153153
formatted_text = f'<span style="color:{color};">{text}</span>'
154154
self.text_edit.append(formatted_text)
155-
155+
156156
if self.auto_scroll:
157157
scrollbar = self.text_edit.verticalScrollBar()
158158
scrollbar.setValue(scrollbar.maximum())

0 commit comments

Comments
 (0)