• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.notify函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Login

def Login():
    utils.log('================ VPNicity Login ================')
    with requests.Session() as s:
        try:
            s.get(LOGINURL)
        except: 
            return False
        
        USER     = ADDON.getSetting('USER')
        PASS     = ADDON.getSetting('PASS')
        PAYLOAD  = { 'log' : USER, 'pwd' : PASS, 'wp-submit' : 'Log In' }
        response = 'login_error'
        code     =  0

        if USER and PASS:
            login    = s.post(LOGINURL, data=PAYLOAD)
            response = login.content
            # code     = login.status_code
            # saveCookies(s.cookies, cookiefile)
        
        if 'no-access-redirect' in response:
            error   = '301 - No Access.'
            message = 'It appears that your subscription has expired.'
            utils.log(message + ' : ' + error)
            utils.dialogOK(message, error, 'Please check your account at www.vpnicity.com')

            KillVPN(silent=True)
            
            return False
            
        areLost    = 'Are you lost' in response
        loginError = 'login_error' in response
        okay       =  (not areLost) and (not loginError)
        
        if okay:
            message = 'Logged into VPNicity'
            utils.log(message)
            utils.notify(message)
            return True
            
        try:
            error = re.compile('<div id="login_error">(.+?)<br />').search(response).groups(1)[0]
            error = error.replace('<strong>',  '')
            error = error.replace('</strong>', '')
            error = error.replace('<a href="https://www.vpnicity.com/wp-login.php?action=lostpassword">Lost your password?</a>', '')
            error = error.strip()
            print error
        except:
            error = ''
            
        message = 'There was a problem logging into VPNicity'
        
        utils.log('************ VPNicity Error ************')
        utils.log(message + ' : ' + error)
        utils.log('****************************************')
        utils.dialogOK(message, error, 'Please check your account at www.vpnicity.com')
        
        KillVPN(silent=True)
        
    return False
开发者ID:Nemeziz,项目名称:Dixie-Deans-XBMC-Repo,代码行数:60,代码来源:vpn.py


示例2: Playvid

def Playvid(url, name):
    dp = xbmcgui.DialogProgress()
    dp.create("Searching webcamlink","Searching webcamlink for:",name)
    count = 0
    for videoid in range(491, 340, -1):
        dp.update(int(count))
        videotest = 'false'
        testurl = 'http://video%s.myfreecams.com:1935/NxServer/mfc_%s.f4v_aac/playlist.m3u8' % (videoid, url)
        if videotest == 'false':
            try: videotest = urllib2.urlopen(testurl)
            except: videotest = 'false'
        count = count + 0.7
        if not videotest == 'false':
            dp.update(100)
            dp.close()
            break
        if dp.iscanceled():
            dp.close()
            break
    if not videotest == 'false':
        videourl = testurl
        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)
    else:
        utils.notify('Oh oh','Couldn\'t find a playable webcam link')
开发者ID:RaspberryMCAdmin,项目名称:DevProjects,代码行数:35,代码来源:myfreecams.py


示例3: update_alert

 def update_alert(self, version):
     latest = Menu().check_version()
     if latest != version and latest != 0:
         notify('MusicBox Update is available', 1)
         time.sleep(0.5)
         notify('NetEase-MusicBox installed version:' + version +
                '\nNetEase-MusicBox latest version:' + latest, 0)
开发者ID:KindleCode,项目名称:musicbox,代码行数:7,代码来源:menu.py


示例4: togglePreview

 def togglePreview(self):
     if self.toggledPreview():
         Window(10000).clearProperty('SR_togglePreview')
         utils.notify(utils.translation(32226))
     else:
         Window(10000).setProperty('SR_togglePreview', '1')
         utils.notify(utils.translation(32227))
开发者ID:AllanMar,项目名称:plugin.video.surveillanceroom,代码行数:7,代码来源:monitor.py


示例5: autostart

