Package DateHandler :: Module _DateHandler
[frames] | no frames]

Module _DateHandler

source code

Class handling language-specific selection for date parser and displayer.

Functions
 
register_datehandler(locales, parse_class, display_class)
Registers the passed date parser class and date displayer classes with the specfied language locales.
source code
Variables
  log = logging.getLogger(".DateHandler")
  LANG = 'en_GB'
  LANG_SHORT = 'en'
  LANG_TO_PARSER = {'C': DateParser, 'en': DateParser, 'English_...
  LANG_TO_DISPLAY = {'C': DateDisplayEn, 'en': DateDisplayEn, 'E...

Imports: locale, logging, DateParser, DateDisplay, DateDisplayEn


Function Details

register_datehandler(locales, parse_class, display_class)

source code 

Registers the passed date parser class and date displayer classes with the specfied language locales.

Parameters:
  • locales (tuple) - tuple of strings containing language codes. The character encoding is not included, so the langauge should be in the form of fr_FR, not fr_FR.utf8
  • parse_class (DateParse) - Class to be associated with parsing
  • display_class (DateDisplay) - Class to be associated with displaying

Variables Details

LANG_TO_PARSER

Value:
{'C': DateParser, 'en': DateParser, 'English_United States': DateParse\
r,}

LANG_TO_DISPLAY

Value:
{'C': DateDisplayEn, 'en': DateDisplayEn, 'English_United States': Dat\
eDisplayEn, 'zh_CN': DateDisplay, 'zh_TW': DateDisplay, 'zh_SG': DateD\
isplay, 'zh_HK': DateDisplay, 'ja_JP': DateDisplay, 'ko_KR': DateDispl\
ay,}