You Are Here:

Community: Developer Discussion Boards

#1 Old Problem with running sample code (from wiki) on ver 1.9.4 of pys60 - 2009-04-28, 20:33

Join Date: Oct 2005
Posts: 10
vik_nuckchady
Offline
Registered User
Hi,

i am trying to run the code at http://wiki.forum.nokia.com/index.ph...he_view_finder on an N95 and it is giving the following error the script is executed:

Quote:
File "launcher.py", line 37, in <module>
execfile('default.py', default_namespace)
File "default.py", line 40, in <module>
class Camera( object, appuifw.Canvas ):
TypeError: Error when calling the metaclass bases
Cannot create a consistent method resolution order (MRO) for bases Canvas, object
Would anyone have an idea about how i can solve this problem ? I have only one version of python running on the phone according to the programs manager.

Thanks in advance
vik
Last edited by vik_nuckchady : 2009-04-28 at 23:58.
Reply With Quote

#2 Old Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60 - 2009-04-28, 21:30

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Hi,

That problem can be solved by removing "object" from the Camera class constructor. This line
Code:
class Camera( object, appuifw.Canvas ):
becomes
Code:
class Camera( appuifw.Canvas ):
Reply With Quote

#3 Old Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60 - 2009-04-28, 21:44

Join Date: Oct 2005
Posts: 10
vik_nuckchady
Offline
Registered User
Thanks Bogdan for the prompt reply.

Could you tell me why removing 'object' solves the problem ? Is it that Canvas is already an 'object' in this case and, making Camera an object as well in addition to inheriting from Canvas is causing the MRO ? I do understand the reason behind of the TypeError (i.e the MRO) but, i fail to understand the cause of it in this case.

Thanks again
Reply With Quote

#4 Old Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60 - 2009-04-28, 21:56

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
To be honest, I'm not sure. This was the first time I encountered this error so I did a bit of searching with Google and found out it had to do with inheritance, though I wasn't able to understand exactly how. So I just took a shot and deleted "object" from the constructor and, luckily, it worked.

I did find this lengthy article though, which may explain it:
http://www.python.org/download/releases/2.3/mro/
Reply With Quote

#5 Old Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60 - 2009-04-28, 22:20

Join Date: Oct 2005
Posts: 10
vik_nuckchady
Offline
Registered User
Hi again Bogdan,

I am suspecting that newer version of the Python runtime for S60 is employing different mechanism for implementing inheritance much like it has been for python 2.2 -> 2.3 (?)

Well, thanks again. Hopefully some answer will pop up in the near future

Cheers
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem running the TextMTM sample dingdongvan General Symbian C++ 6 2004-04-19 11:54
breakpoints disabled when running debugger. nawkboy General Symbian C++ 2 2003-11-14 01:01
breakpoints disabled when running debugger nawkboy Symbian Tools & SDKs 0 2003-02-20 04:43
problem with Nokia Toolkit 3.1 and binary code for MMS alinesimon General Messaging 1 2002-08-09 07:40
Problem running the TextMTM sample dingdongvan General Messaging 1 1970-01-01 02:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia