Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
variable has no type - ERROR!!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sans  
View profile  
 More options Jun 6 2011, 10:04 am
From: Sans <r.santanu....@gmail.com>
Date: Mon, 6 Jun 2011 07:04:32 -0700 (PDT)
Local: Mon, Jun 6 2011 10:04 am
Subject: variable has no type - ERROR!!
Dear all,

The above error is coming from this piece of code:

************************
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]
*************************

I get this error:
*WARNING* torque_history.py:399: variable 'm' has no type

during the file generation and it fails with this error:
error: invalid conversion from ‘void*’ to ‘__shedskin__::str*’
error:   initializing argument 1 of ‘V __shedskin__::dict<K,
V>::__getitem__(K) [with K = __shedskin__::str*, V = int]’

in the end during compilation. How should I rewrite that bit?

Cheers, San


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Dufour  
View profile  
 More options Jun 6 2011, 11:23 am
From: Mark Dufour <mark.duf...@gmail.com>
Date: Mon, 6 Jun 2011 17:23:03 +0200
Local: Mon, Jun 6 2011 11:23 am
Subject: Re: variable has no type - ERROR!!

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Jun 6 2011, 12:22 pm
From: Sans <r.santanu....@gmail.com>
Date: Mon, 6 Jun 2011 09:22:03 -0700 (PDT)
Local: Mon, Jun 6 2011 12:22 pm
Subject: Re: variable has no type - ERROR!!
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Dufour  
View profile  
 More options Jun 7 2011, 9:44 am
From: Mark Dufour <mark.duf...@gmail.com>
Date: Tue, 7 Jun 2011 15:44:35 +0200
Local: Tues, Jun 7 2011 9:44 am
Subject: Re: variable has no type - ERROR!!

On Mon, Jun 6, 2011 at 6:22 PM, Sans <r.santanu....@gmail.com> wrote:
> 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!

fun with type inference.. :-) yeah, please send me the whole program, unless
you'd like to try and pinpoint things further..

thanks!
mark.
--
http://www.youtube.com/watch?v=E6LsfnBmdnk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »