Пример #1
0
 def showBusy(self):
     #xbmc.executebuiltin('Dialog.Show(busydialog)')
     self.busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
     self.busy.show()
     progress = self.getProgress()
     if progress:
         progress.setVisible(False)
Пример #2
0
def show_artist_image():
    """
    Shows current artist as background image.
    """
    # Open custom music visualization dialog
    window = xbmcgui.WindowXMLDialog('music-visualization.xml',
                                     __addon__.getAddonInfo('path'))
    window.show()
    previous_title = ''
    artist_image = ''
    # While steaming audio check for changes in title every 2 seconds
    while (not xbmc.Monitor().abortRequested()
           and xbmc.Player().isPlayingAudio()):

        if _hide_artist_artwork != 'true':
            my_title = xbmc.Player().getMusicInfoTag().getTitle()

            # Poll for changes in title
            if my_title != previous_title:
                # Get current artist image
                artist_image = get_current_artist_image()
                # Set artist image property within xml dialog
                window.setProperty('ArtistFanart', artist_image)
                previous_title = my_title

        # Sleep for 2 seconds
        xbmc.sleep(2000)

    window.close()
    del window
Пример #3
0
def ip2location(ipaddr):
    """
    Show ip info including location
    """
    ip_info = IPInfo(ipaddr)
    if ip_info == 'Error getting IP address info!':
        notification(ip_info, 'IP 2 Location', __icon__, 5000)
    else:
        window = xbmcgui.WindowXMLDialog('script-ip-2-location.xml',
                                         __addon__.getAddonInfo('path'))
        win = xbmcgui.Window(10147)
        win.setProperty(
            'HeadingLabel',
            '[COLOR blue]Location for IP Address:[/COLOR] ' + ip_info.ip_addr)
        win.setProperty('MapImage', ip_info.mapimage)
        win.setProperty('Region', ip_info.region)
        win.setProperty('City', ip_info.city)
        win.setProperty('PostCode', ip_info.postcode)
        win.setProperty('Coordinates', ip_info.coordinates)
        win.setProperty('Country', ip_info.country)
        win.setProperty('Hostname', ip_info.hostname)
        win.setProperty('AddressType', ip_info.addrtype)
        win.setProperty('ASN', ip_info.asn)
        win.setProperty('Organization', ip_info.organization)
        win.setProperty('Route', ip_info.route)
        win.setProperty('Description', ip_info.description)
        window.doModal()
        del window
Пример #4
0
 def displayWidget(self):
     w = xbmcgui.WindowXMLDialog('plugin.audio.qobuz-article.xml', qobuz.path.base)
     w.show()
     w.doModal()
     w.close()
     del w
     return True
Пример #5
0
def showInfoWindow(blobId, showWindow=True):
    writeLog('Collect and set details to home/info screen for blob #%s' %
             (blobId or '<unknown>'))

    if blobId is None:
        writeLog('No ID provided', level=xbmc.LOGFATAL)
        return False

    blob = eval(HOME.getProperty('GTO.%s' % (blobId)))

    clearInfoProperties()

    try:
        if blob['pvrid'] != 'False':
            timestamp = date2timeStamp(blob['datetime'], '%d.%m.%Y %H:%M')
            if timestamp >= int(time.time()):
                writeLog(
                    'Start time of title \'%s\' is @%s, enable switchtimer button'
                    % (blob['title'], blob['time']))
                HOME.setProperty("GTO.Info.isInFuture", "yes")
            elif timestamp < int(
                    time.time()) < timestamp + 60 * int(blob['runtime']):
                writeLog(
                    'Title \'%s\' is currently running, enable switch button' %
                    (blob['title']))
                HOME.setProperty("GTO.Info.isRunning", "yes")
        else:
            writeLog('No PVR Channel available for %s, disable buttons' %
                     (blob['channel']))
    except (ImportError, ValueError):
        writeLog('Could not make time conversion, strptime locked',
                 level=xbmc.LOGERROR)

    HOME.setProperty("GTO.Info.Title", blob['title'])
    HOME.setProperty("GTO.Info.Picture", blob['thumb'])
    HOME.setProperty("GTO.Info.Description", blob['extrainfos']
                     or __LS__(30140))
    HOME.setProperty("GTO.Info.Channel", blob['pvrchannel'])
    HOME.setProperty("GTO.Info.ChannelID", blob['pvrid'])
    HOME.setProperty("GTO.Info.Logo", blob['logo'])
    HOME.setProperty("GTO.Info.Date", blob['datetime'])
    HOME.setProperty("GTO.Info.StartTime", blob['time'])
    HOME.setProperty("GTO.Info.RunTime", blob['runtime'])
    HOME.setProperty("GTO.Info.EndTime", blob['endtime'])
    HOME.setProperty("GTO.Info.Genre", blob['genre'])
    HOME.setProperty("GTO.Info.Cast", blob['cast'])
    HOME.setProperty("GTO.Info.isInDB", blob['isInDB'])
    if blob['isInDB'] == 'yes':
        HOME.setProperty("GTO.Info.dbTitle", blob['db_title'])
        HOME.setProperty("GTO.Info.dbOriginalTitle", blob['db_originaltitle'])
        HOME.setProperty("GTO.Info.Fanart", blob['db_fanart'])
        HOME.setProperty("GTO.Info.dbTrailer", blob['db_trailer'])
        HOME.setProperty("GTO.Info.dbRating", blob['db_rating'])
        HOME.setProperty("GTO.Info.dbUserRating", blob['db_userrating'])

    if showWindow:
        Popup = xbmcgui.WindowXMLDialog(__xml__, __path__)
        Popup.doModal()
        del Popup
Пример #6
0
 def inner(*args, **kwargs):
     w = None
     try:
         w = xbmcgui.WindowXMLDialog('script-tablo-loading.xml',
                                     ADDON.getAddonInfo('path'), 'Main')
         w.show()
         return func(*args, **kwargs)
     finally:
         if w:
             w.close()
         del w
def show_artist_image():
    """
    Shows current artist as background image.
    """
    # Open custom music visualization dialog
    window = xbmcgui.WindowXMLDialog('music-visualization.xml',
                                     __addon__.getAddonInfo('path'))
    window.show()
    previous_title = ''
    artist_image = ''
    count = 0
    fanart_images = [g_default_fanart,
                     g_blues_fanart,
                     g_soul_fanart,
                     g_rnb_fanart,
                     g_reggae_fanart,
                     g_hip_hop_fanart,
                     g_neo_soul_fanart]
    # While steaming audio check for changes in title every 2 seconds
    while (not xbmc.Monitor().abortRequested() and
           xbmc.Player().isPlayingAudio()):

        my_title = xbmc.Player().getMusicInfoTag().getTitle()
        # Poll for changes in title 
        if my_title != previous_title:
            # Get current artist image
            artist_image = get_current_artist_image()
            # Set artist image property within xml dialog
            window.setProperty('ArtistFanart',
                               artist_image)
            previous_title = my_title

        # Prevent activation of screensaver
        if xbmc.Monitor().onScreensaverActivated and _prevent_screensaver == 'true':
            # Wake up screen (stop screen diming)
            xbmc.executebuiltin('CECActivateSource')

        # Show randon default image
        if artist_image == g_default_fanart and _hide_artist_artwork != 'true':
            # Change image every 30 seconds
            if count == 15:
                # Show random fanart image
                img_count = random.randint(0,len(fanart_images)-1)
                window.setProperty('ArtistFanart',
                                   fanart_images[img_count])
                count = 0
            count += 1

        # Sleep for 2 seconds
        xbmc.sleep(2000)
    
    window.close()
    del window
Пример #8
0
    def _lock(self, txt=None):
        """
		Lock the screen until execution of a backend command
		:param txt: text message to be displayed
		"""
        if self._wait is None:
            self._wait = xbmcgui.WindowXMLDialog(
                "WaitDialog.xml", self.addon.getAddonInfo('path'))
            self._wait.show()
        if self._wait is not None and txt is not None:
            self._wait.getExControl(1000).setLabel(txt)
            self._wait.getExControl(1000).setVisible(True)
Пример #9
0
def showBusy():
    busy = None
    try:
        import xbmcgui
        busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
        busy.show()

        try:    busy.getControl(10).setVisible(False)
        except: pass
    except:
        busy = None

    return busy
Пример #10
0
def show_artist_details(artistname):
    """
    Shows artist information ie. image, genre, description etc.
    """
    artist_info = ArtistInfo(artistname)
    if artist_info.artist_id is not None:
        home = xbmc.translatePath('special://home')
        if xbmc.getInfoLabel('System.ProfileName') != 'Master user':
            you = xbmc.getInfoLabel('System.ProfileName')
        elif (xbmc.getCondVisibility('System.Platform.Windows') is True
              or xbmc.getCondVisibility('System.Platform.OSX') is True):
            if 'Users\\' in home:
                proyou = str(home).split('Users\\')
                preyou = str(proyou[1]).split('\\')
                you = preyou[0]
            else:
                you = 'You'
        else:
            you = 'You'
        # Open custom artist information dialog
        win = xbmcgui.WindowXMLDialog('artist-info.xml',
                                      __addon__.getAddonInfo('path'))
        # Set artist information properties within xml dialog for example
        # <label fallback="416">$INFO[Window.Property(HeadingLabel)]</label>
        win.setProperty('HeadingLabel', artistname)
        win.setProperty('ArtistImage', artist_info.fanart)
        win.setProperty('ArtistStyle', artist_info.style)
        win.setProperty('ArtistGenre', artist_info.genre)
        win.setProperty('ArtistName', artist_info.artist_name)
        win.setProperty('ArtistFormed',
                        str(artist_info.year_formed).replace('None', ''))
        win.setProperty('ArtistBorn',
                        str(artist_info.year_born).replace('None', ''))
        win.setProperty('ArtistDied',
                        str(artist_info.year_died).replace('None', ''))
        win.setProperty('ArtistGender', artist_info.gender)
        win.setProperty(
            'ArtistCountry',
            str(artist_info.country).replace('None', '') + ' ' +
            str(artist_info.country_code).replace('None', ''))
        win.setProperty('ArtistWebsite', artist_info.website)
        win.setProperty('Description', artist_info.biography_en)
        win.doModal()
        del win
    else:
        # Unable to download artist information
        commontasks.notification(_artist_info, _unable_to_download_artist_info,
                                 xbmcgui.NOTIFICATION_INFO, 5000)
    if xbmc.Player().isPlayingAudio():
        thread = threading.Thread(target=show_artist_image, args=())
        thread.start()
