Пример #1
0
def get_action_info_list(context):
	stack = pygui_globs['menustack']
	act = []
	fl = markerlists().get(context['menu'].universe)
	if context['menu'].type in ('image', 'video', 'video_image'):
		pass
	menu_video_photo = False
	if context['menu'].type in ('audio',):
		pass
	menu_music = False
	if isinstance(stack.menus_stack[-2], menu.MarkerNavigator):
		for stack_layer in reversed(stack.menus_stack):
			if isinstance(stack_layer, menu.Navigator) and not isinstance(stack_layer, menu.MarkerNavigator):
				break
				continue
		if stack_layer:
			act.append(ActionItem(_('Display'), type_='action', action=(lambda : stack.back_to_menu(stack_layer))))
	if (menu_music or menu_video_photo) and (user_config['security']['parent_mode'] or not user_config['security']['parental_control']):
		if context['parent']['backend'] != 'upnp':
			act.append(ActionItem(_('Create a new folder'), type_='action', action=execute_mkdir, args=[context]))
	if fl and context['parent']['backend'] != 'upnp' and (user_config['security']['parent_mode'] or not user_config['security']['parental_control']):
		act.append(ActionItem(_('Duplicate marked item'), type_='action', action=execute_copy_marked_items, args=[context['parent'], fl]))
		for plugin_name in ('marker_create_playlist',):
			plugin = actions[plugin_name]
			act.append(ActionItem(_(plugin.caption), type_='action', action=plugin.execute, args=[context]))
	if menu_video_photo and any(<genexpr>(context['menu'].get_item_list('main_list'))):
		act.append(ActionItem(_('Display "%s" as thumbnails') % context['parent'].name, type_='action', action=push_thumbnail_menu, args=(context, stack)))
	return act
Пример #2
0
def get_action_info_list(context):
	menu_type = context['menu'].type
	from pygui.markerlist import markerlists
	fl = markerlists().get(context['menu'].universe)
	if fl is not None:
		fl.menu = context['menu']
	act = []
	if user_config['security']['parent_mode'] or not user_config['security']['parental_control']:
		if menu_type in ('tv_navigator',):
			selected = context['selected']
			if isinstance(selected, Playlist):
				act.append(ActionItem(_('Rename'), type_='action', action=execute_rename, args=[context]))
				act.append(ActionItem(_('Delete'), type_='action', action=execute_delete, args=[context, fl]))
			return act
		if menu_type in ('scheduled_navigator',):
			act.append(ActionItem(_('Rename'), type_='action', action=execute_rename_record, args=[context]))
			act.append(ActionItem(_('Delete'), type_='action', action=execute_cancel_record, args=[context]))
			return act
		if context['selected']['backend'] != 'upnp':
			act.append(ActionItem(_('Rename'), type_='action', action=execute_rename, args=[context]))
			act.append(ActionItem(_('Delete'), type_='action', action=execute_delete, args=[context, fl]))
	if 'transcode' in plugins and context['selected'].type in ('video',):
		from pygui.shared import pygui_globs
		psp_path = pygui_globs['psp_path']
		if psp_path:
			from pygui.actions.jobs.transcode import transcode
			context['psp_path'] = psp_path
			act.append(ActionItem(_('Transcode to PSP\xe2\x84\xa2'), type_='action', action=transcode, args=[context]))
	return act
Пример #3
0
def execute(context):
	fl = markerlists().get(context['menu'].universe)
	context['parent'].show_menu()
	try:
		context['menu'].stop()
	except:
		pass
	finally:
		fl.play()
Пример #4
0
	def __do_delete():
		fl = markerlists().get(context['menu'].universe)
		try:
			fl.vfs_delete()
		except RemoveError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
Пример #5
0
def execute(context):
	from pygui.window import KeyboardWindow, MessageWindow
	mlist = markerlists().get(context['menu'].universe)
	def __create(k):
		name = k._text.strip()
		title = _("Can't use that name")
		if not name:
			message = _('That name is not valid. Choose another one.')
			MessageWindow(message, title, button=None).show(timeout=5)
			return None

	name = context['parent'].get_free_child_name(_('Playlist'))
	kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)
def execute(context):
	if not is_compatible(context):
		raise IncompatibleMarkerlistDestination
	fl = markerlists().get(context['menu'].universe)
	if context['selected'].type in ('disc', 'dvd'):
		mountpoint = context['selected']['media'].mountpoint
		dir = context['selected'].filename.replace(mountpoint, '/', 1)
		burn_clt = WyXMLRPCProxy('/tmp/wy_burning')
		burn_clt.new_burning()
		burn_clt.set_burn_mode('data_cd')
		burn_clt.set_finalized(False)
		burn_clt.set_new_session(False)
		for item in fl.items:
			log.debug('Add to burnlist : %s' % item.filename)
			burn_clt.add_files(item.filename, dir)
	else:
		dst = context['selected'].filename
		process(GraphicalCopy(context['selected'], fl, dst))
