Task :: Tools :: Utils :: Utils :: Class Utils
[hide private]
[frames] | no frames]

Class Utils

source code

    object --+    
             |    
Base.TaskTools --+
                 |
                Utils

Provides utility methods that assist Perk developers in processing accessibility information, but do not touch accessible objects, do output, handle input, manage the LSR system, etc.

Instance Methods [hide private]
string
getColorString(self, val)
Tries to map a given RGB string (if in form "u,u,u") to a nearby color name.
source code
string
convertPOSIXToIANA(self, lang)
Converts a POSIX language string to a IANA language tag following RFC 4646 http://www.ietf.org/rfc/rfc4646.txt, the format recommended for AEOutput device language settings.
source code

Inherited from Base.TaskTools: __init__, close, init, postClose, postExecute, preExecute, preInit

Inherited from Base.TaskTools (private): _changeDefaultOutput

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getColorString(self, val)

source code 

Tries to map a given RGB string (if in form "u,u,u") to a nearby color name.

Parameters:
  • val (string) - Representation of an RGB color in form "u,u,u"
Returns: string
Localized color name if val param is valid format, otherwise None

convertPOSIXToIANA(self, lang)

source code 

Converts a POSIX language string to a IANA language tag following RFC 4646 http://www.ietf.org/rfc/rfc4646.txt, the format recommended for AEOutput device language settings.

The POSIX format is language[_territory][.codeset]

Some examples include "en", "fr_CA", "en_US.UTF-8". Ambiguous conversions such as "zh_CN" are allowed, but do not pinpoint specific spoken dialects (i.e. Mandarin, Cantonese, Pinyin, Taiwanese Mandarin, etc.) The code set is currently ignored, though may serve as a hint for the dialect in the future.

Parameters:
  • lang (string) - POSIX locale string
Returns: string
IANA language tag