本文整理汇总了Python中device.Device.refresh_devices方法的典型用法代码示例。如果您正苦于以下问题:Python Device.refresh_devices方法的具体用法?Python Device.refresh_devices怎么用?Python Device.refresh_devices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类device.Device
的用法示例。
在下文中一共展示了Device.refresh_devices方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import refresh_devices [as 别名]
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: __init__
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import refresh_devices [as 别名]
def __init__(self, maxy, maxx, install_config):
self.install_config = install_config
self.menu_items = []
self.maxx = maxx
self.maxy = maxy
self.win_width = 70
self.win_height = 16
self.win_starty = (self.maxy - self.win_height) / 2
self.win_startx = (self.maxx - self.win_width) / 2
self.menu_starty = self.win_starty + 6
self.menu_height = 5
self.progress_padding = 5
self.progress_width = self.win_width - self.progress_padding
self.progress_bar = ProgressBar(self.win_starty + 6, self.win_startx + self.progress_padding / 2, self.progress_width, new_win=True)
self.disk_buttom_items = []
self.disk_buttom_items.append(('<Custom>', self.custom_function, False))
self.disk_buttom_items.append(('<Auto>', self.auto_function, False))
self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Select a disk', True, items = self.disk_buttom_items, menu_helper = self.save_index, position = 2, tab_enabled=False)
self.partition_window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Partition', True)
self.devices = Device.refresh_devices()
示例3: __init__
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import refresh_devices [as 别名]
def __init__(self, maxy, maxx, install_config):
self.install_config = install_config
self.menu_items = []
self.maxx = maxx
self.maxy = maxy
self.win_width = 70
self.win_height = 16
self.win_starty = (self.maxy - self.win_height) / 2
self.win_startx = (self.maxx - self.win_width) / 2
self.menu_starty = self.win_starty + 6
self.menu_height = 5
self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Setup your disk', True)
self.devices = Device.refresh_devices()
示例4: __init__
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import refresh_devices [as 别名]
def __init__(self, maxy, maxx):
self.menu_items = []
self.maxx = maxx
self.maxy = maxy
self.win_width = 70
self.win_height = 17
self.win_starty = (self.maxy - self.win_height) / 2
self.win_startx = (self.maxx - self.win_width) / 2
self.menu_starty = self.win_starty + 10
# initialize the devices
self.devices = Device.refresh_devices()
self.items = [
('Auto-partitioning - use entire disk', self.guided_partitions, None),
('Manual - not implemented!', self.manual_partitions, None),
]
self.menu = Menu(self.menu_starty, self.maxx, self.items)
self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Welcome to the Photon installer', True, self.menu)
self.window.addstr(0, 0, 'First, we will setup your disks. \n\nYou can: \n\na) use auto-partitioning or\nb) you can do it manually.')