Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User sheadley's Avatar
    Join Date
    Apr 2005
    Posts
    3
    the following application dosen't seem to work. Any help would be appreciated.http://discussion.forum.nokia.com/fo...cons/icon8.gif

    import appuifw
    import e32
    # import messaging

    e32.ao_yield()

    class Configure:
    def __init__(self):
    self.user = u""
    self.password = u""
    self.lock = e32.Ao_lock()
    self.old_title = appuifw.app.title
    appuifw.app.title = u"Configure FIRMS"
    self.exit_flag = None
    appuifw.app.exit_key_handler = self.exit_key_handler
    appuifw.app.body = get_form()
    def get_form(self):
    # Construct the form
    result = [(u"User Name", text, self.user),
    (u"Password", text, self.password)]
    return result
    def exit_key_handler(self):
    self.exit_flag = 1
    self.lock.signal()
    def loop(self):
    try:
    while not self.exit_flag:
    self.lock.wait()
    finally:
    self.close()
    def close(self):
    appuifw.app.menu = []
    appuifw.app.body = None
    appuifw.app.exit_key_handler = None
    appuifw.app.title = self.old_title
    def abort(self):
    # Exit-key handler.
    self.exit_flag = True
    self.lock.signal()
    def refresh(self):
    appuifw.app.body.set(self.user)
    def main():
    try:
    app = Configure()
    app.loop()
    finally:
    app.close()

  2. #2
    Registered User cyke64's Avatar
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352
    First use correct indentation please ;-)
    Then I think that main function is never called , use instead :
    Code:
    if __name__ == '__main__':
        try:
          app = Configure()
          app.loop()
        finally:
          app.close(


    Code:
    import appuifw
    import e32
    # import messaging
    e32.ao_yield()
    
    class Configure:
      def __init__(self):
        self.user = u""
        self.password = u""
        self.lock = e32.Ao_lock()
        self.old_title = appuifw.app.title
        appuifw.app.title = u"Configure FIRMS"
        self.exit_flag = None
        appuifw.app.exit_key_handler = self.exit_key_handler
        appuifw.app.body = get_form()
    
      def get_form(self):
      # Construct the form
        result = [(u"User Name", text, self.user),(u"Password", text, self.password)]
        return result
    
      def exit_key_handler(self):
        self.exit_flag = 1
        self.lock.signal()
    
      def loop(self):
         try:
           while not self.exit_flag:
             self.lock.wait()
         finally:
           self.close()
    
      def close(self):
           appuifw.app.menu = []
           appuifw.app.body = None
           appuifw.app.exit_key_handler = None
           appuifw.app.title = self.old_title
    
      def abort(self):
      # Exit-key handler.
        self.exit_flag = True
        self.lock.signal()
    
      def refresh(self):
        appuifw.app.body.set(self.user)
    
      def main():
        try:
          app = Configure()
          app.loop()
        finally:
          app.close()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved