예제 #1
0
파일: __init__.py 프로젝트: rayman18/wydev
VideoPlayer = None
TVPlayer = None
DVDPlayer = None
ChannelScanner = None
ImageViewer = None
WebBrowser = None
]:
	i: 0(t)
	o: 1020()

nname: 0
n 0(config.no_PLAYERS)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from pygui.config import user_config, plugins
from pygui.shared import pygui_globs
log = GET_LOGGER(__name__)
forward_tricks_icons = {0: 'ff1', 1: 'ff2', 2: 'ff3', 3: 'ff4', 4: 'ff5'}
backward_tricks_icons = {0: 'bw1', 1: 'bw2', 2: 'bw3', 3: 'bw4', 4: 'bw5'}
log.info('Loading players...')
import pygui.config as config
]:
	i: 
	o: 227(t), 273(f)

nname: 1020
n 1020(None)[log.info('Players loaded!')
]:
	i: 227(), 971()
	o: 

nname: 971
예제 #2
0
nname: 75
n 75(None)[from wyvas import __version__
from wyvas import Progressbar, TextBlock, set_theme_dir
log.debug('wyvas widgets imported')
from pygui.config import themes_dir
set_theme_dir(themes_dir)
]:
	i: 0(try)
	o: 239()

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from wyvas import Container, Image, Text
log = GET_LOGGER(__name__)
]:
	i: 
	o: 75(try), 162(except)

nname: 162
n 162(None)[except ImportError:
	log.error('Cannot import widgets from wyvas')
	from .progressbar import Progressbar
	from .textblock import TextBlock
	log.debug('pygui widgets imported')
from .core.widgetfactory import WidgetLibrary
]:
	i: 0()
	o: 
예제 #3
0
			else:
				self.start_pos = None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0x8fa3f0c>}
nname: 0
n 0(None)[import threading
from struct import unpack, calcsize
import struct
import pygui.eventmanager.events as events
from peewee.notifier import descriptor_watch
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
log = GET_LOGGER(__name__)
class PluginInterface(.):
	__doc__ = '\n    Input plugin for joystick device based on linux input event interface.\n    Used for now for uwand rcu\n    '
	JS_EVENT_BUTTON = 1
	JS_EVENT_AXIS = 2
	JS_EVENT_INIT = 128
	JS_EVENT = 'IhBB'
	JS_EVENT_SIZE = calcsize(JS_EVENT)
	def __init__(self, *args):
		threading.Thread.__init__(self)
		log.debug('Preparing joystick plugin...')
		self.setDaemon(True)
		self.setName('JoystickPlugin')
		self.dev = open('/dev/input/js0')
		self.pos = [0, 0]
		self.max_val = 32768
예제 #4
0
파일: transcode.py 프로젝트: rayman18/wydev
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb774d46c>}
nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.messages import send as louie_send
from pygui.shared import pygui_globs
from peewee.notifier import Task
from pygui.config import user_config, TMP_DIR
from pygui.window import MessageWindow
from time import sleep
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
transcode_resolution = (720, 480, 1, 50)
change_resolution = True
thm_src_file = '/usr/share/pygui/skins/wybox/icons/mimetypes/psp_thumb_wyplay.thm'
def _set_resolution(resolution):
	w, h, interlaced, freq = resolution
	pygui_globs['display'].set_resolution((w, h), interlaced, freq)

def _get_psp_filenames(psp_path):
	index = 99999
	join = os.path.join
	exists = os.path.exists
	psp_prefix = os.path.join(psp_path, 'video', 'M4V')
	while exists(psp_prefix + '%s.MP4' % index) or exists(psp_prefix + '%s.THM' % index):
		index -= 1
	else:
예제 #5
0
	self.ask_led_action = wdb.signal('/com/wyplay/wycrs/wylight', 'callLedAction', 'i')
	self.ask_led_action(action_id)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb768460c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.misc_utils import MetaSingleton
from pygui.shared import pygui_globs
import functools
import fcntl
log = GET_LOGGER(__name__)
class WyLed(object):
	__doc__ = ' Switches leds on or off '
	__metaclass__ = MetaSingleton
	def __init__(self):
		try:
			self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
			fd = self._WyLed__wyled0.fileno()
		except Exception, e:
			log.error("Can't load Led subsystem: %s", str(e))
			def self.on():
				return None

			def self.off():
				return None
