Skip to content

Commit

Permalink
Add license page
Browse files Browse the repository at this point in the history
  • Loading branch information
johnisom committed Dec 10, 2023
1 parent b49aff0 commit 94975e8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright © 2023 John Isom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 3 additions & 1 deletion src/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .welcome import WelcomeFrame
from .plots import PlotsFrame
from .predictions import PredictionsFrame
from .credits import CreditsFrame
from .credits import CreditsFrame, LicenseFrame

class App(Tk):
def __init__(self, *args, **kwargs):
Expand All @@ -19,10 +19,12 @@ def __init__(self, *args, **kwargs):
self.plots_frame = PlotsFrame(self.notebook)
self.predictions_frame = PredictionsFrame(self.notebook)
self.credits_frame = CreditsFrame(self.notebook)
self.license_frame = LicenseFrame(self.notebook)
self.notebook.add(self.welcome_frame, text=self.welcome_frame.title)
self.notebook.add(self.plots_frame, text=self.plots_frame.title)
self.notebook.add(self.predictions_frame, text=self.predictions_frame.title)
self.notebook.add(self.credits_frame, text=self.credits_frame.title)
self.notebook.add(self.license_frame, text=self.license_frame.title)

# Set up the grid
self.notebook.grid(row=0, column=0, sticky=NSEW)
Expand Down
22 changes: 21 additions & 1 deletion src/gui/credits.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from tkinter import *
from tkinter import ttk
from .custom_widgets import NotebookFrame, Title, Subtitle
Expand All @@ -11,4 +12,23 @@ def __init__(self, *args, **kwargs):
title = Title(self, text='Credits')

# Set items on the grid
title.grid(row=0, column=0, sticky=NSEW)
title.grid(row=0, column=0, sticky=(N, E, W))

class LicenseFrame(NotebookFrame):
title = 'License'

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

title = Title(self, text='The MIT License (MIT)')
license_text = ''
with open(Path().parent.parent / 'LICENSE', mode='r', encoding='utf-8') as f:
license_text = f.read().strip()
license = Text(self, width=78)
license.insert(END, license_text)
license.configure(state=DISABLED)

# Set items on the grid
title.grid(row=0, column=0, sticky=(N, E, W), pady='3')
license.grid(row=1, column=0, sticky=(S, E, W))

4 changes: 2 additions & 2 deletions src/gui/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def __init__(self, *args, **kwargs):
predictions_text = 'Here you\'ll be able to predict the likely cause of a fire by giving the machine learning model some information about the fire: final size, county location, and date of discovery.\n' \
'You can also analyze the machine learning model\'s performance, making sure that you\'re getting a fairly accurate result.'
predictions_text_label = ttk.Label(self, text=predictions_text, wraplength=630, justify=LEFT)
credits_subtitle = Subtitle(self, text='Credits')
credits_text = 'The credits page has more information about the author of the project, the license used, and credits for others where credits are due.'
credits_subtitle = Subtitle(self, text='Credits / License')
credits_text = 'The credits and license pages have more information about the author of the project, the license used, and credits for others where credits are due.'
credits_text_label = ttk.Label(self, text=credits_text, wraplength=630, justify=LEFT)

# Set items on the grid
Expand Down

0 comments on commit 94975e8

Please sign in to comment.