示例#1
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
                'bus',
                'feedHose',
            )
        ]
        [
            setattr(self, k, v) for k, v in self.cachesByName.iteritems()
            if k in ('mythChannelIconCache', 'mythThumbnailCache', 'httpCache',
                     'domainCache')
        ]

        # merge cachesByName into deps dict
        self.deps = dict(kwargs.items() + self.cachesByName.items())
        self.t = self.translator.get
        self.lastFocusId = None
        self.shutdownPending = False
        self.bus.register(self)
示例#2
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
                'programIterator',
                'bus',
            )
        ]
        [
            setattr(self, k, v) for k, v in self.cachesByName.iteritems()
            if k in ('mythChannelIconCache', 'mythThumbnailCache',
                     'domainCache')
        ]

        self.t = self.translator.get
        self.program = self.programIterator.current()
        self.isDeleted = False
        self.initialized = False
        self.streaming = self.settings.getBoolean('streaming_enabled')
        self.channels = None
示例#3
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
                'upcoming',
            )
        ]
        [
            setattr(self, k, v) for k, v in self.cachesByName.iteritems()
            if k in (
                'mythChannelIconCache',
                'domainCache',
            )
        ]

        self.programs = []  # [RecordedProgram]
        self.channelsById = None  # {int:Channel}
        self.tunersById = None  # {int:Tuner}
        self.listItemsByProgram = odict.odict()  # {Program:ListItem}
        self.programsByListItem = odict.odict()  # {ListItem:Program}
        self.sortBy = self.settings.get('upcoming_sort_by')
        self.sortAscending = self.settings.getBoolean(
            'upcoming_sort_ascending')
        self.activeRenderToken = None
示例#4
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
            )
        ]
        [
            setattr(self, k, v) for k, v in self.cachesByName.iteritems()
            if k in ('mythChannelIconCache', 'domainCache')
        ]

        self.channels = None  # Channels sorted and merged (if multiple tuners)
        self.channelsById = None  # {int channelId:Channel}
        self.programs = None  # [TVProgram]
        self.listItemsByChannel = odict()  # {Channel:ListItem}
        self.lastSelected = int(self.settings.get('livetv_last_selected'))

        self.activeRenderToken = None
        self.tvQueue = collections.deque(
        )  # Channels showing a tv program that needs poster lookup
        self.movieQueue = collections.deque(
        )  # Channels showing a movie that needs poster lookup
示例#5
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings','translator','platform','fanArt','cachesByName',)]
     self.settingsMap = {}  # key = controlId,  value = Setting
     self.t = self.translator.get
     self.advanced = AdvancedSettings(platform=self.platform)
     log.debug('Advanced settings:\n %s' % self.advanced)
示例#6
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
            )
        ]
        [
            setattr(self, k, v) for k, v in self.cachesByName.iteritems()
            if k in (
                'mythChannelIconCache',
                'domainCache',
            )
        ]

        self.schedules = []  # [RecordingSchedule]
        self.listItemsBySchedule = odict.odict(
        )  # {RecordingSchedule:ListItem}
        self.channelsById = None  # {int:Channel}
        self.lastFocusId = ID_SCHEDULES_LISTBOX
        self.lastSelected = int(self.settings.get('schedules_last_selected'))
        self.sortBy = self.settings.get('schedules_sort_by')
        self.activeRenderToken = None