Пример #11
0
def viewTallImage(image_url, width, height):
    log( 'viewTallImage %s: %sx%s' %(image_url, width, height))

    useWindow=xbmcgui.WindowXMLDialog('slideshow05.xml', addon_path)

    screen_w=1920
    screen_h=1080

    log('screen %dx%d'%(screen_w,screen_h))
    try:
        w=int(float(width))
        h=int(float(height))
        ar=float(w/h)
        resize_percent=float(screen_w)/w
        if w > screen_w:
            new_h=int(h*resize_percent)
        else:
            if abs( h - screen_h) < ( screen_h / 10 ):  #if the image height is about 10 percent of the screen height, zoom it a bit
                new_h=screen_h*2
            elif h < screen_h:
                new_h=screen_h
            else:
                new_h=h

        log( '   image=%dx%d resize_percent %f  new_h=%d ' %(w,h, resize_percent, new_h))

        loading_img = xbmc.validatePath('/'.join((addon_path, 'resources', 'skins', 'Default', 'media', 'srr_busy.gif' )))

        slide_h=new_h-screen_h
        log( '  slide_h=' + repr(slide_h))

        img_control = xbmcgui.ControlImage(0, 0, screen_w, new_h, '', aspectRatio=2)  #(values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bars)

        img_loading = xbmcgui.ControlImage(screen_w-100, 0, 100, 100, loading_img, aspectRatio=2)

        img_control.setImage(image_url, False)

        useWindow.addControls( [ img_loading, img_control])

        img_control.setPosition(0,0)
        scroll_time=(int(h)/int(w))*20000

        img_control.setAnimations( [
                                    ('conditional', "condition=true delay=6000 time=%d effect=slide  start=0,-%d end=0,0 tween=sine easing=inout  pulse=true" %( scroll_time, slide_h) ),
                                    ('conditional', "condition=true delay=0  time=4000 effect=fade   start=0   end=100    "  ) ,
                                    ]  )
        useWindow.doModal()
        useWindow.removeControls( [img_control,img_loading] )
        del useWindow
    except Exception as e:
        log("  EXCEPTION viewTallImage:="+ str( sys.exc_info()[0]) + "  " + str(e) )
Пример #12
0
def BackupFiles():
    datapath = os.path.join(source, folder)
    outpath = os.path.join(location, 'script.tvguidedixie-backup')

    src = datapath
    dst = outpath

    busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
    busy.show()

    shutil.copytree(src, dst, symlinks=False, ignore=None)

    busy.close()
    ok(TITLE, '', 'Your setup has been successfully backed up.', '')
Пример #13
0
    def onStart(self):
        #check if first run
        firstlock = os.path.join(ADDON_DATA, '.firstrun')
        if not os.path.isfile(firstlock):
            if not os.path.exists(ADDON_DATA):
                os.mkdir(ADDON_DATA)
            setSetting('advancedmode', '0')
            setSetting('notifyonerror', '1')
            setSetting('notifyonsuccess', '1')
            setSetting('confirmationonchange', '1')
            #set default preference:
            self.dlg = xbmcgui.WindowXMLDialog('welcomeDialog.xml', ROOTDIR)
            self.dlg.doModal()

            #xbmcgui.Dialog().ok('Welcome to XBian','Thanks to have chosen XBian','You can configure it, go to','System -> XBian')
            open(firstlock, 'w').close()
Пример #14
0
def RestoreFiles():
    datapath = source
    outpath = os.path.join(location, 'script.tvguidedixie-backup')
    folder = source + 'script.tvguidedixie'

    if os.path.exists(folder):
        shutil.rmtree(folder)

    dst = datapath
    src = outpath

    busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
    busy.show()

    shutil.move(src, dst)

    old = source + 'script.tvguidedixie-backup'
    new = source + 'script.tvguidedixie'
    os.rename(old, new)

    busy.close()
    ok(TITLE, '', 'Your backup has been successfully restored.', '')
Пример #15
0
 def __init__(self, header, name, versionl, versionr, sized, sizei, desc,
              dep):
     xbmc.executebuiltin('Skin.SetString(packageheader,Info : %s)' % header)
     xbmc.executebuiltin('Skin.SetString(packagename,Name : %s)' % name)
     xbmc.executebuiltin(
         'Skin.SetString(packageversionr,Remote version : %s)' % versionr)
     if not versionl:
         versionl = 'Not installed'
     xbmc.executebuiltin(
         'Skin.SetString(packageversioni,Local version : %s)' % versionl)
     xbmc.executebuiltin('Skin.SetString(packagesized,Download size : %s)' %
                         sized)
     xbmc.executebuiltin(
         'Skin.SetString(packagesizei,Installed size : %s)' % sizei)
     xbmc.executebuiltin('Skin.SetString(packagedesc,Description : %s)' %
                         desc)
     if not dep:
         dep = 'None'
     xbmc.executebuiltin('Skin.SetString(packagedep,Dependency : %s)' %
                         dep.replace(',', ''))
     self.dlg = xbmcgui.WindowXMLDialog('DialogPackageInfo.xml', ROOTDIR)
     self.dlg.doModal()
