예제 #1
0
def populateDirDate(mode, channel=False, dateChooser=False):
    l = []

    d = {}
    day = date.today()
    d['mode'] = mode
    d['_type'] = 'dir'
    if channel: d['channel'] = channel
    d['_name'] = day.strftime('%d. %b | ') + getTranslation(31020)
    d['datum'] = '0'
    d['yyyymmdd'] = day.strftime('%Y-%m-%d')
    l.append(d)

    d = {}
    day = day - timedelta(1)
    d['mode'] = mode
    d['_type'] = 'dir'
    if channel: d['channel'] = channel
    d['_name'] = day.strftime('%d. %b | ') + getTranslation(31021)
    d['datum'] = '1'
    d['yyyymmdd'] = day.strftime('%Y-%m-%d')
    l.append(d)

    i = 2
    while i <= 6:
        d = {}
        day = day - timedelta(1)
        d['_name'] = day.strftime('%d. %b | ') + weekdayDict[day.strftime(
            "%w")]
        d['datum'] = str(i)
        d['mode'] = mode
        d['_type'] = 'dir'
        if channel: d['channel'] = channel
        d['yyyymmdd'] = day.strftime('%Y-%m-%d')
        l.append(d)
        i += 1

    if dateChooser:
        d = {}
        d['mode'] = mode
        d['_type'] = 'dir'
        if channel: d['channel'] = channel
        d['name'] = getTranslation(31022)
        l.append(d)

    return l
예제 #2
0
def getSearchString():
    if libmediathek3utils.searchWorkaroundExists():
        d = libmediathek3utils.searchWorkaroundRead()
    else:
        dialog = xbmcgui.Dialog()
        d = dialog.input(libmediathek3utils.getTranslation(31039),
                         type=xbmcgui.INPUT_ALPHANUM)
        libmediathek3utils.searchWorkaroundWrite(d)
    return urllib.quote_plus(d)
예제 #3
0
def dialogDate(date_format='%d%m%Y'):
    dialog = xbmcgui.Dialog()
    result = dialog.numeric(1,
                            libmediathek3utils.getTranslation(31030)).replace(
                                "/", "").replace(" ", "0")
    try:
        result = datetime.strptime(result, '%d%m%Y')
    except TypeError:  # handle bug in Python 2
        result = datetime(*(time.strptime(result, '%d%m%Y')[0:6]))
    return result.strftime(date_format)
예제 #4
0
def getSearchString():
    dialog = xbmcgui.Dialog()
    d = dialog.input(libmediathek3utils.getTranslation(31039),
                     type=xbmcgui.INPUT_ALPHANUM)
    return urllib.quote_plus(d)
예제 #5
0
def dialogDate():
    dialog = xbmcgui.Dialog()
    return dialog.numeric(1, libmediathek3utils.getTranslation(31030)).replace(
        '/', '').replace(' ', '0')
예제 #6
0
import urllib
import urllib2
import socket
import xbmc
import xbmcaddon
import xbmcvfs
import re
from datetime import date, timedelta

from libmediathek3utils import getTranslation as getTranslation

weekdayDict = {
    '0': getTranslation(31013),  #Sonntag
    '1': getTranslation(31014),  #Montag
    '2': getTranslation(31015),  #Dienstag
    '3': getTranslation(31016),  #Mittwoch
    '4': getTranslation(31017),  #Donnerstag
    '5': getTranslation(31018),  #Freitag
    '6': getTranslation(31019),  #Samstag
}


def populateDirAZ(mode, ignore=[]):
    l = []
    if not '#' in ignore:
        d = {}
        d['mode'] = mode
        d['name'] = "#"
        d['_type'] = 'dir'
        l.append(d)
    letters = [chr(i) for i in xrange(ord('a'), ord('z') + 1)]