Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add possibility to set the view_mode via "plugin.add_items(items, view_mode)" #7

Merged
merged 1 commit into from
Apr 11, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/xbmcswift/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _make_listitem(self, label, label2='', iconImage='', thumbnail='',
#return li
return options['url'], li, options.get('is_folder', True)

def add_items(self, iterable):
def add_items(self, iterable, view_mode=None):
# If we are in debug mode, do not make the call to xbmc
# for each item
# if in debug mode, print it to command line
Expand All @@ -217,6 +217,8 @@ def add_items(self, iterable):
if self._mode is 'xbmc':
if not xbmcplugin.addDirectoryItems(self.handle, items, len(items)):
raise Exception, 'problem?'
if view_mode:
xbmc.executebuiltin('Container.SetViewMode(%s)' % view_mode)
xbmcplugin.endOfDirectory(self.handle)

return urls
Expand Down