本文整理汇总了Python中dot3k.menu.MenuOption类的典型用法代码示例。如果您正苦于以下问题:Python MenuOption类的具体用法?Python MenuOption怎么用?Python MenuOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MenuOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
def setup(self, config):
MenuOption.setup(self, config)
self.whitelist = self.getWhitelist(config)
self.blacklist = self.getBlacklist(config)
self.whitelist_status = self.getWhitelistStatus(config)
self.blacklist_status = self.getBlacklistStatus(config)
lcd.create_char(0, [0, 4, 14, 0, 0, 14, 4, 0]) # Up down arrow
# init webclient
self.webclient = Webclient(config)
# get the modules as JSON
complete_modules = self.getModules()
for line in complete_modules:
if self.whitelist:
if line in self.whitelist:
self.modules.append(line)
else:
self.modules.append(line)
if self.blacklist_status:
if line in self.blacklist and line in self.modules:
self.modules.remove(line)
self.ready = True
示例2: __init__
def __init__(self):
self.icon_eth = [0,0,4,4,21,21,17,31]
self.icon_wifi = [0,0,14,17,4,10,0,4,0,0]
self.icon_br = [0,4,12,31,0,31,6,4,0]
self.refresh_ips()
self.is_setup = False
MenuOption.__init__(self)
示例3: __init__
def __init__(self):
self.debug = False
self.debris = []
self.stars = []
self.running = False
self.max_debris = 10
self.max_stars = 10
self.last_update = 0
self.time_start = 0
self.sprites = [
[14,31,31,14,0 ,0 ,0 ,0 ], # 0: Debris top of char
[0 ,0 ,0 ,0 ,14,31,31,14], # 1: Debris bottom of char
[30,5 ,7 ,30,0 ,0 ,0 ,0 ], # 2: Ship top of char
[0 ,0 ,0 ,0 ,30,5 ,7, 30], # 3: Ship bottom of char
[30,5 ,7 ,30,14,31,31,14], # 4: Ship above debris
[14,31,31,14,30,5 ,7, 30], # 5: Ship below debris
]
self.width = 16
self.height = 5 # Two rows per char
self.player_x = 1 # Player horizontal position
self.player_y = 3 # Player vertical position
self.current_player_x = None
self.current_player_y = None
self.current_player_pos = None
self.fill_debris()
MenuOption.__init__(self)
示例4: setup
def setup(self, config):
MenuOption.setup(self, config)
self.edit_mode = EDIT_VOLUME
self.volume = int(self.get_option('Sound','volume',80))
self.set_volume()
self.actual_volume = self.get_volume()
self.output_mode = self.get_mode()
示例5: __init__
def __init__(self):
self.start = self.millis()
self.invader = [
[14, 31, 21, 31, 9, 18, 9, 18],
[14, 31, 21, 31, 18, 9, 18, 9]
]
MenuOption.__init__(self)
示例6: __init__
def __init__(self, settings):
MenuOption.__init__(self)
self.settings=settings
self.mode = 0
self.current_iso = 0
self.current_hflip = False
self.current_vflip = False
示例7: setup
def setup(self, config):
self.ready = False
MenuOption.setup(self, config)
if 'Radio Stations' in self.config.sections():
self.stations = self.config.options('Radio Stations')
self.ready = True
self.start()
示例8: __init__
def __init__(self):
self.selected_option = 0
self.options = [
'Pirate',
'Monkey',
'Robot',
'Ninja',
'Dolphin'
]
'''
Python has no "switch" so we'll store an array of functions
to call when an option is selected
'''
self.actions = [
self.handle_pirate,
self.handle_monkey,
self.handle_robot,
self.handle_ninja,
self.handle_dolphin,
]
'''
We want to give each menu option a status icon too, and
here's a place to store them.
'''
self.icons = [None] * 5
MenuOption.__init__(self)
示例9: __init__
def __init__(self):
hostapd_config = self.read_config_file('/etc/hostapd/hostapd.conf')
self.ssid = str(util_get_safe_from_map(hostapd_config,'ssid'))
self.psk = str(util_get_safe_from_map(hostapd_config,'wpa_passphrase'))
MenuOption.__init__(self)
示例10: __init__
def __init__(self):
self.mode = 0 # 0:Player View, 1:Menu
self.selindex = 0
self.options = [
"Pause",
"Back"
]
self.actions = [
self.do_play,
self.do_back
]
self.mpd = MPDClient()
self.mpd.timeout = 10
self.mpd.idletimeout = None
self.is_setup = False
# Icons
self.anim_play = [[0,0,8,12,14,12,8,0],[0,0,4,6,7,6,4,0],[0,0,2,3,19,3,2,0],[0,0,1,17,25,17,1,0],[0,0,16,24,28,24,16,0]]
self.anim_pause = [[0,0,0,0,0,0,0,0],[0,27,27,27,27,27,27,0]]
self.icon_stop = [0,0,31,31,31,31,31,0]
try:
self.mpd.connect("localhost", 6600)
except socket.error:
print("Could not connect to MPD")
MenuOption.__init__(self)
示例11: __init__
def __init__(self):
self.cols = 16
self.initialized = False
self.scroll_up_icon = chr(0)
self.scroll_down_icon = chr(1)
self.abbreviation_icon = chr(2)
self.placeholder_icon = chr(3)
self.caps_on = True
self.symbols_mode = False
self.cancel_aborts = False # by default, Cancel button acts as Delete
self.selection = {'row': 0, 'option': 0}
self.first_displayed_row = 0
self.uppercase_letters = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
self.lowercase_letters = list('abcdefghijklmnopqrstuvwxyz')
self.space_symbol = 'Spc'
self.line_break = '\n' # for layout only; can't be entered
self.numbers = list('0123456789')
self.quick_punctuation = list('./:@')
self.symbols = list('./:@\'"~+-=_!?,;()[]<>{}\\^|&*$%#`')
self.caps_command = "Caps"
self.symbols_command = "More"
self.delete_command = "Del"
self.cancel_command = "Cancel"
self.commit_command = "Accept"
self.commands = [self.caps_command, self.symbols_command, self.delete_command, self.cancel_command, self.commit_command]
self.uppercase_set = self.uppercase_letters
self.uppercase_set.append(self.space_symbol)
self.uppercase_set.extend(self.numbers)
self.uppercase_set.extend(self.quick_punctuation)
self.uppercase_set.extend(self.commands)
self.lowercase_set = self.lowercase_letters
self.lowercase_set.append(self.space_symbol)
self.lowercase_set.extend(self.numbers)
self.lowercase_set.extend(self.quick_punctuation)
self.lowercase_set.extend(self.commands)
self.symbols_set = self.symbols
self.symbols_set.append(self.line_break)
self.symbols_set.extend(self.commands)
self.confirm_accept = "Yes"
self.confirm_cancel = "No"
self.confirm_quit = "Quit"
self.confirm_set = [self.confirm_accept, self.confirm_cancel, self.confirm_quit]
self.display_map = [] # 2D array of options
self.display_ranges = [] # 2D array of range-arrays with option extents
self.entered_text = ''
self.confirming = False
MenuOption.__init__(self)
self.is_setup = False
示例12: __init__
def __init__(self):
self.consoleMessages = ConsoleMessages()
self.ready = False
self.modules = []
self.selected_module = 0
self.last_update = 0
MenuOption.__init__(self)
示例13: __init__
def __init__(self):
self.selected_option = 0
self.options = [
{'title': 'Play', 'action': self.handle_play, 'icon': ' '},
{'title': 'Stop', 'action': self.handle_stop, 'icon': ' '}
]
MenuOption.__init__(self)
示例14: __init__
def __init__(self):
self.ready = False
self.config = ConfigObj("init.conf")
self.cmds = None
self.selected_cmd = 0
self.last_update = 0
MenuOption.__init__(self)
示例15: __init__
def __init__(self):
self.last = self.millis()
self.last_update = 0
self.raw_dlold = 0
self.raw_ulold = 0
self.dlspeed = 0
self.ulspeed = 0
self.iface = 'eth0'
MenuOption.__init__(self)