Пример #16
0
 def __init__(self,
              header,
              lines=[],
              checkFn=None,
              logfile=None,
              polltime=2000,
              skinvar=None,
              id=False,
              onFinishedCB=None):
     self.header = header
     self.lines = collections.deque(maxlen=len(self.LINEGUICONTROL))
     self.lines.extend(lines)
     self.checkFn = checkFn
     self.polltime = polltime
     self.logFile = logfile
     self.skinvar = skinvar
     self.id = id
     self.onFinishedCB = onFinishedCB
     self.state = FOREGROUND
     self.dlgForeground = xbmcgui.WindowXMLDialog(
         'DialogWaitBackground.xml', ROOTDIR)
     self.finished = False
     xbmc.executebuiltin('Skin.SetString(backgrounddialogheader,%s)' %
                         self.header)
Пример #17
0
##        li.setEpisode("episode", sitem['Episode'])
##        li.setTitle("Title", sitem['Title'])
##        li.setProperty("rating", sitem['Rating'])
##        li.setProperty("genre", sitem['Genre'])
##        li.setProperty("studio", sitem['Studio'])
##        li.setProperty("year", sitem['Jahr'])
##        li.setProperty("altersfreigabe", sitem['Altersfreigabe'])
##        li.setProperty("label", sitem['Title'])
##        li.setProperty("label2", sitem['TVShow'])
        xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
    xbmcplugin.endOfDirectory(addon_handle)
    xbmc.executebuiltin("Container.Refresh")

elif methode == 'TV_SP_Guide':
   
    Popup = xbmcgui.WindowXMLDialog('script-serienplaner-TVGuide.xml', __path__, 'Default', '1080p')
    Popup.doModal() 

elif methode == 'get_Date':
    gdate = datetime.datetime.strftime(datetime.date.today(), '%d.%m.%Y')
    i=0
 
    for i in range(15):
        _gdate = datetime.date.today() + datetime.timedelta(days=i)

        gdate = _gdate.strftime('%d.%m.%Y')
        wday = _gdate.strftime("%a")

        WINDOW.setProperty('TV-Guide.%s.Date' % (i+1), unicode(gdate))
        WINDOW.setProperty('TV-Guide.%s.Wday' % (i+1), unicode(wday))       
        writeLog('spitems %s - %s' % (wday, WINDOW.getProperty('TV-Guide.%s.Date' % (i+1))), level=xbmc.LOGDEBUG)
Пример #18
0
def showInfoWindow(blobId, showWindow=True):
    writeLog('Collect and set details to home/info screen for blob #%s' %
             (blobId or '<unknown>'))

    if blobId is '' or None:
        writeLog('No ID provided', level=xbmc.LOGFATAL)
        return False

    blob = eval(HOME.getProperty('GTO.%s' % (blobId)))
    blob.update(getRecordingCapabilities(blob['pvrid'], blob['datetime2']))

    clearInfoProperties()

    if blob['pvrid']:
        if blob['broadcastid']:
            writeLog('PVR record function capable (BroadcastID %s)' %
                     (blob['broadcastid']))
            HOME.setProperty("GTO.Info.BroadcastID", str(blob['broadcastid']))
            HOME.setProperty("GTO.Info.hasTimer", str(blob['hastimer']))

        _now = datetime.datetime.now()
        _start = parser.parse(blob['datetime2'])
        _end = parser.parse(blob['enddate'])

        if _start >= _now:
            writeLog(
                'Start time of title \'%s\' is @%s, enable switchtimer button'
                % (blob['title'], blob['datetime']))
            HOME.setProperty("GTO.Info.isInFuture", "True")
        elif _start < _now < _end:
            writeLog(
                'Title \'%s\' is currently running, enable switch button' %
                (blob['title']))
            HOME.setProperty("GTO.Info.isRunning", "True")

    HOME.setProperty("GTO.Info.BlobID", str(blobId))
    HOME.setProperty("GTO.Info.Title", blob['title'])
    HOME.setProperty("GTO.Info.Picture", blob['thumb'])
    HOME.setProperty("GTO.Info.Description", blob['plot'] or __LS__(30140))
    HOME.setProperty("GTO.Info.Channel", blob['pvrchannel'])
    HOME.setProperty("GTO.Info.ChannelID", str(blob['pvrid']))
    HOME.setProperty("GTO.Info.Logo", blob['logo'])
    HOME.setProperty("GTO.Info.Date", blob['datetime'])
    HOME.setProperty("GTO.Info.StartTime", blob['datetime'].split()[1][0:5])
    HOME.setProperty("GTO.Info.RunTime", blob['runtime'])
    HOME.setProperty("GTO.Info.EndTime", blob['enddate'].split()[1][0:5])
    HOME.setProperty("GTO.Info.Genre", blob['genre'])
    HOME.setProperty("GTO.Info.Cast", blob['cast'])
    HOME.setProperty("GTO.Info.isInDB", str(blob['isInDB']))
    if blob['isInDB']:
        HOME.setProperty("GTO.Info.dbTitle", blob['db_title'])
        HOME.setProperty("GTO.Info.dbOriginalTitle", blob['db_originaltitle'])
        HOME.setProperty("GTO.Info.Fanart", blob['db_fanart'])
        HOME.setProperty("GTO.Info.dbTrailer", blob['db_trailer'])
        HOME.setProperty("GTO.Info.dbRating", str(blob['db_rating']))
        HOME.setProperty("GTO.Info.dbUserRating", str(blob['db_userrating']))

    if showWindow:
        Popup = xbmcgui.WindowXMLDialog(__xml__, __path__)
        Popup.doModal()
        del Popup

    HOME.setProperty('GTO.%s' % (blobId), str(blob))
    HOME.setProperty('GTO.timestamp', str(int(time.time()) / 5))
Пример #19
0
def viewTallImage(image_url, width, height):
    log('viewTallImage %s: %sx%s' % (image_url, width, height))
    #image_url=unescape(image_url) #special case for handling reddituploads urls
    #log( 'viewTallImage %s: %sx%s' %(image_url, width, height))

    #useWindow=xbmcgui.WindowDialog()
    useWindow = xbmcgui.WindowXMLDialog('slideshow05.xml', addon_path)
    #useWindow.setCoordinateResolution(1)

    #screen_w=useWindow.getHeight()  #1280
    #screen_h=useWindow.getWidth()  #720
    screen_w = 1920
    screen_h = 1080

    log('screen %dx%d' % (screen_w, screen_h))
    try:
        w = int(float(width))
        h = int(float(height))
        ar = float(w / h)
        resize_percent = float(screen_w) / w
        if w > screen_w:
            new_h = int(h * resize_percent)
        else:
            if abs(h - screen_h) < (
                    screen_h / 10
            ):  #if the image height is about 10 percent of the screen height, zoom it a bit
                new_h = screen_h * 2
            elif h < screen_h:
                new_h = screen_h
            else:
                new_h = h

        log('   image=%dx%d resize_percent %f  new_h=%d ' %
            (w, h, resize_percent, new_h))

        loading_img = xbmc.validatePath('/'.join(
            (addon_path, 'resources', 'skins', 'Default', 'media',
             'srr_busy.gif')))

        slide_h = new_h - screen_h
        log('  slide_h=' + repr(slide_h))
        #sy=0

        #note: y-axis not accurate. 0 does not always indicate top of screen
        img_control = xbmcgui.ControlImage(
            0, 0, screen_w, new_h, '', aspectRatio=2
        )  #(values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bars)
        #img_control = useWindow.getControl( 101 )
        img_loading = xbmcgui.ControlImage(screen_w - 100,
                                           0,
                                           100,
                                           100,
                                           loading_img,
                                           aspectRatio=2)

        #the cached image is of lower resolution. we force nocache by using setImage() instead of defining the image in ControlImage()
        img_control.setImage(image_url, False)

        useWindow.addControls([img_loading, img_control])
        #useWindow.addControl(  img_control )
        img_control.setPosition(0, 0)
        scroll_time = (int(h) / int(w)) * 20000

        img_control.setAnimations([
            ('conditional',
             "condition=true delay=6000 time=%d effect=slide  start=0,-%d end=0,0 tween=sine easing=inout  pulse=true"
             % (scroll_time, slide_h)),
            ('conditional',
             "condition=true delay=0  time=4000 effect=fade   start=0   end=100    "
             ),
        ])
        useWindow.doModal()
        useWindow.removeControls([img_control, img_loading])
        del useWindow
    except Exception as e:
        log("  EXCEPTION viewTallImage:=" + str(sys.exc_info()[0]) + "  " +
            str(e))
Пример #20
0
def show_bulinaechsterspieltag(liga):
    DETAILWIN = xbmcgui.WindowXMLDialog(
        'bulilist-naechsterspieltag-DialogWindow.xml', __addonDir__, 'Default',
        '720p')
    DETAILWIN.doModal()
