forked from vmware/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlicense.py
executable file
·49 lines (34 loc) · 1.46 KB
/
license.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
#! /usr/bin/python2
#
# Copyright (C) 2015 vmware inc.
#
# Author: Mahmoud Bassiouny <[email protected]>
from window import Window
from actionresult import ActionResult
from textpane import TextPane
class License(object):
def __init__(self, maxy, maxx):
self.maxx = maxx
self.maxy = maxy
self.win_width = maxx - 4
self.win_height = maxy - 4
self.win_starty = (self.maxy - self.win_height) / 2
self.win_startx = (self.maxx - self.win_width) / 2
self.text_starty = self.win_starty + 4
self.text_height = self.win_height - 6
self.text_width = self.win_width - 6
self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Welcome to the Photon installer', False, items=[])
def display(self, params):
accept_decline_items = [
('<Accept>', self.accept_function),
('<Cancel>', self.exit_function)
]
title = 'VMWARE 1.0 LICENSE AGREEMENT'
self.window.addstr(0, (self.win_width - len(title)) / 2, title)
self.text_pane = TextPane(self.text_starty, self.maxx, self.text_width, "EULA.txt", self.text_height, accept_decline_items)
self.window.set_action_panel(self.text_pane)
return self.window.do_action()
def accept_function(self):
return ActionResult(True, None)
def exit_function(self):
exit(0)