示例#7
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        # inject dependencies from constructor
        [
            setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
                'settings',
                'translator',
                'platform',
                'fanArt',
                'cachesByName',
                'bus',
            )
        ]
        [setattr(self, k, v) for k, v in self.cachesByName.iteritems()]

        self.t = self.translator.get
        self.programs = []  # [RecordedProgram]
        self.allGroupTitle = self.t(m.ALL_RECORDINGS)
        self.activeRenderToken = None
        self.groupsByTitle = odict.odict()  # {unicode:Group}
        self.groupsListItems = []
        self.activeGroup = None
        self.lastFocusId = None
        self.sameBackgroundCache = {}  # {title:filepath}
        self.bus.register(self)
        self.GROUP_SORT_BY = odict.odict([
            ('Title', {
                'translation_id':
                m.TITLE,
                'reverse':
                False,
                'sorter':
                lambda g: [g.title, u'0000'][g.title == self.allGroupTitle]
            }),
            ('Date', {
                'translation_id':
                m.DATE,
                'reverse':
                True,
                'sorter':
                lambda g: [
                    g.programs[0].starttimeAsTime(),
                    datetime.datetime(datetime.MAXYEAR,
                                      12,
                                      31,
                                      23,
                                      59,
                                      59,
                                      999999,
                                      tzinfo=None)
                ][g.title == self.allGroupTitle]
            })
        ])
        self.dirty = False

        self.episodeQueue = Queue.LifoQueue(
        )  # recordings that need an episode lookup
        self.backgroundQueue = Queue.LifoQueue()
        self.posterQueue = Queue.LifoQueue()
示例#8
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [
         setattr(self, k, v)
         for k, v in kwargs.iteritems()
         if k in ("settings", "translator", "platform", "fanArt", "cachesByName")
     ]
     self.settingsMap = {}  # key = controlId,  value = Setting
     self.t = self.translator.get
     self.advanced = AdvancedSettings(platform=self.platform)
     log.debug("Advanced settings:\n %s" % self.advanced)
示例#9
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings', 'translator', 'platform', 'fanArt', 'cachesByName', 'programIterator', 'bus',)]
     [setattr(self,k,v) for k,v in self.cachesByName.iteritems() if k in ('mythChannelIconCache', 'mythThumbnailCache', 'domainCache')]
     
     self.t = self.translator.get
     self.program = self.programIterator.current() 
     self.isDeleted = False
     self.initialized = False
     self.streaming = self.settings.getBoolean('streaming_enabled')
     self.channels = None
示例#10
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings', 'translator', 'platform', 'fanArt', 'cachesByName', 'bus', 'feedHose',)]
        [setattr(self,k,v) for k,v in self.cachesByName.iteritems() if k in ('mythChannelIconCache', 'mythThumbnailCache', 'httpCache', 'domainCache')]

        # merge cachesByName into deps dict
        self.deps = dict(kwargs.items() + self.cachesByName.items())
        self.t = self.translator.get
        self.lastFocusId = None
        self.shutdownPending = False
        self.bus.register(self)
示例#11
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings','translator','platform','fanArt','cachesByName',)]
     [setattr(self,k,v) for k,v in self.cachesByName.iteritems() if k in ('mythChannelIconCache', 'domainCache',)]
     
     self.schedules = []                       # [RecordingSchedule]
     self.listItemsBySchedule = odict.odict()  # {RecordingSchedule:ListItem}
     self.channelsById = None                  # {int:Channel}
     self.lastFocusId = ID_SCHEDULES_LISTBOX
     self.lastSelected = int(self.settings.get('schedules_last_selected'))
     self.sortBy = self.settings.get('schedules_sort_by')
     self.activeRenderToken = None
示例#12
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings','translator','platform','fanArt','cachesByName', 'upcoming', )]
     [setattr(self,k,v) for k,v in self.cachesByName.iteritems() if k in ('mythChannelIconCache','domainCache', )]
     
     self.programs = []                       # [RecordedProgram]
     self.channelsById = None                 # {int:Channel}
     self.tunersById = None                   # {int:Tuner}
     self.listItemsByProgram = odict.odict()  # {Program:ListItem}
     self.programsByListItemKey = odict.odict()  # {ListItem:Program}
     self.sortBy = self.settings.get('upcoming_sort_by')
     self.sortAscending = self.settings.getBoolean('upcoming_sort_ascending')
     self.activeRenderToken = None
示例#13
0
文件: livetv.py 项目: Jajcus/mythbox
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings', 'translator', 'platform', 'fanArt', 'cachesByName',)]
        [setattr(self,k,v) for k,v in self.cachesByName.iteritems() if k in ('mythChannelIconCache', 'domainCache')]
         
        self.channels = None                     # Channels sorted and merged (if multiple tuners)
        self.channelsById = None                 # {int channelId:Channel}
        self.programs = None                     # [TVProgram]
        self.listItemsByChannel = odict()        # {Channel:ListItem}
        self.lastSelected = int(self.settings.get('livetv_last_selected'))

        self.activeRenderToken = None
        self.tvQueue = collections.deque()       # Channels showing a tv program that needs poster lookup
        self.movieQueue = collections.deque()    # Channels showing a movie that needs poster lookup
