Package traylib :: Module tray_config
[frames] | no frames]

Source Code for Module traylib.tray_config

 1  from traylib import * 
 2  from traylib.config import Config 
 3   
 4   
5 -class TrayConfig(Config):
6
7 - def __init__(self, 8 name, 9 menus, 10 separators):
11 """ 12 Creates a new C{TrayConfig}. 13 14 @param name: The name of the tray. 15 @param menus: Where to show boxes for the main menu: C{LEFT}, C{RIGHT} 16 or C{LEFT|RIGHT}. 17 @param separators: Where to show separators (may be C{0}). 18 """ 19 assert isinstance(name, str) 20 assert menus in (LEFT, RIGHT) 21 assert separators >= 0 and separators <= LEFT|RIGHT 22 23 Config.__init__(self) 24 self.add_attribute('name', name, 'update_option_name') 25 self.add_attribute('menus', menus, 'update_option_menus') 26 self.add_attribute('separators', separators, 'update_option_separators')
27 28 name = property(lambda self : self.get_attribute('name'), 29 lambda self, name : self.set_attribute('name', name)) 30 menus = property(lambda self : self.get_attribute('menus'), 31 lambda self, menus : self.set_attribute('menus', menus)) 32 separators = property(lambda self : self.get_attribute('separators'), 33 lambda self, separators : self.set_attribute('separators', separators))
34