def autostart():
    """
    Starts the cleaning service.
    """
    cleaner = Cleaner()

    service_sleep = 4  # Lower than 4 causes too much stress on resource limited systems such as RPi
    ticker = 0
    delayed_completed = False

    while not cleaner.monitor.abortRequested():
        if get_setting(service_enabled):
            scan_interval_ticker = get_setting(scan_interval) * 60 / service_sleep
            delayed_start_ticker = get_setting(delayed_start) * 60 / service_sleep

            if delayed_completed and ticker >= scan_interval_ticker:
                results, _ = cleaner.clean_all()
                notify(results)
                ticker = 0
            elif not delayed_completed and ticker >= delayed_start_ticker:
                delayed_completed = True
                results, _ = cleaner.clean_all()
                notify(results)
                ticker = 0

            cleaner.monitor.waitForAbort(service_sleep)
            ticker += 1
        else:
            cleaner.monitor.waitForAbort(service_sleep)

    debug(u"Abort requested. Terminating.")
    return
开发者ID:Anthirian,项目名称:script.filecleaner,代码行数:32,代码来源:service.py


示例6: toggle_preset

 def toggle_preset(self):
     if self.preset_button.isSelected():
         self.camera.ptz_add_preset()
         utils.notify('Home Location is now Current Location')
     else:
         self.camera.ptz_delete_preset()
         utils.notify('Home Location is now Default Location')
开发者ID:AllanMar,项目名称:plugin.video.surveillanceroom,代码行数:7,代码来源:cameraplayer.py


示例7: _populate_record

    def _populate_record(self, record, data):
        """
        Given mapping of data, copy values to attributes on record.

        Subclasses may override to provide schema validation, selective
        copy of names, and normalization of values if/as necessary.
        """
        changelog = []
        for key, value in data.items():
            if key.startswith('_'):
                continue  # invalid key
            if key == 'record_uid':
                self.record_uid = str(value)
                continue
            try:
                self._type_whitelist_validation(value)
            except ValueError:
                continue  # skip problem name!
            existing_value = getattr(self, key, None)
            if value != existing_value:
                changelog.append(key)
                setattr(record, key, value)
        if changelog:
            record._p_changed = True
            changelog = [
                Attributes(self.RECORD_INTERFACE, name)
                for name in changelog
                ]
            notify(ObjectModifiedEvent(record, *changelog))
开发者ID:upiq,项目名称:uu.record,代码行数:29,代码来源:base.py


示例8: Playvid

def Playvid(url, name, download):
    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:Mirocow,项目名称:WhiteCream-V0.0.2,代码行数:7,代码来源:hentaihaven.py


示例9: autostart

def autostart():
    """
    Starts the cleaning service.
    """
    cleaner = Cleaner()

    service_sleep = 4  # Lower than 4 causes too much stress on resource limited systems such as RPi
    ticker = 0
    delayed_completed = False

    while not xbmc.abortRequested:
        if get_setting(service_enabled):
            scan_interval_ticker = get_setting(scan_interval) * 60 / service_sleep
            delayed_start_ticker = get_setting(delayed_start) * 60 / service_sleep

            if delayed_completed and ticker >= scan_interval_ticker:
                results = cleaner.clean_all()
                if results:
                    notify(results)
                ticker = 0
            elif not delayed_completed and ticker >= delayed_start_ticker:
                delayed_completed = True
                results = cleaner.clean_all()
                if results:
                    notify(results)
                ticker = 0

            xbmc.sleep(service_sleep * 1000)
            ticker += 1
        else:
            xbmc.sleep(service_sleep * 1000)

    print("Abort requested. Terminating.")
    return
开发者ID:nguoicodon,项目名称:script.filecleaner,代码行数:34,代码来源:service.py


示例10: autostart

def autostart():
    """
    Starts the cleaning service.
    """
    cleaner = Cleaner()

    service_sleep = 10
    ticker = 0
    delayed_completed = False

    while not xbmc.abortRequested:
        if get_setting(service_enabled):
            scan_interval_ticker = get_setting(scan_interval) * 60 / service_sleep
            delayed_start_ticker = get_setting(delayed_start) * 60 / service_sleep

            if delayed_completed and ticker >= scan_interval_ticker:
                results, exit_status = cleaner.cleanup()
                if results and exit_status == 0:
                    notify(results)
                ticker = 0
            elif not delayed_completed and ticker >= delayed_start_ticker:
                delayed_completed = True
                results, exit_status = cleaner.cleanup()
                if results and exit_status == 0:
                    notify(results)
                ticker = 0

            xbmc.sleep(service_sleep * 1000)
            ticker += 1
        else:
            xbmc.sleep(service_sleep * 1000)

    debug("Abort requested. Terminating.")
    return
