mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 13:01:07 -05:00
LastFM: switch to using wrap() as a decorator
This commit is contained in:
parent
1ae2baa347
commit
5bf5772b9a
@ -94,7 +94,8 @@ class LastFM(callbacks.Plugin):
|
|||||||
self.db.flush()
|
self.db.flush()
|
||||||
self.__parent.die()
|
self.__parent.die()
|
||||||
|
|
||||||
def nowPlaying(self, irc, msg, args, user):
|
@wrap([optional("something")])
|
||||||
|
def np(self, irc, msg, args, user):
|
||||||
"""[<user>]
|
"""[<user>]
|
||||||
|
|
||||||
Announces the track currently being played by <user>. If <user>
|
Announces the track currently being played by <user>. If <user>
|
||||||
@ -168,9 +169,8 @@ class LastFM(callbacks.Plugin):
|
|||||||
(ircutils.bold(user), ircutils.bold(track),
|
(ircutils.bold(user), ircutils.bold(track),
|
||||||
ircutils.bold(artist), ircutils.bold(album), time, public_url))
|
ircutils.bold(artist), ircutils.bold(album), time, public_url))
|
||||||
|
|
||||||
np = wrap(nowPlaying, [optional("something")])
|
@wrap(["something"])
|
||||||
|
def set(self, irc, msg, args, newId):
|
||||||
def setUserId(self, irc, msg, args, newId):
|
|
||||||
"""<user>
|
"""<user>
|
||||||
|
|
||||||
Sets the LastFM username for the caller and saves it in a database.
|
Sets the LastFM username for the caller and saves it in a database.
|
||||||
@ -179,8 +179,7 @@ class LastFM(callbacks.Plugin):
|
|||||||
self.db.set(msg.prefix, newId)
|
self.db.set(msg.prefix, newId)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
set = wrap(setUserId, ["something"])
|
@wrap([optional("something")])
|
||||||
|
|
||||||
def profile(self, irc, msg, args, user):
|
def profile(self, irc, msg, args, user):
|
||||||
"""[<user>]
|
"""[<user>]
|
||||||
|
|
||||||
@ -226,8 +225,6 @@ class LastFM(callbacks.Plugin):
|
|||||||
irc.reply("%(id)s (realname: %(realname)s) registered on %(registered)s; age: %(age)s / %(gender)s; "
|
irc.reply("%(id)s (realname: %(realname)s) registered on %(registered)s; age: %(age)s / %(gender)s; "
|
||||||
"Country: %(country)s; Tracks played: %(playcount)s" % profile)
|
"Country: %(country)s; Tracks played: %(playcount)s" % profile)
|
||||||
|
|
||||||
profile = wrap(profile, [optional("something")])
|
|
||||||
|
|
||||||
filename = conf.supybot.directories.data.dirize("LastFM.db")
|
filename = conf.supybot.directories.data.dirize("LastFM.db")
|
||||||
|
|
||||||
Class = LastFM
|
Class = LastFM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user