Esempio n. 1
0
	if t is None:
		dir_name = iso_code + '_' + iso_code.upper()
		try:
			t = gettext.translation(application, locale_dir, languages=[dir_name])
			available_languages[iso_code] = t
		except IOError:
			log.error("language '%s' not available", language)
			return False
	t.install(unicode=True, names=['ngettext'])
	return None

def init():
	gettext.install(application, locale_dir, unicode=True, names=['ngettext'])

init()
log.info(_('Internationalisation loaded.'))
def omnicode(txt):
	if isinstance(txt, unicode):
		pass
	else:
		if isinstance(txt, basestring):
			pass
	return unicode(txt)

class UnicodeDict(dict):
	__doc__ = "\n    Dict that handle (key : i18n value).\n    All the values are evaluated (ie i18n'ed) at each dict access\n    "
	def __getitem__(self, key):
		if isinstance(key, basestring) and key.startswith('raw_'):
			if key in self:
				pass
			return dict.__getitem__(self, key[4:])
Esempio n. 2
0
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
n 971(None)[except Exception, e:
	WebBrowser = None
	log.error('Web Browser loading error: %s', str(e))
Esempio n. 3
0
		if self.what_to_launch == 2:
			pass
		_confirm_action = self._validate
		kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
		kbd.show()

	def _validate(self, win=None):
		if win is not None:
			if self.what_to_launch in (0, 2):
				self._password = win.text
			else:
				self._login = win.text
			win.hide()
		if self._login is not None:
			user_config['net']['login'] = self._login
			log.info("'user' param set for net services'")
			set_param('user', self._login)
		if self._password is not None:
			user_config['net']['password'] = self._password
			log.info("'pass' param set for net services'")
			set_param('pass', self._password)
		user_config.save()
		louie_send('refresh_root', sender='navigator')
		return None



def change_login_pwd_net(context, stack):
	LoginPasswordLauncher().launch(2)
	stack.back_one_menu()
Esempio n. 4
0
	def set(self, pos=None, max=None, min=None):
		if min:
			self.min = min
		if max:
			self.max = max
		delta = abs(self.position - pos) / self.max
		if not pos:
			pass
		self.position = pos
		self._redraw(delta)

	def _redraw(self, delta=0):
		if not self.max:
			pass
		computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
		log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
		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: {0: <unpyclib.structure.node instance at 0xb772176c>}
from __future__ import absolute_import
import wyvas
from peewee.formatters import int_to_percent
Esempio n. 5
0
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
import pygui.config as config

log = GET_LOGGER(__name__)


forward_tricks_icons = {0: 'ff1', 1: 'ff2', 2: 'ff3', 3: 'ff4', 4: 'ff5', 5: 'ff5', 6: 'ff5', 7: 'ff5', 8: 'ff5', 9: 'ff5', 10: 'ff5'}
backward_tricks_icons = {0: 'bw1', 1: 'bw2', 2: 'bw3', 3: 'bw4', 4: 'bw5', 5: 'bw5', 6: 'bw5', 7: 'bw5', 8: 'bw5', 9: 'bw5', 10: 'bw5'}


log.info('Loading players...')

if config.no_PLAYERS:
	AudioPlayer = None
	VideoPlayer = None
	TVPlayer = None
	DVDPlayer = None
	ChannelScanner = None
	ImageViewer = None
	WebBrowser = None
else:
	try:
		from pygui.facilities.subtitles import SubServer
		subserver = SubServer()
	except:
		subserver = None
Esempio n. 6
0
    'False': False,
    'HMI_BASE': HMI_BASE,
    'HMI_VIDEO': HMI_VIDEO,
    'HMI_MUSIC': HMI_MUSIC,
    'HMI_PHOTO': HMI_PHOTO,
    'HMI_TV': HMI_TV
}

try:
    user_configuration = os.path.join(user_config_dir, 'local_conf.py')
    _loc = {}
    execfile(user_configuration, restricted_env, _loc)
    locals().update(_loc)
    log.debug('user configuration file : %s' % user_configuration)
except IOError:
    log.info('No local configuration found.')

persistent_config_path = '/etc/params/wy_config'

import platform
if platform.machine() != 'sh4':
    output_driver = 'dummy'
    architecture = 'pc'
    plugins.discard('persistence')


class _SubDict(dict):

    __module__ = __name__

    def __init__(self, values, key, parent):
Esempio n. 7
0
from peewee.formatters import seconds_to_hhmm, seconds_to_hhmmss, int_to_percent
log = GET_LOGGER(__name__)
LOG_VAL = False
LOG_INFO = False
LOG_FUNC = False
def nolog(*args):
	return log_none(*args)

def log_none(*args):
	pass

if not LOG_FUNC:
	log_func = nolog
else:
	def log_func(*args):
		return log.info(*args)

if not LOG_VAL:
	log_val = nolog
else:
	def log_val(*args):
		return log.info(*args)

]:
	i: 
	o: 194()

nname: 0
n 0(None)[from __future__ import absolute_import
import wyvas
from math import ceil