# import useful modules for Perks
import Perk, Task
#from POR import POR
#from i18n import _

class EirikurPerk(Perk.Perk):
  def init(self):
    self.registerEventTask(HandleSelectorChange(self))
    
class HandleSelectorChange(Task.SelectorTask):
  def executeActive(self, por, **kwargs):
    print 
    print "IAccessibleInfo new method tests:" 
    print '  floatvalue:', self.getAccFloatValue()
    print '  floatvalueextents:', self.getAccFloatValueExtents()

    print '  DefTextAttrs:'
    retdict = self.getAccDefTextAttrs()
    if retdict != None:
      for key in retdict:
        print "    "+key+" : "+retdict[key]
    else:
        print "    None"
    print '  TextSelection:', self.getAccTextSelection()

    the_text = self.getAccText()
    if the_text == None:
      the_text = "None"
    else:
      the_text = the_text.strip()
    print '  AccText():', the_text

##     print '  AccText(0,10):', self.getAccText(0,10)
##     print '  AccText:(start=2,end=9)', self.getAccText(start=2,end=9)
##     print '  AccText(0,-1):', self.getAccText(0,-1)
    
    print '  TableExtents:', self.getAccTableExtents()
    print '  Locale:', self.getAccAppLocale()
    
##     try:
##       print self.getAccAttrs(), '<-- AccAttrs'
##     except:
##       pass
    print

    return True

