Acceleration...
darcs-hash:20050715183119-d1718-ec0be153ee0b38e8786d5c1edeea11063a21e598.gz
This commit is contained in:
parent
996d55c8a4
commit
1aedddb031
1 changed files with 6 additions and 0 deletions
|
@ -50,6 +50,8 @@ def DecToQuad(ip_dec) :
|
|||
except :
|
||||
raise ValueError('IP Invalide')
|
||||
|
||||
__paramDone = {}
|
||||
|
||||
def param(net, raw=False) :
|
||||
"""
|
||||
net est un résau fourni sous la forme xxx.xxx.xxx.xxx/yy
|
||||
|
@ -62,6 +64,8 @@ def param(net, raw=False) :
|
|||
Si raw = False, alors, on ne convertit pas les résultats sous forme pointée.
|
||||
Ils restent sous forme d'un entier.
|
||||
"""
|
||||
if raw and net in __paramDone:
|
||||
return __paramDone[net]
|
||||
reseau = {}
|
||||
ip, mask = net.split('/')
|
||||
|
||||
|
@ -82,6 +86,8 @@ def param(net, raw=False) :
|
|||
if not raw:
|
||||
for i in reseau.keys():
|
||||
reseau[i] = DecToQuad(reseau[i])
|
||||
else:
|
||||
__paramDone[net] = reseau
|
||||
return reseau
|
||||
|
||||
def AddrInNet(ip,net) :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue