Example #1
0
 def browse(self, preview=False):
     # Return nothing if preview is True
     if preview:
         return []
     # Preview is False, this mean the item is entred
     # Check network connection
     try:
         from wynetwork import wynetwork as wn
         gateway = wn.NetDevices().getDeviceInfos(
             wn.NetConfigurations().getActiveConfigurationInfos()
             ['interface'])['gateway']
     except:
         gateway = '0.0.0.0'
     if gateway == '0.0.0.0':
         MessageWindow(text=_('Please configure connection'),
                       title=_('Not connected'),
                       button=False).show(timeout=5)
         return None
     # Network is connected, we can start playing with Youtube
     win = LoadingWindow()
     win.show()
     if self._items is None or LiveStreaming_Data.catalog.is_old():
         self._items = []
         try:
             self._items = [
                 LiveStreamingChannelContainer(chan['title'],
                                               chan['position'],
                                               parent=self,
                                               menu=self.menu,
                                               **chan)
                 for chan in LiveStreaming_Data.get_channels()
             ]
         except Exception, e:
             PRINT_EXCEPTION(e)
Example #2
0
 def browse(self, preview=False):
     # Only return content if preview is True
     if preview:
         return [
             PicasaPrivateAreaContainer(_('Private Area'),
                                        menu=self.menu,
                                        parent=self),
             PicasaPublicAreaContainer(_('Public Area'),
                                       menu=self.menu,
                                       parent=self)
         ]
     # Preview is False, this mean the item is entred
     win = LoadingWindow()
     win.show()
     # Check network connection
     try:
         from wynetwork import wynetwork as wn
         gateway = wn.NetDevices().getDeviceInfos(
             wn.NetConfigurations().getActiveConfigurationInfos()
             ['interface'])['gateway']
     except:
         gateway = '0.0.0.0'
     if gateway == '0.0.0.0':
         MessageWindow(text=_('Please configure connection'),
                       title=_('Not connected'),
                       button=False).show(timeout=5)
         win.hide()
         return None
     # Network is connected, we can start playing
     # We need to be logged to access public albums
     # So ask the user to define a valid user in private area if not already done
     if PicasaGData.email is None or PicasaGData.password is None:
         # Try to log with private users
         for username in PicasaConfig().GetPrivateUsers():
             try:
                 PicasaGData.ClientLogin(
                     username,
                     PicasaConfig().GetPrivatePassword(username))
                 break
             except:
                 pass
         else:
             MessageWindow(text=_(
                 'Please define a valid user in private area\nThis is needed in order to access all features of PicasaWeb'
             ),
                           title=_('No private user defined'),
                           button=False).show(timeout=10)
     self._items = [
         PicasaPrivateAreaContainer(_('Private Area'),
                                    menu=self.menu,
                                    parent=self),
         PicasaPublicAreaContainer(_('Public Area'),
                                   menu=self.menu,
                                   parent=self)
     ]
     win.hide()
     return self._items
Example #3
0
 def browse(self, preview=False):
     # Only return content if preview is True
     if preview:
         return [
             YoutubeUsersContainer(_('User Playlists'),
                                   menu=self.menu,
                                   parent=self),
             YoutubeStandardFeedContainer(_('Standard Feeds'),
                                          menu=self.menu,
                                          parent=self),
             YoutubeSearchContainer(_('Search Videos'),
                                    menu=self.menu,
                                    parent=self)
         ]
     # Preview is False, this mean the item is entred
     # Check network connection
     try:
         from wynetwork import wynetwork as wn
         gateway = wn.NetDevices().getDeviceInfos(
             wn.NetConfigurations().getActiveConfigurationInfos()
             ['interface'])['gateway']
     except:
         gateway = '0.0.0.0'
     if gateway == '0.0.0.0':
         MessageWindow(text=_('Please configure connection'),
                       title=_('Not connected'),
                       button=False).show(timeout=5)
         return None
     # Network is connected, we can start playing with Youtube
     if not self._items:
         self._items = [
             YoutubeUsersContainer(_('User Playlists'),
                                   menu=self.menu,
                                   parent=self),
             YoutubeStandardFeedContainer(_('Standard Feeds'),
                                          menu=self.menu,
                                          parent=self),
             YoutubeSearchContainer(_('Search Videos'),
                                    menu=self.menu,
                                    parent=self)
         ]
     return self._items
Example #4
0
	def browse(self, preview=False):
		# Only return content if preview is True
		if preview:
			return [ShoutCastTop500Folder(_('Shoutcast Top 500'), menu=self.menu, parent=self),
							ShoutCastGenreFolder(_('Shoutcast by Genre'), menu=self.menu, parent=self),
							ShoutCastSearchFolder(_('Shoutcast Search'), menu=self.menu, parent=self)]
		# Preview is False, this mean the item is entred
		# Check network connection
		try:
			from wynetwork import wynetwork as wn
			gateway = wn.NetDevices().getDeviceInfos(wn.NetConfigurations().getActiveConfigurationInfos()['interface'])['gateway']
		except:
			gateway = '0.0.0.0'
		if gateway == '0.0.0.0':
			MessageWindow(text=_('Please configure connection'), title=_('Not connected'), button=False).show(timeout=5)
			return None
		# Network is connected, we can start playing
		elif not self._items:
			self._items = [ShoutCastTop500Folder(_('Shoutcast Top 500'), menu=self.menu, parent=self),
										 ShoutCastGenreFolder(_('Shoutcast by Genre'), menu=self.menu, parent=self),
										 ShoutCastSearchFolder(_('Shoutcast Search'), menu=self.menu, parent=self)]
		return self._items