示例#14
0
 def __init__(self, *args, **kwargs):
     BaseWindow.__init__(self, *args, **kwargs)
     [
         setattr(self, k, v) for k, v in kwargs.iteritems() if k in (
             'settings',
             'translator',
             'platform',
             'fanArt',
             'cachesByName',
         )
     ]
     self.settingsMap = {}  # key = controlId,  value = Setting
     self.t = self.translator.get
     self.advanced = AdvancedSettings(platform=self.platform)
     log.debug('Advanced settings:\n %s' % self.advanced)
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        # inject dependencies from constructor
        [
            setattr(self, k, v)
            for k, v in kwargs.iteritems()
            if k in ("settings", "translator", "platform", "fanArt", "cachesByName", "bus")
        ]
        [setattr(self, k, v) for k, v in self.cachesByName.iteritems()]

        self.t = self.translator.get
        self.programs = []  # [RecordedProgram]
        self.allGroupTitle = self.t(m.ALL_RECORDINGS)
        self.activeRenderToken = None
        self.groupsByTitle = odict.odict()  # {unicode:Group}
        self.groupsListItems = []
        self.activeGroup = None
        self.lastFocusId = None
        self.sameBackgroundCache = {}  # {title:filepath}
        self.bus.register(self)
        self.GROUP_SORT_BY = odict.odict(
            [
                (
                    "Title",
                    {
                        "translation_id": m.TITLE,
                        "reverse": False,
                        "sorter": lambda g: [g.title, u"0000"][g.title == self.allGroupTitle],
                    },
                ),
                (
                    "Date",
                    {
                        "translation_id": m.DATE,
                        "reverse": True,
                        "sorter": lambda g: [
                            g.programs[0].starttimeAsTime(),
                            datetime.datetime(datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=None),
                        ][g.title == self.allGroupTitle],
                    },
                ),
            ]
        )
        self.dirty = False
示例#16
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        # inject dependencies from constructor
        [setattr(self,k,v) for k,v in kwargs.iteritems() if k in ('settings', 'translator', 'platform', 'fanArt', 'cachesByName')]
        [setattr(self,k,v) for k,v in self.cachesByName.iteritems()]

        self.t = self.translator.get
        self.programs = []                       # [RecordedProgram]
        self.allGroupTitle = self.t(m.ALL_RECORDINGS)
        self.activeRenderToken = None
        self.groupsByTitle = odict.odict()       # {unicode:Group}
        self.groupsListItems = []
        self.activeGroup = None
        self.lastFocusId = None
        self.sameBackgroundCache = {}            # {title:filepath}

        self.GROUP_SORT_BY = odict.odict([
            ('Title', {'translation_id': m.TITLE, 'reverse': False, 'sorter' : lambda g: [g.title, u'0000'][g.title == self.allGroupTitle]}),
            ('Date',  {'translation_id': m.DATE,  'reverse': True,  'sorter' : lambda g: [g.programs[0].starttimeAsTime(), datetime.datetime(datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=None)][g.title == self.allGroupTitle]})])
示例#17
0
    def __init__(self, *args, **kwargs):
        BaseWindow.__init__(self, *args, **kwargs)
        [
            setattr(self, k, v)
            for k, v in kwargs.iteritems()
            if k in ("settings", "translator", "platform", "fanArt", "cachesByName", "programIterator", "bus")
        ]
        [
            setattr(self, k, v)
            for k, v in self.cachesByName.iteritems()
            if k in ("mythChannelIconCache", "mythThumbnailCache", "domainCache")
        ]

        self.t = self.translator.get
        self.program = self.programIterator.current()
        self.isDeleted = False
        self.initialized = False
        self.streaming = self.settings.getBoolean("streaming_enabled")
        self.channels = None