import appuifw import location import urllib class App: def save_data(self): u = urllib.urlopen("http://crschmidt.net/cell/?n1=%s&n2=%s&l=%s&c=%s&com=%s"%(self.loc[0], self.loc[1], self.loc[2], self.loc[3], urllib.quote(self.form[0][2]))) u.close() def __init__(self): self.loc = location.gsm_location() self.loc_string = unicode(self.loc) fields = [(u'Comment', "text"), (u'Cell info', "text", self.loc_string)] self.form = appuifw.Form(fields, appuifw.FFormDoubleSpaced) self.form.menu = [(u'Send', self.save_data), (u'Update', self.update_form)] def run_form(self): self.form.execute() def update_form(self): self.loc = location.gsm_location() self.loc_string = unicode(self.loc) self.run_form() if __name__ == '__main__': app = App() app.__init__() app.run_form()