Line | |
---|
1 |
|
---|
2 | import sys
|
---|
3 | import time
|
---|
4 |
|
---|
5 | from backup_monitoring.parsing.parsers import vmquery as parser
|
---|
6 |
|
---|
7 | file = open('test.txt', 'r')
|
---|
8 |
|
---|
9 | stream = parser.stream(file)
|
---|
10 |
|
---|
11 | i = 0
|
---|
12 |
|
---|
13 | for record in stream:
|
---|
14 |
|
---|
15 | i += 1
|
---|
16 |
|
---|
17 | print i
|
---|
18 |
|
---|
19 | #print record
|
---|
20 |
|
---|
21 | try:
|
---|
22 |
|
---|
23 | instance = parser.parse(record)
|
---|
24 |
|
---|
25 | #for key, value in instance.items():
|
---|
26 | # print '[%s] = [%s]' % (key, value)
|
---|
27 |
|
---|
28 | except:
|
---|
29 |
|
---|
30 | for line in record:
|
---|
31 |
|
---|
32 | print line
|
---|
33 |
|
---|
34 | sys.exit(1)
|
---|
35 |
|
---|
36 | # time.sleep(5)
|
---|
37 |
|
---|
38 | file.close()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.