comparison babel/support.py @ 599:33c8c68b96c7 trunk

change constructor for babel.support.Translations to __init__(fp=None, domain=None) as its super class gettext.GNUTranslations uses "fp" as well (even if "fileobj" is a better name)
author fschwarz
date Mon, 20 Aug 2012 19:34:42 +0000
parents 92e3eb0a317a
children 60f716236946
comparison
equal deleted inserted replaced
598:838ba3796ad6 599:33c8c68b96c7
522 class Translations(NullTranslations, gettext.GNUTranslations): 522 class Translations(NullTranslations, gettext.GNUTranslations):
523 """An extended translation catalog class.""" 523 """An extended translation catalog class."""
524 524
525 DEFAULT_DOMAIN = 'messages' 525 DEFAULT_DOMAIN = 'messages'
526 526
527 def __init__(self, fileobj=None, domain=None): 527 def __init__(self, fp=None, domain=None):
528 """Initialize the translations catalog. 528 """Initialize the translations catalog.
529 529
530 :param fileobj: the file-like object the translation should be read 530 :param fp: the file-like object the translation should be read from
531 from
532 :param domain: the message domain (default: 'messages') 531 :param domain: the message domain (default: 'messages')
533 """ 532 """
534 super(Translations, self).__init__(fp=fileobj) 533 super(Translations, self).__init__(fp=fp)
535 self.domain = domain or self.DEFAULT_DOMAIN 534 self.domain = domain or self.DEFAULT_DOMAIN
536 535
537 @classmethod 536 @classmethod
538 def load(cls, dirname=None, locales=None, domain=None): 537 def load(cls, dirname=None, locales=None, domain=None):
539 """Load translations from the given directory. 538 """Load translations from the given directory.
Copyright (C) 2012-2017 Edgewall Software