| 1 |
nino.borges |
445 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
EulaExcepted
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
Emanuel Borges
|
| 7 |
|
|
08.27.2013
|
| 8 |
|
|
|
| 9 |
|
|
This class can be called and will diplay a EULA returning if they did or didnt except.
|
| 10 |
|
|
If they do, it will write to a file, so that it will skip later.
|
| 11 |
|
|
|
| 12 |
|
|
"""
|
| 13 |
|
|
|
| 14 |
|
|
import wx, os
|
| 15 |
|
|
|
| 16 |
|
|
class EulaAlreadyAccepted():
|
| 17 |
|
|
def __init__ (self):
|
| 18 |
|
|
self.eulaStatus = False
|
| 19 |
|
|
if os.path.exists('EulaExcepted.txt'):
|
| 20 |
|
|
eulaStatus = open('EulaExcepted.txt').read()
|
| 21 |
|
|
if eulaStatus == "True":
|
| 22 |
|
|
self.eulaStatus = True
|
| 23 |
|
|
|
| 24 |
|
|
|
| 25 |
|
|
class EulaExceptedDialog(wx.Dialog):
|
| 26 |
|
|
def __init__(self,parent):
|
| 27 |
|
|
## Check for the EULA file
|
| 28 |
|
|
if os.path.exists('Eula.TXT'):
|
| 29 |
|
|
## Check to see if it's been accepted before.
|
| 30 |
|
|
## If not, display the eula, giving them the option to accept.
|
| 31 |
|
|
## if they accept, return a yes code and write to file.
|
| 32 |
|
|
## If no, return a no code.
|
| 33 |
|
|
eulaText = open("Eula.txt").read()
|
| 34 |
|
|
wx.Dialog.__init__(self,parent, -1, "Software EULA", style = wx.DEFAULT_DIALOG_STYLE, size = (500,550))
|
| 35 |
|
|
eulaTextBox = wx.TextCtrl(self, -1,eulaText, size=(400,450),style=wx.TE_MULTILINE|wx.TE_READONLY)
|
| 36 |
|
|
okButton = wx.Button(self, wx.ID_OK, "Accept", (10, 10))
|
| 37 |
|
|
okButton.SetDefault()
|
| 38 |
|
|
cancelButton = wx.Button(self, wx.ID_CANCEL, "Cancel",(10, 10))
|
| 39 |
|
|
|
| 40 |
|
|
buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 41 |
|
|
buttonSizer.Add(okButton, 0, wx.ALL, 10)
|
| 42 |
|
|
buttonSizer.Add(cancelButton, 0, wx.ALL, 10)
|
| 43 |
|
|
|
| 44 |
|
|
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 45 |
|
|
mainSizer.Add(eulaTextBox, 0, wx.ALIGN_CENTER|wx.ALL, 10)
|
| 46 |
|
|
mainSizer.Add(buttonSizer, 0, wx.ALIGN_CENTER|wx.ALL, 10)
|
| 47 |
|
|
self.SetSizer(mainSizer)
|
| 48 |
|
|
else:
|
| 49 |
|
|
wx.Dialog.__init__(self,parent, -1, "Broken Install!!", style = wx.DEFAULT_DIALOG_STYLE, size = (200,140))
|
| 50 |
|
|
message = wx.StaticText(self, -1, """This install is broken.\nPlease download a new copy from\nhttp://ninosystems.com""")
|
| 51 |
|
|
|
| 52 |
|
|
okButton = wx.Button(self, wx.ID_CANCEL, "Exit", (10, 10))
|
| 53 |
|
|
okButton.SetDefault()
|
| 54 |
|
|
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 55 |
|
|
mainSizer.Add(message, 0, wx.ALIGN_CENTER|wx.ALL, 10)
|
| 56 |
|
|
mainSizer.Add(okButton, 0, wx.ALIGN_CENTER|wx.ALL, 10)
|
| 57 |
|
|
self.SetSizer(mainSizer)
|
| 58 |
nino.borges |
744 |
print("Software EULA not found...")
|
| 59 |
nino.borges |
445 |
return None |