Пример #7
0
	def event_marker(self, event):
		play = self.player.navigator
		sel = play.selected
		if sel is None:
			log.warning('Nothing to put in markerlist')
			return True
		if not isinstance(sel, Markerlist):
			marker = markerlists()[self.player.universe]
			if sel.is_marked():
				marker.del_item(sel)
			else:
				w = None
				if isinstance(sel, DirItem):
					w = LoadingWindow('')
					w.show()
				marker.add_item(sel)
				if w:
					w.hide()
		play._update_marker()
		return True
Пример #8
0
def execute(context):
	from pygui.window import KeyboardWindow, MessageWindow
	menu = context['menu']
	mlist = markerlists().get(menu.universe)
	favorites_root = HiddenRoot().get_child('TV Favorites', menu)
	def __create(k):
		name = k._text.strip()
		title = _("Can't use that name")
		if not name:
			message = _('That name is not valid. Choose another one.')
			MessageWindow(message, title, button=None).show(timeout=5)
			return None
		try:
			mlist.create_playlist(container=favorites_root, name=name)
			k.hide()
			menu.back_to_root()
			pygui_globs['menustack'].back_to_menu(menu)
		except CreateContainerError:
			MessageWindow(text=_('Error while creating the favorite.'), title=_('Error')).show(timeout=5)
		except:
			except FilenameExistsError:
				MessageWindow(text=_('A favorite with that name already exists.'), title=title).show(timeout=5)
		return None
Пример #9
0
self.nodes: {0: <unpyclib.structure.node instance at 0xb767cdac>}
nname: 0
n 0(None)[from pygui.menu.menu import SearchMenu
stack.back_to_menu(context['menu'])
context['menu'].stop()
search_menu = SearchMenu(universe=context['menu'].universe)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb767c74c>}
nname: 0
n 0(None)[user_config['security']['show_hidden'] = val
user_config.save()
markerlists().clear_all_markerlists()
stack.back_to_menu(context['menu'])
context['menu'].reload_func()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb767c88c>}
nname: 0
n 0(None)[user_config['security']['parent_mode'] = False
user_config.save()
markerlists().clear_all_markerlists()
stack.back_to_menu(context['menu'])
context['menu'].reload_func()
]:
	i: 
Пример #10
0
def execute(context):
	fl = markerlists().get(context['menu'].universe)
	fl.clear()
	context['parent'].show_menu()
	context['menu']._update_marker()
Пример #11
0
nname: 133
n 133(<dummy_ex3> EXC_MATCH BrowseError)[]:
	i: 0(except)
	o: 143(t), 178(f)

nname: 101
n 101(None)[others = sum(<genexpr>(favorites_root.browse()))
]:
	i: 0(try)
	o: 180()

nname: 0
n 0(None)[from pygui.window import KeyboardWindow, MessageWindow
menu = context['menu']
mlist = markerlists().get(menu.universe)
favorites_root = HiddenRoot().get_child('TV Favorites', menu)
def __create(k):
	name = k._text.strip()
	title = _("Can't use that name")
	if not name:
		message = _('That name is not valid. Choose another one.')
		MessageWindow(message, title, button=None).show(timeout=5)
		return None
	try:
		mlist.create_playlist(container=favorites_root, name=name)
		k.hide()
		menu.back_to_root()
		pygui_globs['menustack'].back_to_menu(menu)
	except CreateContainerError:
		MessageWindow(text=_('Error while creating the favorite.'), title=_('Error')).show(timeout=5)
Пример #12
0
def execute(context):
	fl = markerlists().get(context['menu'].universe)
Пример #13
0
def is_compatible(context):
	fl = markerlists().get(context['menu'].universe)
	return bool(fl)
Пример #14
0
def is_available(context):
	fl = markerlists().get(context['menu'].universe)
	return bool(fl)
Пример #15
0
	o: 195()

nname: 146
n 146(isinstance(sel, DirItem))[w = None
]:
	i: 97(f)
	o: 168(t), 194(f)

nname: 129
n 129(None)[marker.del_item(sel)
]:
	i: 97(t)
	o: 229()

nname: 97
n 97(sel.is_marked())[marker = markerlists()[self.player.universe]
]:
	i: 52&67(f)
	o: 129(t), 146(f)

nname: 83
n 83(None)[play._error_spawner()
]:
	i: 52&67(t)
	o: 239()

nname: 52&67
n 52&67(isinstance(sel, Markerlist) or sel.universe == 'net_services')[]:
	i: 30(), 51()
	o: 83(t), 97(f)
Пример #16
0
]:
	i: 
	o: 24()

