|
Last change
on this file since 2472 was 1995, checked in by lodewijk, 22 years ago |
|
eerste regel was wit, zorg dat dat niet gebeurt
|
|
File size:
965 bytes
|
| Line | |
|---|
| 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.
|
|---|
| 3 | import re
|
|---|
| 4 |
|
|---|
| 5 | first = 1
|
|---|
| 6 |
|
|---|
| 7 | def parse_wleiden_conf(lines):
|
|---|
| 8 | global first
|
|---|
| 9 | essid = None
|
|---|
| 10 | wi = None
|
|---|
| 11 | for l in lines:
|
|---|
| 12 | if wi != None:
|
|---|
| 13 | match = re.match("^ESSID=(.*)", l)
|
|---|
| 14 | if match != None:
|
|---|
| 15 | print match.group(1),
|
|---|
| 16 | match = re.match("^EW[0-9]*", l)
|
|---|
| 17 | if match != None:
|
|---|
| 18 | wi = None
|
|---|
| 19 | essid = None
|
|---|
| 20 | match = re.match("^EOS", l)
|
|---|
| 21 | if match != None:
|
|---|
| 22 | wi = None
|
|---|
| 23 | essid = None
|
|---|
| 24 | else:
|
|---|
| 25 | match = re.match("^\$nodename='([^']*)';.*", l)
|
|---|
| 26 | if match != None:
|
|---|
| 27 | if first:
|
|---|
| 28 | first = 0
|
|---|
| 29 | else:
|
|---|
| 30 | print ""
|
|---|
| 31 | print match.group(1).lower(),
|
|---|
| 32 | match = re.match("^\$config{'wi[0-9]*:[0-9].*", l)
|
|---|
| 33 | if match != None:
|
|---|
| 34 | continue
|
|---|
| 35 | match = re.match("^\$config{'(wi[0-9]*).*", l)
|
|---|
| 36 | if match != None:
|
|---|
| 37 | print match.group(1).lower(),
|
|---|
| 38 | wi = 1
|
|---|
| 39 |
|
|---|
| 40 | for fname in open('l').readlines():
|
|---|
| 41 | parse_wleiden_conf(open(fname[:-1]).readlines())
|
|---|
| 42 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.