source: genesis/nodes/ip2node.py@ 6394

Last change on this file since 6394 was 5334, checked in by rick, 18 years ago

3 total different ways of making the ip -> nodename link

  • 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.