You Are Here:

Community: Developer Discussion Boards

#1 Old object has no attribute 'gsm_location' - 2006-07-26, 03:23

Join Date: Jul 2006
Posts: 7
nokiameister
Offline
Registered User
I'm trying to get Location.py to work, which basically notifies you when you are returning to the cellid you have been when starting the script.

I always get the following error when trying to run the script:

line 31, in run
(self.mcc, self.mnc, self.lac, self.cellid) = location.gsm_location()
AttributeError: 'module'
object has no
attribute 'gsm_location'

This happens on the phone as well as in the emulator!

Here is the content of the script:

Code:
import location
import appuifw
import e32
import messaging
from graphics import *
appuifw.app.screen='large'
GraphBody=appuifw.app.body=canvas=appuifw.Canvas(
        event_callback=None,redraw_callback=None) 
GraphCanvas=Image.new(canvas.size)             
class Location_Test:
    def __init__(self):
        self.exitflag = 0
        self.old_app_body=appuifw.app.body
        appuifw.app.exit_key_handler=self.set_exit
        self.CreateMainMenu()
    def set_exit(self):
        appuifw.app.body = self.old_app_body
        self.exitflag=1
    def CreateMainMenu(self):
        appuifw.app.menu = [(u'Quit',self.set_exit)]
    def run(self):
        firstaccess =1  
        ActualBaseStation=u''
        HomeZone=u''
        def PaintCanvas():
            GraphCanvas.clear(230)
            GraphCanvas.text((50,20),u'Localization:',0xffff00)
            GraphCanvas.text((5,40),u'HomeZone: '+HomeZone,0xffffff)
            GraphCanvas.text((5,60),u'Actual BS: '+ActualBaseStation,0xffffff)  
        while not self.exitflag:
            (self.mcc, self.mnc, self.lac, self.cellid) = location.gsm_location()
            temp_BS=str(self.mcc)+str(self.mnc)+str(self.lac)+str(self.cellid)
            if firstaccess:
                HomeZone=temp_BS
                ActualBaseStation=temp_BS  
                firstaccess=0 
                PaintCanvas()
            else:
                if (temp_BS <> ActualBaseStation):
                    ActualBaseStation=temp_BS
                    if(ActualBaseStation==HomeZone):
                        messaging.sms_send('+393803320180',u'SMS BODY')
                        appuifw.note(u'SMS sent','info')
                    PaintCanvas()
            canvas.blit(GraphCanvas)
            e32.ao_sleep(20)
lapp=Location_Test()
lapp.run()
I really tried to figure out what's wrong, but I can't find anything that's wrong!

Thanks in advance!!
Reply With Quote

#2 Old Re: object has no attribute 'gsm_location' - 2006-07-26, 04:49

Join Date: Jul 2006
Posts: 7
nokiameister
Offline
Registered User
I first thought this was due to some problems with libraries, but I found out that the problem was the name of the scripts!
camera.py didn't work, it threw a similar error, but when i changed the name, it worked.
The same for Location.py.

I found scripts with the same names that were installed as libraries on the phone, obviously there was some interferring.
Last edited by nokiameister : 2006-07-26 at 17:17.
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
active object call inside another active object maina1976 General Symbian C++ 4 2008-08-25 14:05
Testing an Active Object? (With attached code from two attempts) nawkboy General Symbian C++ 2 2007-10-05 21:40
Problem with service attribute propagation and service attribute retrieval pfrey Bluetooth Technology 4 2006-09-05 16:15
E32User-Cbase 46 panic when terminating long running active object delwynh General Symbian C++ 2 2003-09-01 23:15
helpthe problem of active object in Dial program--- "E32user-CBase" 49 jianwending2000 General Symbian C++ 1 2002-08-28 10:12

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