当前位置: 首页>>代码示例>>Python>>正文


Python MenuOption.__init__方法代码示例

本文整理汇总了Python中dot3k.menu.MenuOption.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python MenuOption.__init__方法的具体用法?Python MenuOption.__init__怎么用?Python MenuOption.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dot3k.menu.MenuOption的用法示例。


在下文中一共展示了MenuOption.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
	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)
开发者ID:rGunti,项目名称:Yuki-Chan-Music-Player,代码行数:9,代码来源:WiFiHotspot.py

示例2: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
 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)
开发者ID:rGunti,项目名称:Yuki-Chan-Music-Player,代码行数:9,代码来源:IPViewer.py

示例3: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
  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)
开发者ID:Cloudsimc,项目名称:dot3k,代码行数:33,代码来源:debris.py

示例4: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
	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)
开发者ID:rGunti,项目名称:Yuki-Chan-Music-Player,代码行数:29,代码来源:MusicPlayer.py

示例5: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
    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
开发者ID:monkeymademe,项目名称:dotsnap,代码行数:9,代码来源:camera.py

示例6: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
 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)
开发者ID:akx,项目名称:dot3k,代码行数:9,代码来源:menu.py

示例7: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
  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)
开发者ID:castrofernandez,项目名称:raspberry-pi,代码行数:32,代码来源:03_doing_stuff.py

示例8: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
	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
开发者ID:mattgemmell,项目名称:DOT-MGTextEntry,代码行数:61,代码来源:mgtext.py

示例9: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
    def __init__(self):
        self.consoleMessages = ConsoleMessages()
	self.ready = False
	self.modules = []
	self.selected_module = 0	
	self.last_update = 0
	
        MenuOption.__init__(self)
开发者ID:molotof,项目名称:FruityDisplay_Display-o-Tron_3000,代码行数:10,代码来源:modules.py

示例10: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
    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)	
开发者ID:Floppynator,项目名称:FruityDisplay_Display-o-Tron_3000,代码行数:10,代码来源:commandz.py

示例11: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
    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)
开发者ID:j4y-funabashi,项目名称:orac,代码行数:10,代码来源:radio.py

示例12: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
 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)
开发者ID:akx,项目名称:dot3k,代码行数:11,代码来源:graph.py

示例13: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
 def __init__(self, backlight):
   self.backlight = backlight
   self.hue = 0
   self.sat = 100
   self.val = 100
   self.mode = 0
   self.modes = ['h','s','v','r','g','b']
   self.from_hue()
   MenuOption.__init__(self)
开发者ID:Cloudsimc,项目名称:dot3k,代码行数:11,代码来源:utils.py

示例14: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
  def __init__(self):
    self.items = []

    self.selected_item = 0

    self.scanning = False

    MenuOption.__init__(self)
    
    self.is_setup = False
开发者ID:rGunti,项目名称:Yuki-Chan-Music-Player,代码行数:12,代码来源:WiFiScan.py

示例15: __init__

# 需要导入模块: from dot3k.menu import MenuOption [as 别名]
# 或者: from dot3k.menu.MenuOption import __init__ [as 别名]
 def __init__(self, backlight):
   self.backlight = backlight
   self.hue = 0
   self.sat = 100
   self.val = 100
   self.mode = 0
   self.modes = ['h','s','v','r','g','b','e']
   self.from_hue()
   self._icons_setup = False
   MenuOption.__init__(self)
开发者ID:sandyjmacdonald,项目名称:dot3k,代码行数:12,代码来源:utils.py


注:本文中的dot3k.menu.MenuOption.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。