Package elisa :: Package plugins :: Package good :: Package xmlmenu :: Package xmlmenu_components :: Module locations_builder :: Class LocationsBuilder
[hide private]
[frames] | no frames]

Class LocationsBuilder

source code


This class can handle a special MenuEntry-XML-Tag and create MenuNodeModels according to the data it gets.

Nested Classes [hide private]

Inherited from core.component.Component: __metaclass__

Instance Methods [hide private]
 
initialize(self)
Initialize various variables internal to the Component.
source code
 
menu_entry_identifiers__get(self) source code
 
loadmore(self, model) source code
 
unload(self, model) source code
twisted.internet.defer.Deferred
build_menu_entry(self, real_parent, node)
Fills in parent with models created from the XML description xml_node.
source code
 
_load_xdg_env(self) source code
 
_load_windows_env(self) source code
 
_add_location(self, location_uri, media, location_type='local', theme_icon='frontend') source code
 
_load_media_locations(self) source code
 
_load_user_media_locations(self) source code
 
_load_default_media_locations(self) source code
 
_got_bus_message(self, message, sender) source code

Inherited from core.component.Component: __init__, clean, load_config, save_config

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods [hide private]

Inherited from core.component.Component: __classinit__

Class Variables [hide private]
  xdg_media_types = {'XDG_MUSIC_DIR': ['audio'], 'XDG_PICTURES_D...
The different bus_messages mapped to the location_type
  location_map = {<class 'elisa.core.bus.bus_message.DeviceActio...
dict default_config = {'auto_locations': 1, 'locations': []}
used when nothing found in Application's config
  name = 'locations_builder'

Inherited from core.component.Component: checked, config_doc, id, plugin

Inherited from extern.log.log.Loggable: logCategory

Instance Variables [hide private]

Inherited from menu_entry_builder.MenuEntryBuilder: activity, model_configs

Inherited from core.component.Component: config, path

Properties [hide private]
  menu_entry_identifiers
MenuEntry identifiers it can handle; in the XML it is the attribute 'type' of the 'MenuEntry' tags

Inherited from object: __class__

Method Details [hide private]

initialize(self)

source code 

Initialize various variables internal to the Component.

This method is called by the plugin_registry after the component's config has been loaded.

Override this method if you need to perform some initializations that would normally go in Component's constructor but can't be done there because they require access to the component's config.
Overrides: core.component.Component.initialize
(inherited documentation)

menu_entry_identifiers__get(self)

source code 
Overrides: menu_entry_builder.MenuEntryBuilder.menu_entry_identifiers__get

build_menu_entry(self, real_parent, node)

source code 

Fills in parent with models created from the XML description xml_node.

If the created models have an attribute 'xml_tag' containing a cElementTree, the activity is trying to find a suitable menu_component for its children again at loadmore. Don't forget that in that case the models needs to be marked as having children.
Returns: twisted.internet.defer.Deferred
the callback of this Deferred is a list of the created models
Overrides: menu_entry_builder.MenuEntryBuilder.build_menu_entry
(inherited documentation)

Class Variable Details [hide private]

xdg_media_types

The different bus_messages mapped to the location_type
Value:
{'XDG_MUSIC_DIR': ['audio'],
 'XDG_PICTURES_DIR': ['image'],
 'XDG_VIDEOS_DIR': ['video']}

location_map

Value:
{<class 'elisa.core.bus.bus_message.DeviceAction'>: 'device',
 <class 'elisa.core.bus.bus_message.ForeignApplication'>: 'app',
 <class 'elisa.core.bus.bus_message.LocalNetworkLocation'>: 'network',
 <class 'elisa.core.bus.bus_message.InternetLocation'>: 'internet'}

Property Details [hide private]

menu_entry_identifiers

MenuEntry identifiers it can handle; in the XML it is the attribute 'type' of the 'MenuEntry' tags
Get Method:
elisa.plugins.good.xmlmenu.xmlmenu_components.locations_builder.LocationsBuilder.menu_entry_identifiers__get(self)
Set Method:
'frontend'
Delete Method:
'frontend'