I'm puzzled now; replaced "m" with "mm" and the error still exists.
Then made this smaller one from the actual code and that works!
*************************************************************************** ******************
#!/usr/bin/env python26
q_list = [('94.vmtest2', 'sgmops', 'John Dee', '27/04 00:27:26', 'C',
'27/04 00:28:31', 'vmtest1.hep', 'express', '00:00:10', '00:01:04',
'https://lb-monit.physics.ox.ac.uk:9000/S2pcB8Wbtdn35b9w'),
('96.vmtest2', 'sgmops', 'John Dee', '27/04 01:27:26', 'C',
'27/04 01:28:33', 'vmtest1.hep', 'short', '00:00:09', '00:01:06',
'https://lcglb02.gridpp.rl.ac.uk:9000/8r8Ire9KxQI_LfeBOWhw'),
('98.vmtest2', 'sgmops', 'Andy Lapka', '27/04 06:21:07',
'C','27/04 06:22:22', 'vmtest1.hep', 'express', '00:00:10',
'00:01:13', 'https://wmssamtest01.cern.ch:9000/FiC4GP-LBiW55h5RAFdw'),
('99.vmtest2', 'sgmops', 'Andy Lampka', '27/04 07:19:56',
'C', '27/04 07:21:12', 'vmtest1.hep', 'express', '00:00:10',
'00:01:14', 'https://wms220.cern.ch:9000/cQg3Zy4WirC3ALmpzLw'),
('103.vmtest2', 'sgmops', 'And yLapka', '27/04 14:08:00',
'C', '27/04 14:09:16', 'vmtest1.hep', 'express', '00:00:10',
'00:01:16', 'https://wmssamtest02.cern.ch:9000/7C2EBltqVYV_iZ9Exw'),
('102.vmtest2', 'sgmops', 'John Dee', '27/04 14:02:38', 'C',
'27/04 14:10:12', 'vmtest1.hep', 'short', '00:00:10', '00:01:10',
'https://lb-monit.physics.ox.ac.uk:9000/XE1VavnZZEinCEKZQ')]
q_dict = {'realuser': 'johndee', 'queue': 'short'}
f_list = ['user', 'startdate', 'cputime','egiid']
# List of key fields
ttl_lst = ['Job Id','User','Real User','Start Date','S','End Date',\
'Exec Host','Queue','CPU Time','Wall Time','EGI Id']
def main(f=None):
if f is None: f = []
fld_lens = range(len(ttl_lst))
field_nr = dict([((ttl_lst[x].lower().replace(' ','')), x) for x
in fld_lens])
field_nr['jobstatus'] = field_nr.pop('s')
max_lens = [max([len(item[x]) for item in q_list]) for x in
fld_lens]
#print "Field_Nr: ", field_nr, "\n"
if len(f) == 0: fields = fld_lens[:8]
else:
fields = [field_nr[m] for m in f]
if 0 not in fields: fields.insert(0,0)
print "\n"," ".join([ttl_lst[ix].ljust(max_lens[ix]) for ix in
fields])
print " ".join(['-'*(max_lens[ix]) for ix in fields])
for tm in q_list:
ssd = tuple([ m.lower().replace(' ','') for m in tm ])
if all(ssd[field_nr[k]] == v for k,v in q_dict.iteritems()):
print ' '.join([tm[x].ljust(max_lens[x]) for x in
fields])
if __name__ == "__main__":
#main()
main(f_list)
*************************************************************************** *
Do you want me to send the actual one? Or any other further
thought(s)?
-San
On Jun 6, 4:23 pm, Mark Dufour <mark.duf...@gmail.com> wrote:
> hi sans,
> ************************
> > field_nr = {'startdate': 3, 'enddate': 5, 'jobstatus': 4, 'cputime':
> > 2, 'jobid': 0, 'queue': 7, 'user': 1, 'exechost': 6}
> > f_list = ['user', 'enddate', 'cputime']
> > fields = [field_nr[m] for m in f_list]
> > *************************
> thanks for reporting. looks like a bug! this fragment seems to work fine
> when compiled separately though.. could you perhaps send me a larger
> fragment (as small as possible) that shedskin fails on, or the whole
> program? my guess is that there is another variable 'm' somewhere that is
> interfering with this one, but that's just a hunch..
> thanks again,
> mark.
> --http://www.youtube.com/watch?v=E6LsfnBmdnk