RE: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Rawlins
Haha, I could use a stiff whisky myself after the stress that caused me :-)

Robert

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Robert Bossy
Sent: 13 March 2008 16:10
To: python-list@python.org
Subject: Re: "Attribute Doesnt Exist" ... but.... it does :-s

Robert Rawlins wrote:
> Hi Guys,
>
> Well thanks for the response, I followed your advice and chopped out all
the
> crap from my class, right down to the bare __init__ and the setter method,
> however, the problem continued to persist.
>
> However, Robert mentioned something about unindented lines which got me
> thinking so I deleted my tab indents on that method and replaces them with
> standard space-bar indents and it appears to have cured the problem.
>   
Aha! Killed the bug at the first guess! You owe me a beer, mate.

RB
-- 
http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Bossy
Robert Rawlins wrote:
> Hi Guys,
>
> Well thanks for the response, I followed your advice and chopped out all the
> crap from my class, right down to the bare __init__ and the setter method,
> however, the problem continued to persist.
>
> However, Robert mentioned something about unindented lines which got me
> thinking so I deleted my tab indents on that method and replaces them with
> standard space-bar indents and it appears to have cured the problem.
>   
Aha! Killed the bug at the first guess! You owe me a beer, mate.

RB
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Michael Wieher
2008/3/13, Robert Rawlins <[EMAIL PROTECTED]>:
>
> Hi Guys,
>
> Well thanks for the response, I followed your advice and chopped out all
> the
> crap from my class, right down to the bare __init__ and the setter method,
> however, the problem continued to persist.
>
> However, Robert mentioned something about unindented lines which got me
> thinking so I deleted my tab indents on that method and replaces them with
> standard space-bar indents and it appears to have cured the problem.
>
> Usually my Eclipse IDE throws up an error about this but for some reason
> decided not too this time around, what a PITA.
>
> Thanks for the ideas guys, I appreciate it.
>
> Robert
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ]
> On Behalf Of Robert Bossy
> Sent: 13 March 2008 15:51
> To: python-list@python.org
> Subject: Re: "Attribute Doesnt Exist" ... but it does :-s
>
> Robert Rawlins wrote:
> >
> > Hello Guys,
> >
> > I've got an awfully aggravating problem which is causing some
> > substantial hair loss this afternoon J I want to get your ideas on
> > this. I am trying to invoke a particular method in one of my classes,
> > and I'm getting a runtime error which is telling me the attribute does
> > not exist.
> >
> > I'm calling the method from within __init__ yet it still seems to
> > think it doesn't exist.
> >
> > Code:
> >
> > # Define the RemoteDevice class.
> >
> > class *remote_device*:
> >
> > # I'm the class constructor method.
> >
> > def *__init__*(/self/, message_list=/""/):
> >
> > /self/.set_pending_list(message_list)
> >
> > def *set_pending_list*(/self/, pending_list):
> >
> > # Set the message list property.
> >
> > /self/.pending_list = message_list
> >
> > And the error message which I receive during the instantiation of the
> > class:
> >
> > File: "/path/to/my/files/remote_device.py", line 22, in __init__
> >
> > self.set_pending_list(message_list)
> >
> > AttributeError: remote_device instance has no attribute
> 'set_pending_list'
> >
> > Does anyone have the slightest idea why this might be happening? I can
> > see that the code DOES have that method in it, I also know that I
> > don't get any compile time errors so that should be fine. I know it
> > mentions line 22 in the error, but I've chopped out a load of non
> > relevant code for the sake of posting here.
> >
> Hi,
> I don't get this error if I run your code. Maybe the irrelevant code
> causes the error: my guess is that there's a parenthesis mismatch or an
> undeindented line.
>
> Btw, calls to set_pending_list will fail since the name "message_list"
> is not defined in its scope. Please follow Chris Mellon's advice.
>
> Cheers,
> RB
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list




All the more reason to use VIM and set it to auto-indent / remove 4 spaces
with tab & backspace. =)
-- 
http://mail.python.org/mailman/listinfo/python-list

RE: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Rawlins
Hi Guys,

Well thanks for the response, I followed your advice and chopped out all the
crap from my class, right down to the bare __init__ and the setter method,
however, the problem continued to persist.

However, Robert mentioned something about unindented lines which got me
thinking so I deleted my tab indents on that method and replaces them with
standard space-bar indents and it appears to have cured the problem.

Usually my Eclipse IDE throws up an error about this but for some reason
decided not too this time around, what a PITA.

Thanks for the ideas guys, I appreciate it.

Robert

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Robert Bossy
Sent: 13 March 2008 15:51
To: python-list@python.org
Subject: Re: "Attribute Doesnt Exist" ... but.... it does :-s

Robert Rawlins wrote:
>
> Hello Guys,
>
> I've got an awfully aggravating problem which is causing some 
> substantial hair loss this afternoon J I want to get your ideas on 
> this. I am trying to invoke a particular method in one of my classes, 
> and I'm getting a runtime error which is telling me the attribute does 
> not exist.
>
> I'm calling the method from within __init__ yet it still seems to 
> think it doesn't exist.
>
> Code:
>
> # Define the RemoteDevice class.
>
> class *remote_device*:
>
> # I'm the class constructor method.
>
> def *__init__*(/self/, message_list=/""/):
>
> /self/.set_pending_list(message_list)
>
> def *set_pending_list*(/self/, pending_list):
>
> # Set the message list property.
>
> /self/.pending_list = message_list
>
> And the error message which I receive during the instantiation of the 
> class:
>
> File: "/path/to/my/files/remote_device.py", line 22, in __init__
>
> self.set_pending_list(message_list)
>
> AttributeError: remote_device instance has no attribute 'set_pending_list'
>
> Does anyone have the slightest idea why this might be happening? I can 
> see that the code DOES have that method in it, I also know that I 
> don't get any compile time errors so that should be fine. I know it 
> mentions line 22 in the error, but I've chopped out a load of non 
> relevant code for the sake of posting here.
>
Hi,
I don't get this error if I run your code. Maybe the irrelevant code 
causes the error: my guess is that there's a parenthesis mismatch or an 
undeindented line.

Btw, calls to set_pending_list will fail since the name "message_list" 
is not defined in its scope. Please follow Chris Mellon's advice.

Cheers,
RB
-- 
http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Bossy
Robert Rawlins wrote:
>
> Hello Guys,
>
> I’ve got an awfully aggravating problem which is causing some 
> substantial hair loss this afternoon J I want to get your ideas on 
> this. I am trying to invoke a particular method in one of my classes, 
> and I’m getting a runtime error which is telling me the attribute does 
> not exist.
>
> I’m calling the method from within __init__ yet it still seems to 
> think it doesn’t exist.
>
> Code:
>
> # Define the RemoteDevice class.
>
> class *remote_device*:
>
> # I'm the class constructor method.
>
> def *__init__*(/self/, message_list=/""/):
>
> /self/.set_pending_list(message_list)
>
> def *set_pending_list*(/self/, pending_list):
>
> # Set the message list property.
>
> /self/.pending_list = message_list
>
> And the error message which I receive during the instantiation of the 
> class:
>
> File: “/path/to/my/files/remote_device.py", line 22, in __init__
>
> self.set_pending_list(message_list)
>
> AttributeError: remote_device instance has no attribute 'set_pending_list'
>
> Does anyone have the slightest idea why this might be happening? I can 
> see that the code DOES have that method in it, I also know that I 
> don’t get any compile time errors so that should be fine. I know it 
> mentions line 22 in the error, but I’ve chopped out a load of non 
> relevant code for the sake of posting here.
>
Hi,
I don't get this error if I run your code. Maybe the irrelevant code 
causes the error: my guess is that there's a parenthesis mismatch or an 
undeindented line.

Btw, calls to set_pending_list will fail since the name "message_list" 
is not defined in its scope. Please follow Chris Mellon's advice.

Cheers,
RB
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Chris Mellon
On Thu, Mar 13, 2008 at 10:36 AM, Robert Rawlins
<[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hello Guys,
>
>
>
> I've got an awfully aggravating problem which is causing some substantial
> hair loss this afternoon J I want to get your ideas on this. I am trying to
> invoke a particular method in one of my classes, and I'm getting a runtime
> error which is telling me the attribute does not exist.
>
>
>
> I'm calling the method from within __init__ yet it still seems to think it
> doesn't exist.
>
>
>
> Code:
>
>
>
> # Define the RemoteDevice class.
>
> class remote_device:
>
>
>
> # I'm the class constructor method.
>
> def __init__(self, message_list=""):
>
> self.set_pending_list(message_list)
>
>
>
> def set_pending_list(self, pending_list):
>
> # Set the message list property.
>
> self.pending_list = message_list
>
>
>
> And the error message which I receive during the instantiation of the class:
>
>
>
> File: "/path/to/my/files/remote_device.py", line 22, in __init__
>
> self.set_pending_list(message_list)
>
> AttributeError: remote_device instance has no attribute 'set_pending_list'
>
>
>
> Does anyone have the slightest idea why this might be happening? I can see
> that the code DOES have that method in it, I also know that I don't get any
> compile time errors so that should be fine. I know it mentions line 22 in
> the error, but I've chopped out a load of non relevant code for the sake of
> posting here.
>
>
>
> Perhaps I'm missing something really simple, but it's got my head spinning.
>

Create a copy of your source file, confirm that it shows the problem,
and start chopping out lines until all that is left is what you pasted
here. See if it still shows the problem. If it does, and if you
haven't found the problem yet, post again, attaching (not pasting
inline) your chopped down file.
-- 
http://mail.python.org/mailman/listinfo/python-list