本文整理汇总了Python中utils.notify函数的典型用法代码示例。如果您正苦于以下问题:Python notify函数的具体用法?Python notify怎么用?Python notify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了notify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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')
示例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)
示例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))
示例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
示例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')
示例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))
示例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')
示例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
示例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
示例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)
示例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')
示例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')
示例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()
示例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")