开发者ID:struart,项目名称:script.filecleaner,代码行数:34,代码来源:service.py


示例11: PHVideo

def PHVideo(url, name, download=None):
    progress.create('Play video', 'Searching videofile.')
    progress.update( 10, "", "Loading video page", "" )
    Supported_hosts = ['Openload.io', 'StreamCloud', 'NowVideo', 'FlashX', 'www.flashx.tv', 'streamcloud.eu', 'streamin.to']
    videopage = utils.getHtml(url, '')
    match = re.compile(r'<li id="link-([^"]+).*?xs-12">\s+Watch it on ([\w\.]+)', re.DOTALL | re.IGNORECASE).findall(videopage)
    if len(match) > 1:
        sites = []
        vidurls = []
        for videourl, site in match:
            if site in Supported_hosts:
                sites.append(site)
                vidurls.append(videourl)
        if len(sites) ==  1:
            sitename = match[0][1]
            siteurl = match[0][0]
        else:
            site = utils.dialog.select('Select video site', sites)
            sitename = sites[site]
            siteurl = vidurls[site]
    else:
        sitename = match[0][1]
        siteurl = match[0][0]
    outurl = "http://www.pornhive.tv/en/out/" + siteurl
    progress.update( 20, "", "Getting video page", "" )
    if 'loud' in sitename:
        progress.update( 30, "", "Getting StreamCloud", "" )
        playurl = getStreamCloud(outurl)
    elif "lash" in sitename:
        progress.update( 30, "", "Getting FlashX", "" )
        playurl = getFlashX(outurl)
    elif sitename == "NowVideo":
        progress.update( 30, "", "Getting NowVideo", "" )
        playurl = getNowVideo(outurl)        
    elif "Openload" in sitename:
        progress.update( 30, "", "Getting Openload", "" )
        progress.close()
        utils.PLAYVIDEO(outurl, name, download)
        return
    elif "streamin" in sitename:
        progress.update( 30, "", "Getting Streamin", "" )
        streaming = utils.getHtml(outurl, '')
        outurl=re.compile("action='([^']+)'").findall(streaming)[0]
        progress.close()
        utils.playvideo(outurl, name, download)
        return
    else:
        progress.close()
        utils.notify('Sorry','This host is not supported.')
        return
    progress.update( 90, "", "Playing video", "" )
    progress.close()
    if download == 1:
        utils.downloadVideo(playurl, name)
    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(playurl, listitem)
开发者ID:badwog1,项目名称:kodi-repo-gaymods,代码行数:59,代码来源:pornhive.py


示例12: Favorites