nname: 0
n 0(None)[try:
	return context['menu'].type in 'audio'
except Exception, e:
	return False
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765a9ec>}
nname: 0
n 0(None)[fl = markerlists().get(context['menu'].universe)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765a70c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from pygui.markerlist import get_marker_from_item, markerlists
from peewee.debug import DEBUG, log
caption = '*Rename marked items (with album tag)'
def is_compatible(context):
	try:
		return context['menu'].type in 'audio'
	except Exception, e:
		return False
Пример #17
0
	o: 168()

nname: 119
n 119(isinstance(sel, DirItem))[w = None
]:
	i: 70(f)
	o: 141(t), 167(f)

nname: 102
n 102(None)[marker.del_item(sel)
]:
	i: 70(t)
	o: 206(JA)

nname: 70
n 70(sel.is_marked())[marker = markerlists()[self.player.universe]
]:
	i: 55(f)
	o: 102(t), 119(f)

nname: 55
n 55(isinstance(sel, Markerlist))[]:
	i: 33(), 54()
	o: 70(f), 205(t)

nname: 54
n 54(None)[]:
	i: 0(f)
	o: 55()

nname: 33
Пример #18
0
	o: 

nname: 187
n 187(None)[]:
	i: 0&143(f)
	o: 188()

nname: 163
n 163(None)[context['menu'].contextual_windows.append(kbd)
]:
	i: 0&143(t)
	o: 188()

nname: 0&143
n 0&143(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[from pygui.window import KeyboardWindow, MessageWindow
mlist = markerlists().get(context['menu'].universe)
def __create(k):
	name = k._text.strip()
	title = _("Can't use that name")
	if not name:
		message = _('That name is not valid. Choose another one.')
		MessageWindow(message, title, button=None).show(timeout=5)
		return None

name = context['parent'].get_free_child_name(_('Playlist'))
kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
kbd.show()
]:
	i: 
	o: 163(t), 187(f)
Пример #19
0
def execute(context):
	def __do_delete():
		fl = markerlists().get(context['menu'].universe)
Пример #20
0
	i: 42(t)
	o: 248()

nname: 42
n 42(<dummy_ex3> EXC_MATCH RemoveError)[]:
	i: 0(except)
	o: 52(t), 113(f)

nname: 28
n 28(None)[fl.vfs_delete()
]:
	i: 0(try)
	o: 248()

nname: 0
n 0(None)[fl = markerlists().get(context['menu'].universe)
]:
	i: 
	o: 28(try), 42(except)

nname: 42
n 42(None)[except RemoveError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
except:
	except NotPermittedError, e:
		PRINT_EXCEPTION()
		if e.message == 'NOT_SUPPORTED_BY_FS':
			BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
		else:
			MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
Пример #21
0
def display_hidden_items(val, context, stack):
	user_config['security']['show_hidden'] = val
	user_config.save()
	markerlists().clear_all_markerlists()
	stack.back_to_menu(context['menu'])
	context['menu'].reload_func()
Пример #22
0
def switch_to_children_mode(context, stack):
	user_config['security']['parent_mode'] = False
	user_config.save()
	markerlists().clear_all_markerlists()
	stack.back_to_menu(context['menu'])
	context['menu'].reload_func()
Пример #23
0
def execute(context):
	fl = markerlists().get(context['menu'].universe)

]:
Пример #24
0
	o: 187(for), 232(AF)

nname: 67
n 67(None)[mountpoint = context['selected']['media'].mountpoint
dir = context['selected'].filename.replace(mountpoint, '/', 1)
burn_clt = WyXMLRPCProxy('/tmp/wy_burning')
burn_clt.new_burning()
burn_clt.set_burn_mode('data_cd')
burn_clt.set_finalized(False)
burn_clt.set_new_session(False)
]:
	i: 23(t)
	o: 177(loop), 276(AL)

nname: 23
n 23(context['selected'].type in ('disc', 'dvd'))[fl = markerlists().get(context['menu'].universe)
]:
	i: 12(), 22()
	o: 67(t), 236(f)

nname: 22
n 22(None)[]:
	i: 0(t)
	o: 23()

nname: 12
n 12(None)[raise IncompatibleMarkerlistDestination
]:
	i: 0(f)
	o: 23()