Fixed binary command.

This commit is contained in:
Jeremy Fincher 2003-06-12 16:05:27 +00:00
parent 1a704ef1f7
commit 046c6998e4

View File

@ -140,13 +140,21 @@ class FunCommands(callbacks.Privmsg):
""" """
L = [] L = []
for c in privmsgs.getArgs(args): for c in privmsgs.getArgs(args):
LL = []
i = ord(c) i = ord(c)
counter = 8
while i: while i:
counter -= 1
if i & 1: if i & 1:
L.append('1') LL.append('1')
else: else:
L.append('0') LL.append('0')
i >>= 1 i >>= 1
while counter:
LL.append('0')
counter -= 1
LL.reverse()
L.extend(LL)
irc.reply(msg, ''.join(L)) irc.reply(msg, ''.join(L))
def hexlify(self, irc, msg, args): def hexlify(self, irc, msg, args):