[nvda-addons] Re: Getting somewhere!

  • From: "Damien Sykes-Pendleton" <damien@xxxxxxxxxxxxxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Sun, 17 Apr 2016 12:31:15 +0100

Hi,
OK then, here goes.
Thanks.
Kind regards,
Damien.
-----Original Message----- From: James Scholes
Sent: Sunday, April 17, 2016 12:22 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Getting somewhere!

Damien Sykes-Pendleton wrote:

I wasn’t sure whether you could or not, that’s why, given the fact that
I’m guessing I’m the only person on here who uses the application for
which it’s intended.
I’m also not sure whether I should send it as part of the email, or as a
download link etc.

We don't really need to use the application in question to give you a
code review.  Send it through as an attachment and we'll take a look.
--
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx import appModuleHandler
import ui

class AppModule(appModuleHandler.AppModule):
def parse_relevant_info(self, text):
 info=text.split("\n")
 text=""
 full_name=info[len(info)-1]
 pos=info.index("B:")
 info=info[pos+3:len(info)]
 while len(info)<3:
  info.append("Unknown")
 birth=info[0]
 marriage=info[1]
 death=info[2]
 if birth=="" or birth=="B:" or birth=="M:" or birth=="D:" or
birth==full_name:
  birth="Unknown"
 if marriage=="" or marriage=="B:" or marriage=="M:" or marriage=="D:" or
marriage==full_name or marriage==birth:
  marriage="Unknown"
 if death=="" or death=="B:" or death=="M:" or death=="D:" or
death==full_name or death==birth or death==marriage:
  death="Unknown"
 text="Born: "+birth+". Married: "+marriage+". Died: "+death+"."
 return text

def event_gainFocus(self, obj, nextHandler):
 if obj.windowControlID==271:
  obj.description=self.parse_relevant_info(obj.parent.parent.parent.descrip
tion)
  ui.message(obj.name+": "+obj.description)
 else:
  nextHandler()

Other related posts: