File: wlp_test

package info (click to toggle)
pyg 0.9.6-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 264 kB
  • ctags: 149
  • sloc: python: 614; ansic: 339; sh: 224; makefile: 110; yacc: 81; lex: 75
file content (31 lines) | stat: -rwxr-xr-x 648 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python

# Script to test if wlp.so works. It should parse confile without errors.

import sys
import wlp

if(len(sys.argv) == 1):
	wlp.setfilebyname('./pyg.wl')
else:
	wlp.setfilebyname(sys.argv[1])

# dict is a { ownername : {variable: value}} dictionary of dictionaries
dict = wlp.mkdict()

try:
	print 'owner: option = value'

	for owner in dict.keys():
		options = dict[owner]
		for option in options.keys():
			print '%s: %s = %s' % (owner,option,options[option])
except (Exception), message:
	print message


for k in dict.keys():
	if(dict[k]['From:'] == 'Cosimo Alfarano'):
		print '%s has %s' % (k,dict[k]['From:'])

sys.exit(0)