Пример #21
0
def controller(mode=None, handle=None, content=None, eventId=None, actor=None):
    now = datetime.utcnow().replace(hour=0, minute=0, second=0,
                                    microsecond=0).isoformat() + 'Z'
    timemax = (
        datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0) +
        relativedelta.relativedelta(months=tools.getAddonSetting(
            'timemax', sType=tools.NUM))).isoformat() + 'Z'

    if mode == 'load_glotz_key':
        glotz_apikey = tools.dialogFile(__LS__(30089))
        if glotz_apikey != '':
            tools.setAddonSetting('glotz_apikey', glotz_apikey)
            tools.writeLog('API key for glotz.info successfull stored')
            tools.Notify().notify(__LS__(30010), __LS__(30073))

    elif mode == 'abort_reminders':
        tools.writeLog('abort notification service by setup', xbmc.LOGNOTICE)
        xbmcgui.Window(10000).setProperty('reminders', '0')

    elif mode == 'getcontent':
        googlecal = Calendar()
        googlecal.build_sheet(handle,
                              TEMP_STORAGE_EVENTS,
                              content,
                              now,
                              timemax,
                              maxResult=30)

    elif mode == 'getinfo' and eventId != '':
        googlecal = Calendar()
        events = eventId.strip(' ').split(' ')
        _header = ''
        _msg = ''
        for event in events:
            _ev = googlecal.get_event(event, TEMP_STORAGE_EVENTS)
            _mev = googlecal.prepareForAddon(_ev, optTimeStamps=True)
            _time = '' if _mev.get(
                'range', '') == '' else '[B]%s[/B]: ' % (_mev.get('range'))
            if actor and actor == 'eventlist':
                _header = 'S%02iE%02i: %s' % (
                    _mev.get('season'), _mev.get('episode'), _mev.get('title'))
                _msg = '%s' % (_mev.get('plot'))
            else:
                _header = '%s %s %s' % (__LS__(30109), __LS__(30145),
                                        _mev.get('shortdate', ''))
                _msg += '%s%s[CR]%s[CR][CR]' % (_time, _mev.get(
                    'summary', ''), _mev.get('description') or __LS__(30093))
        tools.dialogOK(_header, _msg)

    elif mode == 'prev':
        calc_boundaries(-1)

    elif mode == 'next':
        calc_boundaries(1)

    # this is the real controller bootstrap
    elif mode == 'gui':
        try:
            Popup = xbmcgui.WindowXMLDialog(__xml__, __path__)
            Popup.doModal()
            del Popup
        except RuntimeError as e:
            raise FileNotFoundException('%s: %s' % (e.message, __xml__))
    else:
        pass
Пример #22
0
def showInfoWindow(detailurl, showWindow=True):
    writeLog('Set details to home/info screen', level=xbmc.LOGDEBUG)

    data = TVDScraper()
    details = getUnicodePage(detailurl)
    if details:
        data.scrapeDetailPage(details,
                              'div id="main-content" class="clearfix"')

        blob = searchBlob('popup', detailurl)

        broadcastinfo = '%s: %s - %s' % (blob['pvrchannel'], blob['time'],
                                         data.endtime)

        writeLog('', level=xbmc.LOGDEBUG)
        writeLog('Title:             %s' % (blob['title']),
                 level=xbmc.LOGDEBUG)
        writeLog('Thumb:             %s' % (blob['thumb']),
                 level=xbmc.LOGDEBUG)
        writeLog('Channel (TVD):     %s' % (blob['channel']),
                 level=xbmc.LOGDEBUG)
        writeLog('Channel (PVR):     %s' % (blob['pvrchannel']),
                 level=xbmc.LOGDEBUG)
        writeLog('ChannelID:         %s' % (blob['pvrid']),
                 level=xbmc.LOGDEBUG)
        writeLog('Start Time:        %s' % (blob['time']), level=xbmc.LOGDEBUG)
        writeLog('End Time:          %s' % (data.endtime), level=xbmc.LOGDEBUG)
        writeLog('Rating Value:      %s' % (data.ratingValue),
                 level=xbmc.LOGDEBUG)
        writeLog('Best Rating:       %s' % (data.bestRating),
                 level=xbmc.LOGDEBUG)
        writeLog('Description:       %s' % (data.plot or __LS__(30140)),
                 level=xbmc.LOGDEBUG)
        writeLog('Keywords:          %s' % (data.keywords),
                 level=xbmc.LOGDEBUG)
        writeLog('Rating Data:       %s' % (data.ratingdata),
                 level=xbmc.LOGDEBUG)
        writeLog('Broadcast Flags:   %s' % (data.broadcastflags),
                 level=xbmc.LOGDEBUG)
        writeLog('', level=xbmc.LOGDEBUG)

        clearInfoProperties()

        WINDOW.setProperty("TVHighlightsToday.Info.isInFuture", "")
        WINDOW.setProperty("TVHighlightsToday.Info.isRunning", "")

        now = datetime.datetime.now()
        _st = '%s.%s.%s %s' % (now.day, now.month, now.year, blob['time'])
        try:
            _date = time.strftime(getDateFormat(),
                                  time.strptime(_st, '%d.%m.%Y %H:%M'))

            timestamp = date2timeStamp(_st, '%d.%m.%Y %H:%M')

            if timestamp >= int(time.time()):
                writeLog(
                    'Start time of title \'%s\' is @%s, enable switchtimer button'
                    % (blob['title'], blob['time']),
                    level=xbmc.LOGDEBUG)
                WINDOW.setProperty("TVHighlightsToday.Info.isInFuture", "yes")
            elif timestamp < int(
                    time.time()) < timestamp + 60 * int(blob['runtime']):
                writeLog(
                    'Title \'%s\' is currently running, enable switch button' %
                    (blob['title']),
                    level=xbmc.LOGDEBUG)
                WINDOW.setProperty("TVHighlightsToday.Info.isRunning", "yes")
        except ImportError:
            writeLog('Could not make time conversion, strptime locked',
                     level=xbmc.LOGERROR)
            _date = ''

        WINDOW.setProperty("TVHighlightsToday.Info.Title", blob['title'])
        WINDOW.setProperty("TVHighlightsToday.Info.Picture", blob['thumb'])
        WINDOW.setProperty("TVHighlightsToday.Info.Subtitle", blob['outline'])
        WINDOW.setProperty("TVHighlightsToday.Info.Description", data.plot
                           or __LS__(30140))
        WINDOW.setProperty("TVHighlightsToday.Info.Broadcastdetails",
                           broadcastinfo)
        WINDOW.setProperty("TVHighlightsToday.Info.Channel",
                           blob['pvrchannel'])
        WINDOW.setProperty("TVHighlightsToday.Info.ChannelID", blob['pvrid'])
        WINDOW.setProperty("TVHighlightsToday.Info.Logo", blob['logo'])
        WINDOW.setProperty("TVHighlightsToday.Info.Date", _date)
        WINDOW.setProperty("TVHighlightsToday.Info.StartTime", blob['time'])
        WINDOW.setProperty("TVHighlightsToday.Info.RunTime", blob['runtime'])
        WINDOW.setProperty("TVHighlightsToday.Info.EndTime", data.endtime)
        WINDOW.setProperty("TVHighlightsToday.Info.Keywords", blob['genre'])

        # Ratings
        i = 1
        for r in data.ratingdata:
            WINDOW.setProperty("TVHighlightsToday.Info.RatingType.%s" % (i),
                               r['ratingtype'])
            WINDOW.setProperty("TVHighlightsToday.Info.Rating.%s" % (i),
                               r['rating'][0])
            i += 1

        if showWindow:
            Popup = xbmcgui.WindowXMLDialog('script-GTO-InfoWindow.xml',
                                            __path__, 'Default', '720p')
            # Popup = xbmcgui.WindowXMLDialog('script-TVHighlights-DialogWindow.xml', __path__, 'Default', '720p')
            Popup.doModal()
    else:
        notifyOSD(__LS__(30010), __LS__(30140))
