In [29]:
%load_ext autoreload
%autoreload 2
In [31]:
cd src/
In [32]:
from simple_menu.builders.AbstractMenuBuilder import AbstractMenuBuilder
from simple_menu.builders.PropertiesMenuBuilder import PropertiesMenuBuilder
from simple_menu.handlers.MenuHandler import MenuHandler
In [34]:
builder = PropertiesMenuBuilder('../conf/sample.properties')
dynamic_sections = {'section_menu_3':[("This is a dynamic section's label",None)]}
menu = builder.build(dynamic_sections)
In [35]:
def print_my_custom_action():
print 'It works!'
def print_shutdown():
print 'SHUT DOWN !'
m_h = MenuHandler(menu,{'FEED':print_my_custom_action,'SHUTDOWN':print_shutdown})
In [ ]:
m_h.get_current_location()
In [27]:
m_h.next()
Out[27]:
In [26]:
m_h.previous()
Out[26]:
In [28]:
m_h.forward()
Out[28]:
In [ ]:
m_h.back()