예제 #6
0
파일: lirc.py 프로젝트: wydevices/wydevices
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76e2e0c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.notifier import Task
from peewee.gettime import time
from peewee.debug import GET_LOGGER
from Queue import Full
from pygui.input import DIRECTFB_MAP
from socket import socket, AF_UNIX, SOCK_STREAM
import threading
log = GET_LOGGER(__name__)
class PluginInterface(.):
	__doc__ = '\n    Plugin for stdin control.\n    '
	def __init__(self, *args):
		threading.Thread.__init__(self)
		try:
			self.lircd = socket(AF_UNIX, SOCK_STREAM)
			self.lircd.connect('/dev/lircd')
		except:
			log.error("Can't load lirc plugin")
			del self.lircd
		else:
			self.kbmap_get = DIRECTFB_MAP.get
			self.setDaemon(True)
			self.setName('LircPlugin')
			Task(self.start).start(1.0)
예제 #7
0
#
# Description:
#
# GetTime Entry Point Definition
#
#
#
# Changes:
#
# 2012-04-15
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import GET_LOGGER

log = GET_LOGGER(__name__)

try:
	from peewee._gettime import time
except ImportError:
	log.error("Couldn't import monotonic time C module. Falling back to time.time.")
	from time import time
예제 #8
0
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

# templates values:
#
# ('val1', 'val2') : mandatory, accepted values in tuple
# (): mandatory, accept all values (must be a string)
# ('val1', 'val2', None): optional, accepted values in tuple
# (None,): optional, accept all values (must be a string)

from copy import copy
from peewee.misc_utils import MetaSingleton
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
import wynetwork as wn

log = GET_LOGGER(__name__)

tpl_base = {
    'active': ('false', 'true'),
    'networkType': ('802.3', '802.11'),
    'ipConfigType': ('upnp', 'static'),
    'interface': ()
}