Пример #23
0
def main(doLogin=True):
    busy = None
    try:
        busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
        busy.show()

        try:    busy.getControl(10).setVisible(False)
        except: pass

    except:
        busy = None

    import buggalo
    import gui

    buggalo.GMAIL_RECIPIENT = '*****@*****.**'

        
    try:
        if doLogin:
            url      = dixie.GetDixieUrl(DIXIEURL) + 'update.txt'
            code     = session.doLogin()
            response = session.checkFiles(url)
        else:
            code = 200
            response = ''
            
        if code == 503:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Something went wrong with your login', 'Please check your settings.')
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Daily IP Address limit reached.', 'Restricted for 2 hours.')
            print '****** OnTapp.TV Error 503. Too many login attempts/IPs exceeded *******'
            return
        
        if response == 401:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'Something went wrong with your login', 'Check your settings, or subscribe at www.on-tapp.tv.')
            print '****** OnTapp.TV Error 401. Access Denied. Not a paid member. *******'
            return
        
        if response == 301:
            xbmc.executebuiltin('XBMC.RunScript($CWD/deleteDB.py)')
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'It looks like you do not have a paid subcription.', 'Check your settings, or subscribe at www.on-tapp.tv.')
            print '****** OnTapp.TV Error 301. Free member. No paid subscription. *******'
            return

        if doLogin:
            # CheckDixieURL()
            CheckVersion()
            GetChannels()
            GetCats()
            CheckSkin()
            CheckSkinVersion()
            CheckIniVersion()
            CheckForUpdate()
            CheckForChannels()

        print '****** OnTapp.TV - All OK *******'

        xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True')
        xbmc.executebuiltin('XBMC.ActivateWindow(home)')

        w = gui.TVGuide()

        if busy:
           busy.close()
           busy = None

        CopyKeymap()
        w.doModal()
        RemoveKeymap()
        del w

        xbmcgui.Window(10000).clearProperty('OTT_RUNNING')

    except Exception:
       buggalo.onExceptionRaised()
Пример #24
0
def show_bulilist(liga):
    DETAILWIN = xbmcgui.WindowXMLDialog(
        'bulilist-platzierung-DialogWindow.xml', __addonDir__, 'Default',
        '720p')
    DETAILWIN.doModal()
Пример #25
0
# Dialogwindows
elif methode == 'show_bulilist':
    WINDOW.setProperty("NewsCenter.Buli.LigaInfo", buliliga)
    show_bulilist(buliliga)

elif methode == 'show_bulispielplan':
    WINDOW.setProperty("NewsCenter.Buli.LigaInfo", buliliga)
    show_bulispielplan(buliliga)

elif methode == 'show_bulinaechsterspieltag':
    WINDOW.setProperty("NewsCenter.Buli.LigaInfo", buliliga)
    show_bulinaechsterspieltag(buliliga)

