source: genesis/tools/ip2node.py@ 13384

Last change on this file since 13384 was 8615, checked in by rick, 14 years ago

Bezempje door alle files. Rommel weg. Tooljes op de juiste locatie.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:mime-type set to text/plain
File size: 624 bytes
Line 
1#!/usr/bin/env python
2import os
3import re
4
5def xor(a,b):
6 return (not b and a) or (not a and b) or False
7
8ipre = re.compile('^IP')
9masterre = re.compile('master_ip')
10ipnumber = re.compile('([0-9]{1,3}(\.[0-9]{1,3}){3})')
11
12for file in os.listdir('.'):
13 if file[0:5] == "proxy" or file[0:5] == "CNode":
14 conf = open( file + '/wleiden.conf', 'r')
15 for line in conf.readlines():
16 a = ipre.search(line)
17 b = masterre.search(line)
18 if (xor(a,b)):
19 result = ipnumber.search(line).groups()[0]
20 print '%s|%s' % ( result,file)
21 conf.close()
22
Note: See TracBrowser for help on using the repository browser.