-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
98 lines (84 loc) · 3.52 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""
ProgramVer - A Python version of Microsoft's 'winver'.
Copyright (C) 2017-2024 Dog Face Development Co.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
#pylint: disable=import-error, invalid-name
from tkinter import Tk, Text, INSERT, PhotoImage, Label, Button, TOP, BOTTOM
# Import Statements
# Document Functions
def openLicense():
"""Opens the license file in a new window."""
windowl = Tk()
with open("LICENSE.txt", "r", encoding="UTF-8") as licensefile:
licensecontents = licensefile.read()
licensefile.close()
windowl.title("License")
licensetext = Text(windowl)
licensetext.insert(INSERT, licensecontents)
licensetext.pack()
def openEULA():
"""Opens the EULA file in a new window."""
windowl = Tk()
with open("EULA.txt", "r", encoding="UTF-8") as eulafile:
eulacontents = eulafile.read()
eulafile.close()
windowl.title("EULA")
eulatext = Text(windowl)
eulatext.insert(INSERT, eulacontents)
eulatext.pack()
# ProgramVer Function
def ProgramVer():
"""Main function for ProgramVer."""
window = Tk()
# Window Elements
window.title(
"Copyright & Version Info for ProgramVer"
) # change name based on program name
# UI Elements
dfdimage = PhotoImage(file="imgs/dfdlogo.gif")
pythonimage = PhotoImage(file="imgs/pythonpoweredlengthgif.gif")
dfdlogo = Label(window, image=dfdimage)
pythonpowered = Label(window, image=pythonimage)
info = Label(
window, text="ProgramVer \n Version: 1.9.0 (Build #)"
) # change respectively
trademarks = Label(
window,
text="Copyright (C) 2017 - 2024 Dog Face Development Co. \
All rights reserved in all countries. \
\n ProgramVer and its code, user interface and all other associated trademarks are protected \
\nby trademarks and copyright in Canada, the United States and other countries.",
) # change as needed
licenseblurb = Label(
window,
text="""\n ProgramVer - Version window for DFD Co.'s programs
Copyright (C) 2017-2024 Dog Face Development Company
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License below for more details.""",
) # change as needed
licensebtn = Button(window, text="Open License", command=openLicense)
eulabtn = Button(window, text="Open EULA", command=openEULA)
# Pack Statements
dfdlogo.pack(side=TOP)
info.pack(side=TOP)
trademarks.pack(side=TOP)
licenseblurb.pack(side=TOP)
licensebtn.pack(pady=5)
eulabtn.pack(pady=5)
pythonpowered.pack(side=BOTTOM)
# Maintain Window
window.mainloop()