コード例 #1
0
ファイル: partitionISO.py プロジェクト: TiejunChina/photon
    def __init__(self, maxy, maxx, install_config):
        self.maxx = maxx
        self.maxy = maxy
        self.win_width = maxx - 4
        self.win_height = maxy - 4
        self.install_config = install_config
        self.path_checker = []

        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.install_config['partitionsnumber'] = 0
        self.devices = Device.refresh_devices_bytes()
        self.has_slash = False
        self.has_remain = False
        self.has_empty = False

        self.disk_size = []
        for index, device in enumerate(self.devices):
            self.disk_size.append((device.path, int(device.size) / 1048576))

        self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx,
                             'Welcome to the Photon installer', False, can_go_next=False)
        Device.refresh_devices()
コード例 #2
0
    def __init__(self, maxy, maxx, install_config):
        self.maxx = maxx
        self.maxy = maxy
        self.win_width = maxx - 4
        self.win_height = maxy - 4
        self.install_config = install_config
        self.path_checker = []

        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.cp_config = {}
        self.cp_config['partitionsnumber'] = 0
        self.devices = Device.refresh_devices_bytes()
        self.has_slash = False
        self.has_remain = False
        self.has_empty = False

        self.disk_size = []
        self.disk_to_index = {}
        for index, device in enumerate(self.devices):
            self.disk_size.append((device.path, int(device.size) / 1048576))
            self.disk_to_index[device.path] = index

        self.window = Window(self.win_height,
                             self.win_width,
                             self.maxy,
                             self.maxx,
                             'Welcome to the Photon installer',
                             False,
                             can_go_next=False)
        Device.refresh_devices()
コード例 #3
0
    def initialize_devices(self):
        self.devices = Device.refresh_devices_bytes()

        # Subtract BIOS&ESP SIZE from the disk_size since this much is hardcoded for bios
        # and efi partition in installer.py
        for index, device in enumerate(self.devices):
            self.disk_size.append(
                (device.path,
                 int(device.size) / 1048576 - (BIOSSIZE + ESPSIZE + 2)))
            self.disk_to_index[device.path] = index