tpl_updaters = {
    '01_networkType_802.11': {
        'essid': (),
        'hidden': ('false', 'true', None),
        'authType': ('WEP', 'WPA', 'WPA2', None)
    },
    '02_hidden_true': {
예제 #9
0
	return True

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb77573ac>}
nname: 0
n 0(None)[from __future__ import absolute_import
from .core import MenuEventHandler
from peewee.debug import GET_LOGGER
from pygui.item.mediaitem.core import DirItem
from pygui.markerlist import markerlists, Markerlist
from pygui.window import LoadingWindow
from pygui.shared import pygui_globs
log = GET_LOGGER(__name__)
class NavigatorEventHandler(MenuEventHandler):
	__doc__ = '\n    Event manager for Navigator (file browser)\n    '
	def __init__(self, player):
		MenuEventHandler.__init__(self, player)

	def event_right(self, event):
		self.player.browse_selected()
		return True

	def event_select(self, event):
		self.player.execute_selected()
		return True

	def event_left(self, event):
		self.player.browse_previous()
예제 #10
0
    'type': 2,
    'mode': 3,
    'ip': 4,
    'netmask': 5,
    'gateway': 6,
    'dns1': 7,
    'dns2': 8,
    'network': 9,
    'cypher': 10,
    'auth': 11,
    'key': 12,
    'key_mgt': 13
}

dbus_service = 'org.freedesktop.NetworkManager'
log = GET_LOGGER('network')


# Wrap DBUS call
def call(m):
    try:
        ret = m()
    except Exception, e:
        log.error('dbus error while calling %s: %s', m, e)
        PRINT_EXCEPTION(e)
        ret = None
    return ret


# TODO CHECK else '.'
FILTER = ''.join(
예제 #11
0
	for bar in self.get_list_obj_by_name(self._bar_name):
		bar.resize(width=computed_pos)
	for indicator in self.get_list_obj_by_name(self._indicator_name):
		indicator.move(hcenter=computed_pos)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb772740c>}
nname: 0
n 0(None)[from __future__ import absolute_import
import wyvas
from peewee.formatters import int_to_percent
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class Progressbar(.):
	def __init__(self):
		wyvas.Container.__init__(self)
		self._bar_name = None
		self._indicator_name = None
		self.min = 0
		self.max = 100
		self.position = 1
		for bar in self.get_list_obj_by_name(self._bar_name):
			bar.resize(width=self.position)
		for indicator in self.get_list_obj_by_name(self._indicator_name):
			indicator.move(hcenter=self.position)
		return None

	def update(self, signal, sender, value):
예제 #12
0
nname: 67
n 67(<dummy_ex3> EXC_MATCH ImportError)[]:
	i: 0(except)
	o: 77(t), 113(f)

nname: 47
n 47(None)[from peewee._gettime import time
]:
	i: 0(try)
	o: 115()

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
]:
	i: 
	o: 47(try), 67(except)

nname: 67
n 67(None)[except ImportError:
	log.error("Couldn't import monotonic time C module. Falling back to time.time.")
	from time import time
]:
	i: 0()
	o: 

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
예제 #13
0
		exit_by = pl[-1]._y
		enter_by = pl[0]._y
	it_pos = iter(xrange(start + 1, end + 1))
	it_map = tuple(map(None, il, ml[start:end]))

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb772edec>}
nname: 0
n 0(None)[from __future__ import absolute_import
__all__ = ['DefaultListing']
from .core import GenericListing
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
from time import sleep
class DefaultListing(GenericListing):
	__doc__ = 'List where elements are paged. '
	def do_swap(self, i1, i2):
		if not GenericListing._swap_items(self, i1, i2):
			return self.do_reset()
		il = self.item_list
		nb_positions = len(il)
		il.selected = self.menu_list.selected_pos
		il.start = max(0, il.selected // nb_positions * nb_positions)
		il.end = il.start + nb_positions
		if self._bar is not None:
			self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=self.duration)
		return None
예제 #14
0
	return True

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75f8dac>}
nname: 0
n 0(None)[from __future__ import absolute_import
__all__ = ['EventDispatcher', 'UnknownEventError', 'NullEventHandler']
from pygui import config
from peewee.debug import GET_LOGGER, DEBUG
from pygui.shared import pygui_globs
from .events import events as event_map
from pygui.facilities.wylight import WyLed
log = GET_LOGGER(__name__)
class UnknownEventError(Exception):
	pass

class EventDispatcher(object):
	__doc__ = "Event dispatcher. This is the base class for all event managers.\n\n    Handlers should implement event_<event name> methods.\n    The only parameter to an event_* method is the event itself,\n    other objects should be passed to L{__init__} and stored.\n\n    If the event_* method, specific to an event type, can't be found,\n    L{event_DEFAULT} is called instead.\n\n    If an event_* method returns True or None, the event is consumed and\n    its processing is halted.\n\n    If it returns False, the event will also be processed by handlers\n    below in the stack.\n\n    returning None is a bad idea ! returns True instead\n    "
	led = WyLed()
	power_mgr = None
	_disable_next_input = False
	def __init__(self, player):
		self.player = player

	def __call__(self, event):
		if EventDispatcher._disable_next_input:
			EventDispatcher._disable_next_input = False
			return True
예제 #15
0
파일: interface.py 프로젝트: rayman18/wydev
	event.post(dict(count=1, timeout=timeout))
except Full:
	log.warning('EVENT DROPPED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb771cc6c>}
nname: 0
n 0(None)[from __future__ import absolute_import
__all__ = ['post_key']
from Queue import Full
from .eventlogger import EventPlayer
from pygui.eventmanager import event_map
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
def post_key(key, timeout=None):
	try:
		event = event_map[key]
		event.post(dict(count=1, timeout=timeout))
	except Full:
		log.warning('EVENT DROPPED')

EP = EventPlayer(post_key)
EP.start()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb77152ac>}
from __future__ import absolute_import
예제 #16
0
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import Task
from pygui.config import user_config, HMI_BASE
from pygui.eventmanager.menus import MenuEventHandler
from pygui.facilities.l10n import omnicode
from pygui.item.containers import ItemList
from pygui.shared import pygui_globs

log = GET_LOGGER(__name__)
logselected = None


class UDPSender(object):
    def __init__(self, host='192.168.1.10', port=2345):
        self.addr = (host, port)
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        return None

    def write(self, msg):
        self.sock.sendto(msg, self.addr)
        return None

    def flush(self):
        return None
예제 #17
0
import pygui.config as config
from pygui.eventmanager.menus import TvNavigatorEventHandler
from pygui.item.scheduledrecord import ScheduledRecordRootItem, ScheduledRecordItem
from pygui.item.mediaitem.core import TVRootItem, DirItem, ChannelItem, AllChannelsList, Playlist, ProgramItem
from pygui.item.mediaitem.progressive_result import WindowedItemList
from pygui.item.core import Item
from pygui.menu import gui_updater, selective_gui_updater
from pygui.window import MessageWindow
from pygui.menu.menu.core import Menu
from pygui.menu.menu.info import ChannelInfoMenu, TVInfoMenu, ScheduledRecordRootInfoMenu
from pygui.menu.menu.navigators import Navigator, EmptyItem, back_root_if_error
from pygui.menu.menu.tv import ScheduledRecordNavigator
from pygui.menu.menu.tv.epg_grid import EPG_RECORDING_NAME_PATTERN
from pygui.shared import pygui_globs

log = GET_LOGGER(__name__)


#  A simple item to put in empty places to signal it.
class EmptyScheduledItem(Item):

    __metaclass__ = MetaSingleton
    locked = False
    hidden = False

    def __init__(self):
        Item.__init__(self,
                      _('No scheduled recordings'),
                      type_='empty',
                      display_type='empty')
        return None
예제 #18
0
self.nodes: {6: <unpyclib.structure.node instance at 0xb769998c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from time import localtime, strftime
from wymedia.wmplus import get_child_count, playlist_get_membership
from peewee.formatters import seconds_to_hhmmss_utc, seconds_to_mmss_utc, bytes_to_human, bits_to_human
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from .containers import ActionContainer
from .core import Item
from pygui.markerlist import Markerlist
from pygui.window import KeyboardWindow, LoadingWindow
from pygui.item.mediaitem.core import DirItem, wymedia_sorting
from pygui.facilities.codemapping import soundconfig_dict, audio_codec_substitution_dict
from pygui.facilities.l10n import get_date_format, get_time_format, omnicode
log = GET_LOGGER(__name__)
def get_field(it, field):
	pass

class InfoItem(Item):
	__doc__ = ' Item used to store a metadata (title: value) '
	def __init__(self, item, title, field, editable=False):
		Item.__init__(self, name=get_field(item, field), type_='info')
		self.item = item
		self.title = title
		self.field = field
		self.editable = editable

	def _edit_value(self):
		text = None
		def _InfoItem__do_update(kbd):
예제 #19
0
파일: analyse.py 프로젝트: rayman18/wydev
#
# 2011-12-07
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import GET_LOGGER

log = GET_LOGGER('analyse')


class Cover(object):
    def start(self, main):
        print '*' * 100,
        print '\nCODE COVERAGE ANALYSIS STARTED\n',
        print '*' * 100
        import trace
        out_dir = 'wybox_code_coverage'
        out_file = '.wybox.trace'
        my_trace = trace.Trace(ignoremods=['wyvas', 'peewee'],
                               trace=0,
                               count=1,
                               outfile=out_file)
        my_trace.runfunc(main)
예제 #20
0
#
# 2012-04-15
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import GET_LOGGER

log = GET_LOGGER('utils')



# Extension to the standard Python property mechanism that follows the
# overriding of the fset, fget and fdel methods. Used just like a property.
class late_property(property):

	# See property.__init__
	def __init__(self, fget=None, fset=None, fdel=None, doc=None):
		self._fget = fget
		self._fset = fset
		self._fdel = fdel
		super(late_property, self).__init__((self.fget if fget else None), (self.fset if fset else None), (self.fdel if fdel else None), doc)
		return None
예제 #21
0
파일: net.py 프로젝트: rayman18/wydev
context['hand_menu'].hide()
louie_send('refresh_root', sender='navigator')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7589b0c>}
nname: 0
n 0(None)[raise NotImplementedError('Internet services are not enabled in wymedia.')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758912c>}
nname: 147
n 147(None)[log = GET_LOGGER(__name__)
class LoginPasswordLauncher(object):
	def __init__(self):
		self._login = None
		self._password = None
		return None

	def launch(self, what_to_launch=2):
		self.what_to_launch = what_to_launch
		if self.what_to_launch in (0, 2):
			self._set_new_login()
		else:
			self._set_new_password()

	def _set_new_password(self, win=None):
		if win is not None:
예제 #22
0
파일: power.py 프로젝트: rayman18/wydev
n 0(None)[PowerManager().reboot()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75c6bec>}
nname: 0
n 0(None)[from __future__ import absolute_import
import os
import platform
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.powerutils import PowerManagerModule
from peewee.misc_utils import MetaSingleton
from peewee import notifier
from pygui.shared import pygui_globs
log = GET_LOGGER(__name__)
from peewee.notifier import events_watch
from pygui.eventmanager import EventDispatcher
from pygui.shared import pygui_globs
from pygui import config
from .mixer import Mix as Mixer
from pygui.facilities.wylight import WyLed
class PowerManager(PowerManagerModule):
	__metaclass__ = MetaSingleton
	led = WyLed()
	def __init__(self):
		PowerManagerModule.__init__(self, 'pygui')
		self.sleeping = False
		self._mute_flag = False
		events_watch(self.handle)
예제 #23
0
파일: stack.py 프로젝트: rayman18/wydev
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.


from __future__ import absolute_import

__all__ = ['MenuStack', 'MenuManager']

from itertools import chain
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.misc_utils import MetaSingleton
from peewee.notifier import events_watch
from pygui.shared import pygui_globs

log = GET_LOGGER('stack')



# Main class that manages views and controllers
# 
# self.windows and self.menus_stack are the controllers
# self.engines is a list of views
class MenuManager(object):
	__metaclass__ = MetaSingleton

	def __init__(self, *args, **kw):
		self.menus_stack = MenuStack()
		self.windows = []
		self.engines = []
		self._home_timestamp = None
예제 #24
0
파일: __init__.py 프로젝트: rayman18/wydev
	if 0 <= sel_idx:
		self.player.selected.lower()
		self.player.update()
	return True

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75fff4c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from pygui.eventmanager import EventDispatcher
from pygui.shared import pygui_globs
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class WindowEventHandler(EventDispatcher):
	def event_home(self, event):
		from pygui.menu.menu.firstboot import FirstBootMenu
		for menu in reversed(pygui_globs['menustack'].menus_stack):
			if isinstance(menu, FirstBootMenu):
				return True
				continue
		return EventDispatcher.event_home(self, event)



class MessageEventHandler(WindowEventHandler):
	def catch_event(self, event):
		return True
예제 #25
0
파일: l10n.py 프로젝트: rayman18/wydev
# 2012-05-02
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import
from pygui.config import locale_dir, user_config
from peewee.debug import GET_LOGGER
import gettext

log = GET_LOGGER(__name__)

application = 'messages'
available_languages = dict()


# Set 'lang' as current displayed language
def set_language(lang=None):
    global available_languages
    from pygui.config import user_config
    language = (user_config['base']['language'] if not lang else lang)
    iso_code = language[:2].lower()
    t = available_languages.get(iso_code)
    if t is None:
        dir_name = iso_code + '_' + iso_code.upper()
        try:
예제 #26
0
from __future__ import absolute_import

__all__ = ['ImageViewer']

from time import sleep
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import Task
from pygui.config import user_config, HMI_PHOTO
from pygui.eventmanager.players import ImageEventHandler
from pygui.shared import pygui_globs
from pygui.menu import selective_gui_updater
from pygui.menu.players.core import Player, TimerActivator
from pygui.facilities.codemapping import SYMETRIC_DIRECTION

log = GET_LOGGER(__name__)

pos = [1, 2]
name_activator = TimerActivator(signals=('on_show_name', 'on_hide_name'),
                                delay=user_config['photo'].get(
                                    'name_banner_period', 3))


# Image player.
class ImageViewer(Player):
    def __init__(self):
        Player.__init__(self, 'imageviewer')
        self.eventhandler = ImageEventHandler(self)
        self._getitems_keywords.update(item_name=self._get_item_name,
                                       picture_1=(lambda: None),
                                       picture_2=(lambda: None))
예제 #27
0
파일: __init__.py 프로젝트: rayman18/wydev
#
# 2012-04-13
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import GET_LOGGER
from wyvas import Container, Image, Text

log = GET_LOGGER(__name__)

try:
    from wyvas import __version__
    from wyvas import Progressbar, TextBlock, set_theme_dir
    log.debug('wyvas widgets imported')
    from pygui.config import themes_dir
    set_theme_dir(themes_dir)
except ImportError:
    log.debug('Cannot import widgets from wyvas')
    from pygui.gui.widget.progressbar import Progressbar
    from pygui.gui.widget.textblock import TextBlock
    log.debug('pygui widgets imported')
from pygui.gui.widget.core.widgetfactory import WidgetLibrary
예제 #28
0
]:
	i: 0(f)
	o: 134()

nname: 95
n 95(None)[from peewee.xml_facilities import SerializableElement
]:
	i: 0(t)
	o: 134()

nname: 0
n 0(config.use_serialized_theme)[from __future__ import absolute_import
import os
import pygui.config as config
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
def merge_node(node, bibliotheque, objects=None, animations=None):
	xml_variables = dict(skins=config.themes_dir, version=config.version)
	containers_dict = dict()
	name = node.get('id')
	def _merge_node(dest, src):
		_cp = dict(src.attrib)
		_cp.update(dest.attrib)
		dest.attrib = _cp
		for c in src.getchildren():
			dest.append(c)


]:
	i: 
	o: 95(t), 115(f)
예제 #29
0
파일: l10n.py 프로젝트: rayman18/wydev
nname: 0
n 0(None)[if user_config['base']['timeformat']:
	pass
return '%I:%M %p'
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770de0c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from pygui.config import locale_dir, user_config
from peewee.debug import GET_LOGGER
import gettext
log = GET_LOGGER(__name__)
application = 'messages'
def iso(lang):
	return lang[:2].lower()

available_languages = dict()
def set_language(lang=None):
	from pygui.config import user_config
	if not lang:
		pass
	language = lang
	iso_code = iso(language)
	t = available_languages.get(iso_code)
	if t is None:
		dir_name = iso_code + '_' + iso_code.upper()
		try:
예제 #30
0
		self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7702c0c>}
nname: 0
n 0(None)[from __future__ import absolute_import, with_statement
__all__ = ['HybridListing']
from .core import GenericListing
from peewee.debug import GET_LOGGER
from peewee.notifier import sched
from wyvas import render_lock
log = GET_LOGGER(__name__)
class HybridListing(GenericListing):
	__doc__ = " List where selected item is kept is the middle of the list as far as it's\n       possible.\n    "
	def create_content(self):
		if self._initialized:
			pass
		self._initialized = True
		self._last_timestamp = 0
		ml = self.menu_list
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		if ml.selected_pos <= midpos:
			start = 0
		else:
			if ml.selected_pos < len(ml) - midpos:
				start = ml.selected_pos - midpos
예제 #31
0
self.nodes: {6: <unpyclib.structure.node instance at 0xb7725b8c>}
nname: 0
n 0(None)[return int_to_percent(percent_to_int(p) + x)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb77255ec>}
nname: 0
n 0(None)[from __future__ import absolute_import
from os import path
from .ui_items import UIItem
from wyvas import Image, TextBlock, Container
from peewee.debug import GET_LOGGER
from peewee.formatters import int_to_percent, percent_to_int, xml_tag
log = GET_LOGGER(__name__)
class ThumbnailItem(UIItem):
	__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', 'selected_style_string', 'not_selected_style_string', 'text_sel', 'text_not_sel', 'thumbnail_sel', 'thumbnail_not_sel', 'text_offset', 'selected_text_offset', '_not_selected_widget', '_selected_widget', 'background_sel', 'background_not_sel']
	def __init__(self, *args, **args):
		UIItem.__init__(self, *args, **kw)
		self.selected_style_string = xml_tag(self.style['selected_font_style'].replace('%', '%%'), '%s')
		self.not_selected_style_string = xml_tag(self.style['font_style'].replace('%', '%%'), '%s')

	def _get_images_paths(self, item):
		repository = self.style['repository']
		root = path.join(repository, '%s' % item.type)
		suff = ('.', '_selected.')
		def check_concat(suf):
			_name = root + suf
			for ext in self.style['extension']:
				name = _name + ext
예제 #32
0
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.


from __future__ import absolute_import

from peewee.misc_utils import MetaSingleton
from pygui.window import SoundLevelWindow
from pygui.window import MuteWindow
from peewee.notifier import Task, events_watch
from peewee.debug import GET_LOGGER
from pygui.config import HMI_BASE, user_config
from pygui.config import architecture

log = GET_LOGGER(__name__)

volume_progress_dict = [{'vol': val*0.9,  'progress': val*2 } for val in xrange(0, 51)]



# only used on x86
class FakeMixer(object):

	def __init__(self, *args, **kw):
		self._vol = 50
		self._mute = 0
		return None

	def getvolume(self):
		return (self._vol, self._vol)
예제 #33
0
파일: __init__.py 프로젝트: rayman18/wydev
		louie_send(it, sender=self, value=res)
	return ret

return (lambda fn: (lambda self, *args, **args: _do_updates(self, fn, *args, **kw)))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb766cfcc>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import Task
from pygui.facilities.l10n import UnicodeDict
log = GET_LOGGER(__name__)
__all__ = ['gui_updater', 'selective_gui_updater']
def gui_updater(fn):
	def _do_updates(self, *args, **args):
		ret = None
		try:
			ret = fn(self, *args, **kw)
		except Exception, e:
			PRINT_EXCEPTION(e)
		for it in self._getitems_keywords.iterkeys():
			louie_send(it, sender=self, value=self[it])
		return ret

	return _do_updates

def selective_gui_updater(*names):
예제 #34
0
	i: 149(for)
	o: 213(f), 230(t)

nname: 149
n 149(None)[]:
	i: 0(loop)
	o: 168(for), 254(AF)

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from pygui.item.core import ActionItem, Item
from pygui.item.containers import GenericContainer
import pygui.config as config
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
log = GET_LOGGER(__name__)
class ActionsGroup(GenericContainer):
	__doc__ = '\n    A Container representing an actions module.\n    Each actions module should be a subdirectory.\n    ActionsGroup are used by hand menu to access the actions\n    '
	def __init__(self, module):
		self.name = module.name
		self.position = module.position
		self.category = module.category.strip().lower()
		self._module = module
		self.default = getattr(module, 'default', False)
		self.unique = getattr(module, 'unique', False)
		GenericContainer.__init__(self, self.name, type_='action')

	def is_available(self, context):
		return self._module.is_available(context)

	def browse(self, context=None):
예제 #35
0
# Author: Polo35 ([email protected])
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

from __future__ import absolute_import

from peewee.debug import PRINT_EXCEPTION, DEBUG, GET_LOGGER
from peewee.misc_utils import MetaSingleton
from pygui.item.containers import GenericContainer
from pygui.item.core import Item
from pygui.item.parameters import ParametersSetupItem

import pygui.config as config

log = GET_LOGGER(__name__)


class _WyScanServerWrap(object):

    __metaclass__ = MetaSingleton

    def __init__(self):
        self.wyscanserver = None
        if 'tv' in config.plugins:
            from WyScan import WYScanServer
            self.wyscanserver = WYScanServer(
                strBusName='com.wyplay.wyscan',
                strPathName='/com/wyplay/WyScan',
                strWyDbusInstanceName='com.wydbus.wyscan_4_gui')
        else:
예제 #36
0
파일: net.py 프로젝트: wydevices/wydevices
def play_embedded_image(self):
	forged_item = ImageItem(self.name, menu=self.menu, parent=self, uri=self['uri'], backend='dummy')
	forged_item.player.play(forged_item, [forged_item])

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76b6f4c>}
nname: 0
n 0(None)[__doc__ = 'Network items (RSS-based web services).'
from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from pygui.item.mediaitem.audiovideo import AudioItem, VideoItem, ImageItem
from pygui.item.mediaitem.core import MediaItem, DirItem
log = GET_LOGGER(__name__)
class NetDirItem(DirItem):
	__doc__ = "Network resource container.\n    Under the hood, it's an OPML <outline> element.\n    "
	def __init__(self, wymedia_resource, type_='net_dir', **kw):
		DirItem.__init__(self, wymedia_resource, type_, **kw)



class NetFeedItem(DirItem):
	__doc__ = 'Actual RSS feed. Contains news items (NetItem instances).\n\n    Basically a read-only DirItem that uses\n    a favicon as its display_type (or does it?).\n    '
	def __init__(self, wymedia_resource, type_='net_feed', **kw):
		display_type = wymedia_resource.get('favicon', None)
		DirItem.__init__(self, wymedia_resource, type_=type_, display_type=display_type, **kw)
		return None