Skip to content

Commit

Permalink
Merge pull request #49 from cortisiko/48-fix-bug-when-the-app-relaunc…
Browse files Browse the repository at this point in the history
…hes-after-closed

fix: Fix double launch bug
  • Loading branch information
cortisiko authored Oct 8, 2024
2 parents 3eae6f3 + 578cee1 commit 9fdccb1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
__pycache__
tests/.coverage
tests/.test-results
dist/*
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of positional arguments (see R0917).
max-positional-arguments = 10

[EXCEPTIONS]

Expand Down
2 changes: 0 additions & 2 deletions app/financials/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
price_data: Handles price data retrieval.
ticker: Handles ticker symbol retrieval.
Constants:
ERROR_MESSAGE (str): Error message to return in case of invalid stock symbol.
Functions:
get_company_sector(ticker_symbol)
Expand Down
3 changes: 3 additions & 0 deletions app/pages/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from tkmacosx import Button
else:
from tkinter import Button


class BasePage(tk.Frame):
# pylint: disable=too-many-instance-attributes
"""
Expand All @@ -25,6 +27,7 @@ class BasePage(tk.Frame):
yearly_text (str): The text value for the annual option in the radio button.
bg_color (str): The background color of the frame.
"""

# pylint: disable=line-too-long

def __init__(self, parent, controller, title, quarterly_text, yearly_text, bg_color='#2C3E50', fg_color='white'):
Expand Down
6 changes: 5 additions & 1 deletion user_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import tkinter as tk
import sys
import os
import multiprocessing
from PIL import Image, ImageTk

from app.pages import (
Expand Down Expand Up @@ -116,10 +117,13 @@ def on_closing(self):


if __name__ == "__main__":

multiprocessing.freeze_support() # This prevents double-execution

try:
app = UserInterFace()
app.geometry("1200x800")
app.protocol("WM_DELETE_WINDOW", app.on_closing)
app.mainloop()
except KeyboardInterrupt as e:
print("closing app")
print("Closing app")

0 comments on commit 9fdccb1

Please sign in to comment.