Example #5
0
 def browse(self, preview=False):
     # Only return content if preview is True
     if preview:
         return [
             TF1ReplayContainer(
                 _('TF1 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/6/60/Logo_TF1.svg/200px-Logo_TF1.svg.png",
                 menu=self.menu,
                 parent=self),
             M6ReplayContainer(
                 _('M6 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/2/22/M6_2009.svg/170px-M6_2009.svg.png",
                 menu=self.menu,
                 parent=self),
             RTVEReplayContainer(
                 _('RTVE Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Logo_RTVE.svg/220px-Logo_RTVE.svg.png",
                 menu=self.menu,
                 parent=self),
             W9ReplayContainer(
                 _('W9 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/8/86/W9_2010.png/180px-W9_2010.png",
                 menu=self.menu,
                 parent=self)
         ]
     # Preview is False, this mean the item is entred
     # Check network connection
     try:
         from wynetwork import wynetwork as wn
         gateway = wn.NetDevices().getDeviceInfos(
             wn.NetConfigurations().getActiveConfigurationInfos()
             ['interface'])['gateway']
     except:
         gateway = '0.0.0.0'
     if gateway == '0.0.0.0':
         MessageWindow(text=_('Please configure connection'),
                       title=_('Not connected'),
                       button=False).show(timeout=5)
         return None
     # Network is connected, we can start playing with Youtube
     if not self._items:
         self._items = [
             TF1ReplayContainer(
                 _('TF1 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/6/60/Logo_TF1.svg/200px-Logo_TF1.svg.png",
                 menu=self.menu,
                 parent=self),
             M6ReplayContainer(
                 _('M6 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/2/22/M6_2009.svg/170px-M6_2009.svg.png",
                 menu=self.menu,
                 parent=self),
             RTVEReplayContainer(
                 _('RTVE Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Logo_RTVE.svg/220px-Logo_RTVE.svg.png",
                 menu=self.menu,
                 parent=self),
             W9ReplayContainer(
                 _('W9 Replay'),
                 thumbnail=
                 "http://upload.wikimedia.org/wikipedia/fr/thumb/8/86/W9_2010.png/180px-W9_2010.png",
                 menu=self.menu,
                 parent=self)
         ]
     return self._items
Example #6
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.messages import send as louie_send
from pygui.config import user_config
from pygui.item.containers import GenericContainer
from pygui.item.core import ActionItem, Item
from pygui.menu.menu import Menu
from pygui.window import IpWindow
from wynetwork import wynetwork as wn

wn_dev = wn.NetDevices()
wn_cfg = wn.NetConfigurations()


class ConnectionTypeContainer(GenericContainer):
    def __init__(self, callback, **kw):
        GenericContainer.__init__(self, **kw)
        self._callback = callback
        return None

    def browse(self, preview=False):
        return [
            ActionItem(name=_('Ethernet'),
                       type_='setupparameters',
                       action=self._callback,
                       args=('802.3', )),
Example #7
0
    def browse(self, preview=False):
        # Only return content if preview is True
        if preview:
            return [
                DailyMotionSubContainer(
                    section_name, (lambda section_num=i: self.client.search(
                        what=section_num,
                        lang=user_config['video']['dailymotion_languages'])),
                    menu=self.menu,
                    parent=self)
                for i, section_name in enumerate(self.client._sections_name)
            ]
        # Preview is False, this mean the item is entred
        # Check network connection
        try:
            from wynetwork import wynetwork as wn
            gateway = wn.NetDevices().getDeviceInfos(
                wn.NetConfigurations().getActiveConfigurationInfos()
                ['interface'])['gateway']
        except:
            gateway = '0.0.0.0'
        if gateway == '0.0.0.0':
            MessageWindow(text=_('Please configure connection'),
                          title=_('Not connected'),
                          button=False).show(timeout=5)
            return None
        # Network is connected, we can start playing
        elif not self._items:

            def _validate(kb):
                self.pattern = kb._text
                new_dir = DailyMotionSubContainer(
                    "%s '%s'" % (_('Search'), self.pattern),
                    (lambda query=self.pattern: self.client.search(
                        what=query,
                        lang=user_config['video']['dailymotion_languages'])),
                    menu=self.menu,
                    parent=self)
                self._items.append(new_dir)
                kb.hide()
                self.menu.get_item_list('main_list').append(new_dir)
                return None

            def _search():
                from pygui.window import KeyboardWindow
                kb = KeyboardWindow('Search for:',
                                    text=self.pattern,
                                    confirm_action=_validate)
                kb.show()
                return None

            self._items = [
                DailyMotionSubContainer(
                    section_name, (lambda section_num=i: self.client.search(
                        what=section_num,
                        lang=user_config['video']['dailymotion_languages'])),
                    menu=self.menu,
                    parent=self)
                for i, section_name in enumerate(self.client._sections_name)
            ]
            self._items.append(
                ActionItem(_('Search') + '...',
                           type_='exe',
                           menu=self.menu,
                           action=_search))
        return self._items