Updated applescript fun
parent
e3210a174b
commit
346cfaa18e
|
@ -1,12 +1,6 @@
|
||||||
#import xchat
|
|
||||||
import commands
|
import commands
|
||||||
import string
|
import string
|
||||||
|
|
||||||
__module_name__ = "Cog status plugin"
|
|
||||||
__module_version__ = "0.1"
|
|
||||||
__module_description__ = "Displays the current song cog is playing"
|
|
||||||
|
|
||||||
#def cog_cb(word, word_eol, userdata):
|
|
||||||
def cog_test():
|
def cog_test():
|
||||||
command = "osascript -e \\\n\
|
command = "osascript -e \\\n\
|
||||||
\"tell application \\\"Cog\\\"\n\
|
\"tell application \\\"Cog\\\"\n\
|
||||||
|
@ -20,7 +14,6 @@ def cog_test():
|
||||||
|
|
||||||
output = commands.getoutput(command);
|
output = commands.getoutput(command);
|
||||||
|
|
||||||
# print output
|
|
||||||
info = string.split(output,"\t")
|
info = string.split(output,"\t")
|
||||||
length = float(info[4])
|
length = float(info[4])
|
||||||
length = int(length/1000)
|
length = int(length/1000)
|
||||||
|
@ -29,11 +22,5 @@ def cog_test():
|
||||||
line = "[ Artist: %s ][ Album: %s ][ Title: %s ][ %skbps ][ %i:%02i ]" % (info[1], info[2], info[0], info[3], min, sec)
|
line = "[ Artist: %s ][ Album: %s ][ Title: %s ][ %skbps ][ %i:%02i ]" % (info[1], info[2], info[0], info[3], min, sec)
|
||||||
|
|
||||||
print line
|
print line
|
||||||
# xchat.command("me is playing %s" % line)
|
|
||||||
|
|
||||||
# return xchat.EAT_ALL
|
|
||||||
|
|
||||||
#xchat.hook_command("cog", cog_cb)
|
|
||||||
|
|
||||||
print "Cog loaded..."
|
|
||||||
cog_test();
|
cog_test();
|
||||||
|
|
Loading…
Reference in New Issue