def Favorites(fav,mode,name,url,img):
    if fav == "add":
        delFav(url)
        addFav(mode, 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:RaspberryMCAdmin,项目名称:DevProjects,代码行数:9,代码来源:favorites.py


示例13: Playvid

def Playvid(url, name, download):
    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:Mirocow,项目名称:WhiteCream-V0.0.2,代码行数:10,代码来源:sexix.py


示例14: test_syntax

def test_syntax():
    data = get_current_config()
    test_result, message = check_config(data)

    if not test_result:
        utils.notify('Crontab config error', message, debug=True)

    crontab_exists = check_crontab_exists()

    if crontab_exists:
        remove_config()
开发者ID:akademic,项目名称:cron_checker,代码行数:11,代码来源:cron_config.py


示例15: play

def play():
    """ Main function to show all cameras """

    if settings.atLeastOneCamera():
        monitor.set_playingCamera("0")
        PlayerWindow = AllCameraDisplay()
        del PlayerWindow
        monitor.clear_playingCamera("0")

    else:
        utils.log(2, "No Cameras Configured")
        utils.notify("You must configure a camera first")
开发者ID:geneliu,项目名称:plugin.video.surveillanceroom,代码行数:12,代码来源:allcameraplayer.py


示例16: List

def List():
    conn = sqlite3.connect(favoritesdb)
    c = conn.cursor()
    try:
        c.execute("SELECT * FROM favorites")
        for (name, url, mode, img) in c.fetchall():
            utils.addLink(name, url, int(mode), img, '', '', 'del')
        conn.close()
        xbmcplugin.endOfDirectory(utils.addon_handle)
    except:
        conn.close()
        utils.notify('No Favourites','No Favourites found')
        return
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:13,代码来源:favorites.py


示例17: fetchFile

    def fetchFile(self):
        retVal = self.FETCH_NOT_NEEDED
        fetch = False
        if not os.path.exists(self.filePath):  # always fetch if file doesn't exist!
            fetch = True
        else:
            interval = int(self.addon.getSetting('xmltv.interval'))
            if interval <> self.INTERVAL_ALWAYS:
                modTime = datetime.datetime.fromtimestamp(os.path.getmtime(self.filePath))
                td = datetime.datetime.now() - modTime
                # need to do it this way cause Android doesn't support .total_seconds() :(
                diff = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / 10 ** 6
                if ((interval == self.INTERVAL_12 and diff >= 43200) or
                        (interval == self.INTERVAL_24 and diff >= 86400) or
                        (interval == self.INTERVAL_48 and diff >= 172800)):
                    fetch = True
            else:
                fetch = True

        if fetch:

            username = utils.get_setting(addon_id,'username')
            password = utils.get_setting(addon_id,'password')
            base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
            tmpFile = os.path.join(self.basePath, 'tmp')
            f = open(tmpFile, 'wb')

            try:
                request = urllib2.Request(self.fileUrl)
		request.add_header("Authorization", "Basic %s" % base64string)   
                tmpData = urllib2.urlopen(request)
                data = tmpData.read()
                if tmpData.info().get('content-encoding') == 'gzip':
                    data = zlib.decompress(data, zlib.MAX_WBITS + 16)
                f.write(data)
                f.close()

            except urllib2.HTTPError, e:
		if e.code == 401:
                    utils.notify(addon_id, 'Authorization Error !!! Please Check Your Username and Password')
		else:
		    utils.notify(addon_id, e)
            
            if os.path.getsize(tmpFile) > 256:
                if os.path.exists(self.filePath):
                    os.remove(self.filePath)
                os.rename(tmpFile, self.filePath)
                retVal = self.FETCH_OK
                xbmc.log('[script.ivueguide] file %s was downloaded' % self.filePath, xbmc.LOGDEBUG)
            else:
                retVal = self.FETCH_ERROR
开发者ID:AMOboxTV,项目名称:AMOBox.LegoBuild,代码行数:51,代码来源:fileFetcher.py


示例18: add

 def add(self, record):
     """
     Add a record to container, append UUID to end of order; over-
     write existing entry if already exists for a UUID (in such case
     leave order as-is).
     """
     uid = str(record.record_uid)
     if not uid:
         raise ValueError('record has empty UUID')
     self._entries[uid] = record
     if uid not in self._order:
         self._order.append(uid)
         self._update_size()
     notify(ObjectAddedEvent(record, self, uid))
开发者ID:upiq,项目名称:uu.record,代码行数:14,代码来源:base.py


示例19: clean_database

def clean_database(showdialog=False):
    conn = sqlite3.connect(xbmc.translatePath("special://database/Textures13.db"))
    try:
        with conn:
            list = conn.execute("SELECT id, cachedurl FROM texture WHERE url LIKE '%%%s%%';" % ".systemcdn.net")
            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%%';" % ".systemcdn.net")
            if showdialog:
                utils.notify('Finished','Cam4 images cleared')
    except:
        pass
开发者ID:Mirocow,项目名称:WhiteCream-V0.0.2,代码行数:14,代码来源:cam4.py


示例20: Network

def Network():
    url     = 'http://www.iplocation.net/'
    request = requests.get(url)
    link    = request.content
    match   = re.compile("<td width='80'>(.+?)</td><td>(.+?)</td><td>(.+?)</td><td>.+?</td><td>(.+?)</td>").findall(link)
    count   = 1
    
    for ip, region, country, isp in match:
        if count <2:
            message = 'IP Address: %s Based in: %s ISP: %s' % (ip, country, isp)
            utils.notify(message)
            utils.log('VPNicity IP Address is: %s' % ip)
            utils.log('VPNicity Country is: %s' % country)
            count = count+1
开发者ID:Nemeziz,项目名称:Dixie-Deans-XBMC-Repo,代码行数:14,代码来源:ipcheck.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.now函数代码示例发布时间:2022-05-26
下一篇:
Python utils.normalize函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap