# SYMBIAN_UID = 0x101FF30D __author__ = "Matt Croydon - http://postneo.com" __version__ = "0.1.0" __license__ = "not sure yet." __copyright__ = "Copyright (c) 2005 Matt Croydon. For Lopez." import appuifw import e32 e32.ao_yield() # Rename http://postneo.com/projects/kml/kml-0.0.5.py.txt # kml.py and add it as a library. from kml import Placemark class Lopez: def __init__(self): self.lock = e32.Ao_lock() self.old_title = appuifw.app.title appuifw.app.title = u"Lopez" self.exit_flag = False appuifw.app.exit_key_handler = self.abort self.kmlfile = "C:\\location.kml" self.placemark= Placemark() self.ask_location() #TODO: self.get_location() self.write_kml() def abort(self): # Exit-key handler. self.exit_flag = True self.lock.signal() # Ask the user for lat/lon (placeholder for GPS retreival) def ask_location(self): self.placemark.latitude = appuifw.query(u'Enter Latitude (- for South)', 'text') self.placemark.longitude = appuifw.query(u'Enter Longitude (- for West)', 'text') self.placemark.description = appuifw.query(u'Enter a Note', 'text') def write_kml(self): appuifw.note(u"Saving KML to c:\\location.kml", 'info') f=open(self.kmlfile, "w") f.write(self.placemark.to_string()) f.close() def main(): app = Lopez() if __name__ == "__main__": main()