source: genesis/nodes/prepconf.py@ 2388

Last change on this file since 2388 was 1995, checked in by lodewijk, 21 years ago

eerste regel was wit, zorg dat dat niet gebeurt

File size: 965 bytes
RevLine 
[1980]1# gegeven een file met een lijst van te gebruiken wleiden.conf's, print
2# op stdout een file waar channelga.ml wat mee kan.
[1928]3import re
4
[1995]5first = 1
6
[1928]7def parse_wleiden_conf(lines):
[1995]8 global first
[1935]9 essid = None
[1928]10 wi = None
11 for l in lines:
12 if wi != None:
[1935]13 match = re.match("^ESSID=(.*)", l)
[1928]14 if match != None:
[1980]15 print match.group(1),
[1935]16 match = re.match("^EW[0-9]*", l)
[1928]17 if match != None:
[1935]18 wi = None
19 essid = None
[1980]20 match = re.match("^EOS", l)
21 if match != None:
22 wi = None
23 essid = None
[1928]24 else:
25 match = re.match("^\$nodename='([^']*)';.*", l)
26 if match != None:
[1995]27 if first:
28 first = 0
29 else:
30 print ""
[1980]31 print match.group(1).lower(),
[1935]32 match = re.match("^\$config{'wi[0-9]*:[0-9].*", l)
33 if match != None:
34 continue
[1928]35 match = re.match("^\$config{'(wi[0-9]*).*", l)
36 if match != None:
[1980]37 print match.group(1).lower(),
38 wi = 1
[1928]39
[1980]40for fname in open('l').readlines():
41 parse_wleiden_conf(open(fname[:-1]).readlines())
[1928]42
Note: See TracBrowser for help on using the repository browser.