本文整理汇总了Python中xchat.unhook函数的典型用法代码示例。如果您正苦于以下问题:Python unhook函数的具体用法?Python unhook怎么用?Python unhook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unhook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BanTimerGo
def BanTimerGo(newInfo=None,newTime=None,onYouJoin=False):
global banTimer,nextBanInfo,nextBanTime
if onYouJoin:
newInfo = None
newTime = None
#endif
curTime = time()
if not newTime:
for servChan in banTimes:
serv,chan = tuple(servChan.split("/",1))
if xchat.find_context(serv,chan):
remove = []
for mask in banTimes[servChan]:
thTime = banTimes[servChan][mask]
if thTime <= curTime: remove.append((servChan,mask,thTime))
elif not nextBanTime or thTime < nextBanTime:
newInfo = (servChan,mask)
newTime = thTime
#endif
#endfor
for x in remove: BanTimerTick(x)
#endif
#endfor
#endif
if newInfo and newTime and (not nextBanTime or newTime < nextBanTime):
nextBanInfo = newInfo
nextBanTime = newTime
if banTimer: xchat.unhook(banTimer)
banTimer = xchat.hook_timer((newTime-int(time()))*1000, BanTimerTick)
示例2: skip_print
def skip_print(self, name):
def hook_func(word, word_eol, userdata):
return xchat.EAT_XCHAT
hook = xchat.hook_print(name, hook_func, priority=xchat.PRI_HIGHEST)
yield
xchat.unhook(hook)
示例3: steiner
def steiner(text, text_eol, userdata):
ignore = ['swim', 'seventyNexus', 'SeventyTwo', 'Noxialis', 'ChanServ', 'cocaine', 'Ultimation_', 'roofletrain', 'Serpentine', 'hachimitsu-boy', 'whatapath', 'YourImaginaryFriend', 'RocketLauncher', 'Onee-chan', 'Fijou', 'DarkAceLaptop', 'GayServ', 'zingas', 'rpk', 'qb', 'mkillebrew', 'whoapath', 'guymann', 'Doomfag', 'maws', 'cunnelatio', 'DenSaakalte', 'martian', 'irc', 'cyberdynesystems', 'net', 'somberlain', 'PhilKenSebben', 'kyokugen', 'Erotica', 'mechanicalTurk', 'ed', 'anon__', 'E-Pain', 'thenoize', 'skew', 'StoneColdSteveAustin', 'frussif', 'Ultimation', 'charles', 'i7MUSHROOM', 'slamm', 'homo', 'Hypnotized', 'Dr_Venture', 'AoC', 'Porygon', 'axujen', 'Jax', 'Special-G', 'peopleschampion', 'LtSerge', 'Dwarf', 'pinetreegator', 'Cap', '[^_^]', 'swam', 'Clear', 'takoyaki', 'keret', 'MeanPocket', 'keref', 'hachi', 'vortmax', 'War', 'Hachi-chan', 'JediDachshund', 'BillGates', 'BTDT', 'kk', 'guy9000', 'Erzengel', 'Revived', 'BradPitt', 'Colink', 'ekOz', 'Jynweythek']
steiner = ""
nick = xchat.strip(text[0]).translate(str.maketrans("", "", "+%@&~"))
if nick in ignore or "ScottSteiner" not in xchat.get_info("nick"): return
if text[1] == "nothing gayer":
steiner = "than {}".format(nick)
elif re.search("nothin(?:g(?:'s|)|)gayer", text[1]):
steiner = "{} is a faggot".format(nick)
elif re.search("nothin(?:g(?:'s|)|) finer than", text[1]) or text[1] == "no one kinder than":
steiner = "Scott Steiner"
elif re.search("nothin(?:g(?:'s|)|) finer", text[1]) or text[1] == "no one kinder":
steiner = "than Scott Steiner"
elif text[1] == "nothing is finer":
steiner = "than {} being a dumbfuck inbred retard who still can't into a simple script".format(nick)
elif text[1] == "big poppa pump":
steiner = "IS YOUR HOOKUP. HOLLER IF YA HEAR ME"
if steiner:
print("{0}<{1}{0}> {2}".format("\x0307", text[0],text[1]))
xchat.get_context().command("say {}".format(steiner))
global steinerhook, steinertimer
xchat.unhook(steinerhook)
steinertimer = xchat.hook_timer(60000, steinertoggle)
steinerhook = None
return xchat.EAT_XCHAT
示例4: initialize
def initialize():
print "initialize"
global original_nick, timer_begins, timer_ends
global uppercase_hook, action_hook, nick_hook, heretic_hook
global ACF_BEGIN_TIME, ACF_END_TIME, has_joined
has_joined = True
hooks = [timer_begins, timer_ends, uppercase_hook, action_hook, nick_hook, heretic_hook]
for h in hooks:
if h is not None:
xchat.unhook(h)
h = None
timer_begins = xchat.hook_timer(time_to(ACF_BEGIN_TIME), ACF_begin)
timer_ends = xchat.hook_timer(time_to(ACF_END_TIME), ACF_end)
uppercase_hook = xchat.hook_command("", to_uppercase)
action_hook = xchat.hook_command("me", to_uppercase_action)
nick_hook = xchat.hook_command("nick", change_nick)
heretic_hook = xchat.hook_server("PRIVMSG", heretic_patrol)
xchat.hook_command("leave", leave_dc801)
original_nick = xchat.get_info("nick")
if all_caps_friday() and original_nick.islower():
new_nick = original_nick.upper()
cmd = "nick %s" % new_nick
xchat.command(cmd)
return xchat.EAT_ALL
return xchat.EAT_NONE
示例5: stop
def stop():
global my_hook
if my_hook is not None:
xchat.unhook(my_hook)
my_hook = None
print "EasyXdcc stoped"
return xchat.EAT_ALL
示例6: enumerate_cb
def enumerate_cb(self, data):
try:
self.enumerate_tabs()
except:
pass
if self.timerhook:
xchat.unhook(self.timerhook)
self.timerhook = None
示例7: stop
def stop(self, userdata):
chan = userdata[0].get_info('channel')
if chan in self.scrobblers:
xchat.unhook(self.scrobblers[chan])
del self.scrobblers[chan]
print "scrobbling ended on " + chan
else:
print "wheren't scrobbling on " + chan
示例8: unload_cb
def unload_cb(userdata):
global timer_hook
if timer_hook is not None:
xchat.unhook(timer_hook)
timer_hook = None
#force the nick as away
update_away_nick()
print "[autoaway] Module Unloads!"
示例9: unload_cb
def unload_cb(userdata):
"""Esta funcion debe desconectar todas las funciones del modulo al
descargarse el script
Argumentos:
userdata -- variable opcional que se puede enviar a un hook (ignorado)
"""
# Desconectamos las funciones
xchat.unhook(HOOKEJEMPLO1)
示例10: CheckJoin
def CheckJoin(word,word_eol,userdata):
global dInfo
sServ=xchat.get_info("network")
if sServ in dInfo and word[0] == dInfo[sServ]["nick"]:
dInfo[sServ]["on"] = 5
if "timer" in dInfo[sServ]:
xchat.unhook(dInfo[sServ]["timer"])
del dInfo[sServ]["timer"]
示例11: check_channel
def check_channel(userdata):
global cnh
global channel
cn = xchat.find_context(channel='#%s' % channel)
if cn is not None:
xchat.unhook(cnh)
else:
xchat.command("join #" + channel)
return xchat.EAT_ALL
示例12: defab_callback
def defab_callback(word, word_eol, user_data):
global fab_hook
if fab_hook is not None:
hexchat.unhook(fab_hook)
fab_hook = None
hexchat.prnt('Fabulous mode off')
return hexchat.EAT_ALL
示例13: CheckQuit
def CheckQuit(word,word_eol,userdata):
global dInfo
sServ=xchat.get_info("network")
if sServ in dInfo and word[0] == dInfo[sServ]["nick"]:
xchat.command("nick %s" % dInfo[sServ]["nick"])
if "timer" in dInfo[sServ]:
xchat.unhook(dInfo[sServ]["timer"])
#endif
del dInfo[sServ]
示例14: hookShowMenus
def hookShowMenus(*args):
if hasattr(hookShowMenus, 'handler'):
xchat.unhook(hookShowMenus.handler)
next, meal_type = min((secondsToTime(hour, minute), meal_type)
for hour, minute, meal_type in ((8, 0, 'Breakfast'),
(11, 45, 'Lunch'),
(17, 0, 'Happy Hour'),
(17, 45, 'Dinner')))
hookShowMenus.handler = xchat.hook_timer(
next * 1000, onTimer, args[:2] + (meal_type,))
示例15: on_part
def on_part(word, word_eol, userdata):
global jointimer
if jointimer:
xchat.unhook(jointimer)
jointimer = None
triggerchannel = word[2].lower()
thecontext = xchat.find_context(channel=triggerchannel)
if triggerchannel in option["opin"]:
if triggerchannel in option["limitchannels"] and option["limitjoins"] == True:
jointimer = xchat.hook_timer(option["limittime"], part_limit, userdata=thecontext)