update dbus example.py for python3

This commit is contained in:
TingPing 2013-03-15 08:55:15 -03:00
parent ec354038db
commit 16cc178ba0
1 changed files with 3 additions and 3 deletions

View File

@ -15,14 +15,14 @@ hexchat = dbus.Interface(proxy, 'org.hexchat.plugin')
channels = hexchat.ListGet ("channels") channels = hexchat.ListGet ("channels")
while hexchat.ListNext (channels): while hexchat.ListNext (channels):
name = hexchat.ListStr (channels, "channel") name = hexchat.ListStr (channels, "channel")
print "------- " + name + " -------" print("------- " + name + " -------")
hexchat.SetContext (hexchat.ListInt (channels, "context")) hexchat.SetContext (hexchat.ListInt (channels, "context"))
hexchat.EmitPrint ("Channel Message", ["John", "Hi there", "@"]) hexchat.EmitPrint ("Channel Message", ["John", "Hi there", "@"])
users = hexchat.ListGet ("users") users = hexchat.ListGet ("users")
while hexchat.ListNext (users): while hexchat.ListNext (users):
print "Nick: " + hexchat.ListStr (users, "nick") print("Nick: " + hexchat.ListStr (users, "nick"))
hexchat.ListFree (users) hexchat.ListFree (users)
hexchat.ListFree (channels) hexchat.ListFree (channels)
print hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2) print(hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2))