Beispiel #1
0
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import abc
from resources.lib.utils.poutil import KodiPo
from resources.lib.kodilogging import KodiLogger
log = KodiLogger.log
kodipo = KodiPo()
kodipo.updateAlways = True
_ = kodipo.getLocalizedStringId

def getSettingMock(sid):
    assert isinstance(sid, str)
    return 'none'

try:
    import xbmcaddon
    getSetting = xbmcaddon.Addon().getSetting
except ImportError:
    getSetting = getSettingMock

class Settings(object):
    """
Beispiel #2
0
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from resources.lib import schedule
import xbmc
import threading
from resources.lib.pubsub import Publisher, Message, Topic
from resources.lib.events import Events
from resources.lib.utils.poutil import KodiPo
kodipo = KodiPo()
_ = kodipo.getLocalizedString

class SchedulePublisher(threading.Thread, Publisher):
    publishes = Events().Schedule.keys()

    def __init__(self, dispatcher, settings):
        Publisher.__init__(self, dispatcher)
        threading.Thread.__init__(self, name='SchedulePublisher')
        self.dailyAlarms = settings.getEventsByType('onDailyAlarm')
        self.intervalAlarms = settings.getEventsByType('onIntervalAlarm')
        self.abortEvt = threading.Event()
        self.abortEvt.clear()
        self.sleep = xbmc.sleep
        self.sleepinterval = 1000
        self.schedules = []
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import abc
from resources.lib.utils.poutil import KodiPo
from resources.lib.kodilogging import KodiLogger

log = KodiLogger.log
kodipo = KodiPo()
kodipo.updateAlways = True
_ = kodipo.getLocalizedStringId


def getSettingMock(sid):
    assert isinstance(sid, str) or isinstance(sid, unicode)
    return "none"


try:
    import xbmcaddon

    getSetting = xbmcaddon.Addon().getSetting
except ImportError:
    getSetting = getSettingMock