def __delitem__(self, name): log.debug('remove %s.' % name) try: self.provided_resource.pop(name) log.debug('%s removed.', name) except KeyError: raise NotYetProvidedError('%s is not available' % name)
def __getitem__(self, name): log.debug('acquire %s.', name) try: res = self.provided_resource[name] log.debug('%s acquired.', name) return res except KeyError: raise NotYetProvidedError('%s is not available' % name)
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))
def handle(self, key, keypress, ts): try: mapped = self.kbmap_get(key.upper()) mapped.post(dict(count=1, timeout=ts + 0.40000000000000002)) except IndexError: log.debug('Key %s not recognised.' % key)
from pygui.shared import pygui_globs from peewee.notifier import sched class PluginInterface(object): def __init__(self, post_key): self.post_key = post_key self.plugin_name = 'DirectFB Input' display = pygui_globs['display'] display.register_event(self.handle) self.kbmap_get = DIRECTFB_MAP.get def handle(self, key, keypress, ts): try: mapped = self.kbmap_get(key.upper()) mapped.post(dict(count=1, timeout=ts + 0.40000000000000002)) except IndexError: log.debug('Key %s not recognised.' % key) ]: i: o: self.nodes: {0: <unpyclib.structure.node instance at 0xb761bdec>} from __future__ import absolute_import from peewee.debug import log from pygui.input import DIRECTFB_MAP from pygui.shared import pygui_globs from peewee.notifier import sched class PluginInterface(object): def __init__(self, post_key):
def __setitem__(self, name, value): log.debug('%s given.' % name) self.provided_resource[name] = value if len(self.provided_resource) > 10: log.warning('BE CAREFUL ! Too many elements in shared namespace !')
def __delitem__(self, name): log.debug('remove %s.' % name)
def __getitem__(self, name): log.debug('acquire %s.', name)
def __setitem__(self, name, value): log.debug('%s given.' % name)
class NotYetProvidedError(KeyError): pass class _Globals(object): provided_resource = dict() def __setitem__(self, name, value): log.debug('%s given.' % name) self.provided_resource[name] = value if len(self.provided_resource) > 10: log.warning('BE CAREFUL ! Too many elements in shared namespace !') def __getitem__(self, name): log.debug('acquire %s.', name) try: res = self.provided_resource[name] log.debug('%s acquired.', name) return res except KeyError: raise NotYetProvidedError('%s is not available' % name) def __delitem__(self, name): log.debug('remove %s.' % name) try: self.provided_resource.pop(name) log.debug('%s removed.', name) except KeyError: raise NotYetProvidedError('%s is not available' % name) __contains__ = provided_resource.__contains__ __iter__ = provided_resource.__iter__
return None def __getitem__(self, name): log.debug('acquire %s.', name) try: res = self.provided_resource[name] log.debug('%s acquired.', name) return res except KeyError: raise NotYetProvidedError('%s is not available' % name) return None def __delitem__(self, name): log.debug('remove %s.' % name) try: self.provided_resource.pop(name) log.debug('%s removed.', name) except KeyError: raise NotYetProvidedError('%s is not available' % name) return None __contains__ = provided_resource.__contains__ __iter__ = provided_resource.__iter__ log.debug('import shared variables provider') if config.DEBUG or log_level: pygui_globs = _Globals() else: pygui_globs = {}
pass 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)) ]: i: o: self.nodes: {0: <unpyclib.structure.node instance at 0xb75768cc>} from __future__ import absolute_import from WyRPC import WyXMLRPCProxy from peewee.debug import log from marker_dup_to_parent import process, GraphicalCopy from pygui.markerlist import get_marker_from_item, IncompatibleMarkerlistDestination, markerlists