Lines 1-7
Link Here
|
1 |
#!/usr/bin/env python |
1 |
#!/usr/bin/env python |
2 |
|
2 |
|
3 |
import sys |
3 |
import sys |
4 |
import string |
|
|
5 |
import getopt |
4 |
import getopt |
6 |
import signal |
5 |
import signal |
7 |
|
6 |
|
Lines 294-303
Link Here
|
294 |
self.got_totals = 1 |
293 |
self.got_totals = 1 |
295 |
line2 = f.readline() |
294 |
line2 = f.readline() |
296 |
line2 = line2.strip() |
295 |
line2 = line2.strip() |
297 |
splt = string.split(line2,',') |
296 |
splt = line2.split(',') |
298 |
|
297 |
|
299 |
x = 0 |
298 |
x = 0 |
300 |
for i in string.split(line[8:],','): |
299 |
for i in line[8:].split(','): |
301 |
self.field_vals[i] = splt[x] |
300 |
self.field_vals[i] = splt[x] |
302 |
x += 1 |
301 |
x += 1 |
303 |
|
302 |
|
Lines 306-315
Link Here
|
306 |
|
305 |
|
307 |
line2 = f.readline() |
306 |
line2 = f.readline() |
308 |
line2 = line2.strip() |
307 |
line2 = line2.strip() |
309 |
splt = string.split(line2,',') |
308 |
splt = line2.split(',') |
310 |
|
309 |
|
311 |
x = 0 |
310 |
x = 0 |
312 |
for i in string.split(line[8:],','): |
311 |
for i in line[8:].split(','): |
313 |
self.field_vals[i] = splt[x] |
312 |
self.field_vals[i] = splt[x] |
314 |
self.field_vals[x] = splt[x] |
313 |
self.field_vals[x] = splt[x] |
315 |
x += 1 |
314 |
x += 1 |
Lines 321-333
Link Here
|
321 |
|
320 |
|
322 |
# foreach element in field names |
321 |
# foreach element in field names |
323 |
x = 0 |
322 |
x = 0 |
324 |
for i in string.split(line[8:],','): |
323 |
for i in line[8:].split(','): |
325 |
|
324 |
|
326 |
# remove key designators |
325 |
# remove key designators |
327 |
if i[-1:] == '*': |
326 |
if i[-1:] == '*': |
328 |
i = i[:-1] |
327 |
i = i[:-1] |
329 |
self.field_keys[self.field_total] = 1 |
328 |
self.field_keys[self.field_total] = 1 |
330 |
i = string.lower(i) |
329 |
i = i.lower() |
331 |
self.field_idx[i] = self.field_total |
330 |
self.field_idx[i] = self.field_total |
332 |
|
331 |
|
333 |
# default to the length of the header |
332 |
# default to the length of the header |
Lines 346-352
Link Here
|
346 |
# if in the data area and not a comment, store it |
345 |
# if in the data area and not a comment, store it |
347 |
if self.in_data and line [:1] != '#': |
346 |
if self.in_data and line [:1] != '#': |
348 |
|
347 |
|
349 |
splt = string.split(line, ',') |
348 |
splt = line.split(',') |
350 |
|
349 |
|
351 |
for i in xrange(self.field_total): |
350 |
for i in xrange(self.field_total): |
352 |
|
351 |
|
Lines 373-379
Link Here
|
373 |
def pickdisplay(self, f): |
372 |
def pickdisplay(self, f): |
374 |
|
373 |
|
375 |
self.field_use['all'] = 0 |
374 |
self.field_use['all'] = 0 |
376 |
for i in string.split(f, ','): |
375 |
for i in f.split(','): |
377 |
self.field_use[i] = 1 |
376 |
self.field_use[i] = 1 |
378 |
|
377 |
|
379 |
# figure out which fields are okay to print |
378 |
# figure out which fields are okay to print |