当前位置: 首页>>代码示例>>Python>>正文


Python utils.notify函数代码示例

本文整理汇总了Python中resources.lib.utils.notify函数的典型用法代码示例。如果您正苦于以下问题:Python notify函数的具体用法?Python notify怎么用?Python notify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了notify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PTList

def PTList(url, page=1, onelist=None):
    if onelist:
        url = url.replace('page=1','page='+str(page))
    try:
        listhtml = utils.getHtml(url, '')
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None
    match = re.compile(r'<div class="(?:visible-xs|thumb-overlay)+">\s+<img src=.*?data-original="([^"]+)" title="([^"]+)"[^>]+>(.*?)duration">[^\d]+([^\t\n\r]+)', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for img, name, hd, duration in match:
        name = utils.cleantext(name)
        if hd.find('HD') > 0:
            hd = " [COLOR orange]HD[/COLOR] "
        else:
            hd = " "
        urlid = re.search(r"(\d{2,})", img, re.DOTALL | re.IGNORECASE).group()
        videopage = "http://www.porntrex.com/media/nuevo/config.php?key=" + urlid + "-1-1"
        name = name + hd + "[COLOR deeppink]" + duration + "[/COLOR]"
        utils.addDownLink(name, videopage, 52, img, '')
    if not onelist:
        if re.search('class="prevnext">Next', listhtml, re.DOTALL | re.IGNORECASE):
            npage = page + 1        
            url = url.replace('page='+str(page),'page='+str(npage))
            utils.addDir('Next Page ('+str(npage)+')', url, 51, '', npage)
        xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:25,代码来源:porntrex.py

示例2: BGList

def BGList(url):
    bgversion = addon.getSetting('bgversion')
    try:
        listjson = utils.getHtml(url,'')
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None

    match = re.compile(r'\{"title":"([^"]+)","id":"([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listjson)

    for title, videoid in match:
        img = "http://img.beeg.com/236x177/" + videoid +  ".jpg"
        videopage = "https://api.beeg.com/api/v6/"+bgversion+"/video/" + videoid
        name = title.encode("utf8")
        utils.addDownLink(name, videopage, 82, img, '')
    try:
        page=re.compile('http://api2.beeg.com/api/v6/'+bgversion+'/index/[^/]+/([0-9]+)/pc', re.DOTALL | re.IGNORECASE).findall(url)[0]
        page = int(page)
        npage = page + 1
        jsonpage = re.compile(r'pages":(\d+)', re.DOTALL | re.IGNORECASE).findall(listjson)[0]
        if int(jsonpage) > page:
            nextp = url.replace("/"+str(page)+"/", "/"+str(npage)+"/")
            utils.addDir('Next Page ('+str(npage)+')', nextp,81,'')
    except: pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:25,代码来源:beeg.py

示例3: List

def List(url):
    try:
        listhtml = utils.getHtml(url, '')
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None
    match = re.compile('thumb-main-titre"><a href="..([^"]+)".*?title="([^"]+)".*?src="([^"]+)".*?<div class="thumb-info">(.*?)time">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videourl, name, img, hd, duration in match:
        name = utils.cleantext(name)
        if hd.find('hd') > 0:
            if hd.find('full') > 0:
                hd = " [COLOR yellow]FULLHD[/COLOR] "
            else:
                hd = " [COLOR orange]HD[/COLOR] "
        else:
            hd = " "
        videopage = "http://www.absoluporn.com" + videourl
        videopage = videopage.replace(" ","%20")
        name = name + hd + "[COLOR deeppink]" + duration + "[/COLOR]"
        utils.addDownLink(name, videopage, 302, img, '')
    try:
        nextp=re.compile(r'<span class="text16">\d+</span> <a href="..([^"]+)"').findall(listhtml)[0]
        nextp = nextp.replace(" ","%20")
        utils.addDir('Next Page', 'http://www.absoluporn.com' + nextp, 301,'')
    except: pass    
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:26,代码来源:absoluporn.py

示例4: Playvid

def Playvid(url, name, download=None):
    videopage = utils.getHtml(url)
    videourl = re.compile('class="btn btn-1 btn-1e" href="([^"]+)" target="_blank"', re.DOTALL | re.IGNORECASE).findall(videopage)[0]
    if videourl:
        utils.playvid(videourl, name, download)
    else:
        utils.notify('Oh oh','Couldn\'t find a video')
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:hentaihaven.py

示例5: Playvid

def Playvid(username, name):
    try:
       postRequest = {'method' : 'getRoomData', 'args[]' : 'false', 'args[]' : str(username)}
       response = utils.postHtml('http://bongacams.com/tools/amf.php', form_data=postRequest,headers={'X-Requested-With' : 'XMLHttpRequest'},compression=False)
    except:
        utils.notify('Oh oh','Couldn\'t find a playable webcam link')
        return None

    amf_json = json.loads(response)

    if amf_json['localData']['videoServerUrl'].startswith("//mobile"):
       videourl = 'https:' + amf_json['localData']['videoServerUrl'] + '/hls/stream_' + username + '.m3u8'  
    else:
       videourl = 'https:' + amf_json['localData']['videoServerUrl'] + '/hls/stream_' + username + '/playlist.m3u8'

    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
    listitem.setProperty("IsPlayable","true")
    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(videourl, listitem)
        xbmc.Player().play(pl)
    else:
        listitem.setPath(str(videourl))
        xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:27,代码来源:bongacams.py

示例6: alarmStateHealthCheck

    def alarmStateHealthCheck(self):
        """ Function to determine state of alarms on cameras, and also connectivity health of camera """

        # Non-alarm enabled or Generic IP Cameras return this
        if not self.motion_enabled and not self.sound_enabled:
            return False
        
        alarmActive = False  
        success_code, alarmActive, alarm = self.camera.is_alarm_active(self.motion_enabled, self.sound_enabled)

        ### Health Check code for Foscam Camera ###
        if success_code != 0:       

            #Timeout is ~20 seconds before determining camera is not connected  
            for x in range(1,2):
                
                utils.log(2, 'Camera %s :: SERVICE HEALTH CHECK :: Did not receive response 0, received response %d.  Retry # %d in 5 seconds' %(self.camera.number, success_code, x))
                self.monitor.waitForAbort(5)
                success_code, alarmActive, alarm = self.camera.is_alarm_active(self.motion_enabled, self.sound_enabled)      

                if success_code == 0:  
                    break

            #Camera is not connected, so notify the user
            if success_code != 0:

                self.monitor.closeRequest(self.camera.number)
                utils.notify(utils.translation(32222) %self.camera.number)   
                self.monitor.write_testResult(self.camera.number, success_code)

                #Loop to keep retrying the connection ever 60 seconds
                x = 0
                while success_code != 0:
                    if self.monitor.abortRequested() or self.monitor.stopped():
                        return False
                    
                    if x > 60:
                        x = 0
                        utils.log(3, 'Camera %s :: SERVICE HEALTH CHECK  :: Did not receive response 0, received response %d.  Retrying every 60 seconds.' %(self.camera.number, success_code))
                        success_code, alarmActive, alarm = self.camera.is_alarm_active(self.motion_enabled, self.sound_enabled)
                    
                    self.monitor.waitForAbort(1)
                    x += 1

                utils.notify(utils.translation(32223) %self.camera.number)
                self.monitor.write_testResult(self.camera.number, success_code)
                
                #Reset PTZ Camera on Service Start
                self.camera.resetLocation()
                    
            ### End of Health Check code for Foscam HD camera ###


        if alarmActive:
            self.monitor.set_alarmActive(self.camera.number)
            utils.log(2, 'Camera %s :: Alarm detected: (%sed).' %(self.camera.number, alarm))
            return True
    
        self.monitor.clear_alarmActive(self.camera.number)   
        return False
开发者ID:AllanMar,项目名称:plugin.video.surveillanceroom,代码行数:60,代码来源:service.py

示例7: Favorites

def Favorites(fav, favmode, name, url, img):
    if fav == "add":
        existing_favorite = select_favorite(url)
        if existing_favorite:
            if existing_favorite[0] == name and existing_favorite[3] == img and existing_favorite[2] == favmode:
                utils.notify('Favorite already exists', 'Video already in favorites')
            else:
                if existing_favorite[2] != favmode:
                    question = 'it'
                if existing_favorite[0] != name:
                    question = 'its name'
                if existing_favorite[3] != img:
                    question = 'its picture'
                if existing_favorite[0] != name and existing_favorite[3] != img:
                    question = 'its name and picture'
                if utils.dialog.yesno('Video already in favorites','This video is already in the favorites with the title', existing_favorite[0], 'Update {}?'.format(question)):
                    update_favorite(favmode, name, url, img)
                    utils.notify('Favorite updated', 'Video updated')
        else:
            addFav(favmode, name, url, img)
            utils.notify('Favorite added', 'Video added to the favorites')
    elif fav == "del":
        delFav(url)
        utils.notify('Favorite deleted', 'Video removed from the list')
        xbmc.executebuiltin('Container.Refresh')
    elif fav == "move_to_end":
        move_fav_to_end(url)
        utils.notify('Favorite moved', 'Video moved to end of the list')
        xbmc.executebuiltin('Container.Refresh')
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:29,代码来源:favorites.py

示例8: Favorites

def Favorites(fav, favmode, name, url, img):
    if fav == "add":
        delFav(url)
        addFav(favmode, name, url, img)
        utils.notify("Favorite added", "Video added to the favorites")
    elif fav == "del":
        delFav(url)
        utils.notify("Favorite deleted", "Video removed from the list")
        xbmc.executebuiltin("Container.Refresh")
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:9,代码来源:favorites.py

示例9: Playvid

def Playvid(url, name, download=None):
    videopage = utils.getHtml(url)
    plurl = re.compile('\?u=([^"]+)"', re.DOTALL | re.IGNORECASE).findall(videopage)[0]
    plurl = "http://sexix.net/qaqqew/playlist.php?u=" + plurl
    plpage = utils.getHtml(plurl, url)
    videourl = re.compile('file="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(plpage)[0]
    if videourl:
        utils.playvid(videourl, name, download)
    else:
        utils.notify("Oh oh", "Couldn't find a video")
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:10,代码来源:sexix.py

示例10: clear_fav

def clear_fav():
    if not utils.dialog.yesno('Warning','This will delete all your favorites', 'Continue?', nolabel='No', yeslabel='Yes'):
        return
    conn = sqlite3.connect(favoritesdb)
    c = conn.cursor()
    c.execute("DELETE FROM favorites")
    conn.commit()
    conn.close()
    xbmc.executebuiltin('Container.Refresh')
    utils.notify("Favorites deleted", "")
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:10,代码来源:favorites.py

示例11: HCList

def HCList(url):
    utils.addDir('[COLOR hotpink]A-Z List[/COLOR] [COLOR white]Censored & Uncensored[/COLOR]','http://www.hentaicraving.com/hentai-list/',33,'','')
    try:
        link = utils.getHtml(url, '')
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None
    match = re.compile("""<a href='([^']+)'><img.*?title="([^"]+)".*?src="([^"]+)".*?Description: </b> ([^<]+)<p>""", re.DOTALL | re.IGNORECASE).findall(link)
    for videourl, name, img, desc in match:
        addHCDir(name, videourl, 31, img, desc)
    xbmc.executebuiltin('Container.SetViewMode(503)')
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:12,代码来源:hentaicraving.py

示例12: Playvid

def Playvid(performerID, name):
	response = utils.getHtml("https://streamate.com/ajax/config/?name=" + name + "&sakey=&sk=streamate.com&userid=0&version=2.2.0&ajax=1")
	data = json.loads(response)
	
	host = data['liveservices']['host'] + "/socket.io/?puserid=" + performerID + "&EIO=3&transport=websocket" #24824942
	ws = websocket.WebSocket()
	ws = websocket.create_connection(host)
	
	ws.send('40/live')
	
	quitting = 0
	while quitting == 0:
		message =  ws.recv()
		match = re.compile('performer offline', re.DOTALL | re.IGNORECASE).findall(message)
		if match:
			quitting=1
			ws.close()
			utils.notify('Model is offline')
			return None

		match = re.compile('isPaid":true', re.DOTALL | re.IGNORECASE).findall(message)
		if match:
			quitting=1
			ws.close()
			utils.notify('Model not in freechat')
			return None
		   
        match = re.compile('roomInfoUpdate', re.DOTALL | re.IGNORECASE).findall(message)
        if match:
			ws.send('42/live,["GetVideoPath",{"nginx":1,"protocol":2,"attempt":1}]')
			while quitting == 0:
				message = ws.recv()
				match = re.compile('(http[^"]+m3u8)', re.DOTALL | re.IGNORECASE).findall(message)
				if match:
					videourl = match[0]
					quitting=1
					ws.close()

	iconimage = xbmc.getInfoImage("ListItem.Thumb")
	listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
	listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
	listitem.setProperty("IsPlayable","true")
	if int(sys.argv[1]) == -1:
		pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
		pl.clear()
		pl.add(videourl, listitem)
		xbmc.Player().play(pl)
	else:
		#iconimage = xbmc.getInfoImage("ListItem.Thumb")
		#listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
		#listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
		xbmc.Player().play(videourl, listitem)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:52,代码来源:streamate.py

示例13: Playvid

def Playvid(url, name):
    playmode = int(addon.getSetting('chatplay'))
    chatslow = int(addon.getSetting('chatslow'))
    listhtml = utils.getHtml(url, hdr=cbheaders)
    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    
    m3u8url = re.compile(r"jsplayer, '([^']+)", re.DOTALL | re.IGNORECASE).findall(listhtml)
    if m3u8url:
        m3u8stream = m3u8url[0]
        if chatslow == 1:
            m3u8stream = m3u8stream.replace('_fast','')
    else:
        m3u8stream = False
    
    if playmode == 0:
        if m3u8stream:
            videourl = m3u8stream
        else:
            utils.notify('Oh oh','Couldn\'t find a playable webcam link')
            return
        
    elif playmode == 1:
        if m3u8stream:
            from F4mProxy import f4mProxyHelper
            f4mp=f4mProxyHelper()
            f4mp.playF4mLink(m3u8stream,name,proxy=None,use_proxy_for_chunks=False, maxbitrate=0, simpleDownloader=False, auth=None, streamtype='HLS',setResolved=False,swf=None , callbackpath="",callbackparam="", iconImage=iconimage)
            return
        else:
            utils.notify('Oh oh','Couldn\'t find a playable webcam link')
            return        
    
    elif playmode == 2:
        flv_info = []
        embed = re.compile(r"EmbedViewerSwf\(*(.+?)\);", re.DOTALL).findall(listhtml)[0]
        for line in embed.split("\n"):
            data = re.search("""\s+["']([^"']+)["'],""", line)
            if data:
                flv_info.append(data.group(1))
        
        streamserver = "rtmp://%s/live-edge"%(flv_info[2])
        modelname = flv_info[1]
        username = flv_info[8]
        password = urllib.unquote(flv_info[12])
        unknown = flv_info[13]
        swfurl = "https://chaturbate.com/static/flash/CBV_2p650.swf"
        
        videourl = "%s app=live-edge swfUrl=%s tcUrl=%s pageUrl=http://chaturbate.com/%s/ conn=S:%s conn=S:%s conn=S:2.650 conn=S:%s conn=S:%s playpath=mp4"%(streamserver,swfurl,streamserver,modelname,username,modelname,password,unknown)

    listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
    listitem.setProperty("IsPlayable","true")
    xbmc.Player().play(videourl, listitem)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:52,代码来源:chaturbate.py

示例14: new_build_check

def new_build_check():
    log.log("Checking for a new build")
    
    check_official = addon.get_bool_setting('check_official')
    check_interval = addon.get_int_setting('check_interval')

    autoclose_ms = check_interval * 3540000 # check interval in ms - 1 min
    
    try:
        installed_build = builds.get_installed_build()
    except:
        log.log("Unable to get installed build so exiting")
        sys.exit(1)

    source = addon.get_setting('source_name')
    if (isinstance(installed_build, builds.Release) and source == "Official Releases"
        and not check_official):
        # Don't do the job of the official auto-update system.
        log.log("Skipping build check - official release")
    else:
        builds.arch = utils.get_arch()

        if addon.get_bool_setting('set_timeout'):
            builds.timeout = float(addon.get_setting('timeout'))

        build_sources = builds.sources()
        try:
            build_url = build_sources[source]
        except KeyError:
            log.log("{} is not a valid source".format(source))
            return

        log.log("Checking {}".format(build_url.url))

        latest = builds.latest_build(source)
        if latest and latest > installed_build:
            if utils.do_show_dialog():
                log.log("New build {} is available, "
                        "prompting to show build list".format(latest))

                if utils.yesno(
                        addon.name,
                        line1=L10n(32027).format(utils.format_build(latest)),
                        line2=L10n(32028).format(utils.format_build(installed_build)),
                        line3=L10n(32029),
                        autoclose=autoclose_ms):
                    with Main() as main:
                        main.start()
            else:
                utils.notify(L10n(32030).format(utils.format_build(latest)),
                             4000)
开发者ID:Gaudi111,项目名称:script.openelec.devupdate,代码行数:51,代码来源:default.py

示例15: clean_database

def clean_database(showdialog=True):
    conn = sqlite3.connect(xbmc.translatePath("special://database/Textures13.db"))
    try:
        with conn:
            list = conn.execute("SELECT id, cachedurl FROM texture WHERE url LIKE '%%%s%%';" % "m.camsoda.com")
            for row in list:
                conn.execute("DELETE FROM sizes WHERE idtexture LIKE '%s';" % row[0])
                try: os.remove(xbmc.translatePath("special://thumbnails/" + row[1]))
                except: pass
            conn.execute("DELETE FROM texture WHERE url LIKE '%%%s%%';" % "m.camsoda.com")
            if showdialog:
                utils.notify('Finished','Camsoda images cleared')
    except:
        pass
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:14,代码来源:camsoda.py


注:本文中的resources.lib.utils.notify函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。