elif methode == 'show_wetter_karte':
    DETAILWIN = xbmcgui.WindowXMLDialog('wetterkarten-DialogWindow.xml',
                                        __addonDir__, 'Default', '720p')
    DETAILWIN.doModal()

elif methode == 'show_wetter_karte_bundesland':
    DETAILWIN = xbmcgui.WindowXMLDialog(
        'wetterkarten-bundesland-DialogWindow.xml', __addonDir__, 'Default',
        '720p')
    DETAILWIN.doModal()

# Container
elif methode == 'get_buli_spielplan_items':
    spielelist = nb.get_buli_spielplan_items(buliliga)
    url = '-'
    for sitem in spielelist:
        li = xbmcgui.ListItem(sitem['Label'], iconImage=sitem['Logo'])
        li.setProperty("Spieldatum", str(sitem['Spieldatum']))
Пример #26
0
def show_unwetterwarnungen():
    DETAILWIN = xbmcgui.WindowXMLDialog('unwetterwarnungen-DialogWindow.xml',
                                        __addonDir__, 'Default', '720p')
    DETAILWIN.doModal()
Пример #27
0
def main(doLogin=True):
    busy = None
    try:
        busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
        busy.show()

        try:    busy.getControl(10).setVisible(False)
        except: pass

    except:
        busy = None

    import buggalo
    import gui

    buggalo.GMAIL_RECIPIENT = '*****@*****.**'
        
    try:
        if doLogin:
            url      = dixie.GetDixieUrl(DIXIEURL) + 'update.txt'
            code     = session.doLogin()
            response = session.checkFiles(url)
        else:
            code = 200
            response = ''
            
        if code == 503:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Something went wrong with your login', 'Please check your settings.')
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Daily IP Address limit reached.', 'Restricted for 2 hours.')
            return
        
        if response == 401:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'Something went wrong with your login', 'You will now get Basic Channels.')
            d.ok(TITLE + ' Error - %s.' % response, 'OnTapp.TV failed to log in', 'Check your settings.', 'Please subscribe at www.on-tapp.tv.')
            dixie.SetSetting('dixie.url', 'Basic Channels')
            dixie.SetSetting('DIXIEURL', 'Basic Channels')
            return
            
        else:
            # if doLogin:
            #     xbmcgui.Dialog().ok(TITLE + ' Status', 'Status - %s' % response, 'Login OK.', 'Thank you.')
            CheckDixieURL()
            CheckVersion()
            GetCats()
            CheckSkin()
            CheckSkinVersion()
            CheckIniVersion()
            CheckForUpdate()
        
            xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True')
            xbmc.executebuiltin('XBMC.ActivateWindow(home)')
        
            w = gui.TVGuide()
        
            if busy:
               busy.close()
               busy = None
           
            CopyKeymap()
            w.doModal()
            RemoveKeymap()
            del w
        
            xbmcgui.Window(10000).clearProperty('OTT_RUNNING')

    except Exception:
       buggalo.onExceptionRaised()
Пример #28
0
import xbmcaddon
import xbmcgui

if __name__ == '__main__':
    dialog = xbmcgui.WindowXMLDialog(
        'browser.xml',
        xbmcaddon.Addon().getAddonInfo('path').decode('utf-8'), 'default',
        '1080p')
    dialog.doModal()
    del dialog
Пример #29
0
            i = 0
    for c in t2:
        t += chr(c)
        i += 1
        if i > 1:
            t = t[:-1]
            i = 0
    return t


path = current_ini

busy = None
try:
    import xbmcgui
    busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
    busy.show()

    try:
        busy.getControl(10).setVisible(False)
    except:
        pass

except:
    busy = None

import buggalo
import gui

buggalo.GMAIL_RECIPIENT = '*****@*****.**'
Пример #30
0
    num = urllib.unquote_plus(params.get('num', ''))
else:
    methode = None

if methode == 'zap':
    switchToChannel(num)
elif methode == 'get_container':

    for x in range(1, 6):
        writeLog('DEBUG in for loop %s' % (str(x)), level=xbmc.LOGNOTICE)
        ZapVal = WINDOW.getProperty('ReZap.Last.%s' % (x))
        writeLog('DEBUG ZapVal %s' % (str(ZapVal)), level=xbmc.LOGNOTICE)
        if str(WINDOW.getProperty('ReZap.Last.%s' % (x))) != "":
            writeLog('DEBUG in if %s' % (str(ZapVal)), level=xbmc.LOGNOTICE)
            li = item_create(x)
            url = 'XBMC.RunAddon(service.rezap,"?switch=%s" % (str(x)))'
            try:
                xbmcplugin.addDirectoryItem(handle=addon_handle,
                                            url=url,
                                            listitem=li)
            except:
                pass
    xbmcplugin.endOfDirectory(addon_handle)

else:
    RezapLast = WINDOW.getProperty('ReZap.Last.1')
    if RezapLast != '':
        DETAILWIN = xbmcgui.WindowXMLDialog('rezap-DialogWindow.xml',
                                            __addonDir__, 'Default', '720p')
        DETAILWIN.doModal()