×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    Problem with running sample code (from wiki) on ver 1.9.4 of pys60

    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:

    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 22:58.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60

    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 ):

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60

    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

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60

    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/

  5. #5
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    Re: Problem with running sample code (from wiki) on ver 1.9.4 of pys60

    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

Similar Threads

  1. breakpoints disabled when running debugger.
    By nawkboy in forum Symbian
    Replies: 4
    Last Post: 2012-05-31, 10:45
  2. Problem running the TextMTM sample
    By dingdongvan in forum Symbian
    Replies: 6
    Last Post: 2004-04-19, 10:54
  3. breakpoints disabled when running debugger
    By nawkboy in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-02-20, 03:43
  4. problem with Nokia Toolkit 3.1 and binary code for MMS
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-08-09, 06:40
  5. Problem running the TextMTM sample
    By dingdongvan in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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