mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Use 'future' division in src/ircutils.py.
This commit is contained in:
parent
df2d976818
commit
66e4243a14
@ -35,6 +35,8 @@ dicts, a nick class to handle nicks (so comparisons and hashing and whatnot
|
|||||||
work in an IRC-case-insensitive fashion), and numerous other things.
|
work in an IRC-case-insensitive fashion), and numerous other things.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import division
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
@ -483,7 +485,7 @@ def dccIP(ip):
|
|||||||
x = 256**3
|
x = 256**3
|
||||||
for quad in ip.split('.'):
|
for quad in ip.split('.'):
|
||||||
i += int(quad)*x
|
i += int(quad)*x
|
||||||
x /= 256
|
x //= 256
|
||||||
return i
|
return i
|
||||||
|
|
||||||
def unDccIP(i):
|
def unDccIP(i):
|
||||||
@ -492,7 +494,7 @@ def unDccIP(i):
|
|||||||
L = []
|
L = []
|
||||||
while len(L) < 4:
|
while len(L) < 4:
|
||||||
L.append(i % 256)
|
L.append(i % 256)
|
||||||
i /= 256
|
i //= 256
|
||||||
L.reverse()
|
L.reverse()
|
||||||
return '.'.join(imap(str, L))
|
return '.'.join(imap(str, L))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user