changeset 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 838ba3796ad6
children e61e27d9347d
files babel/support.py babel/tests/support.py
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/babel/support.py
+++ b/babel/support.py
@@ -524,14 +524,13 @@
 
     DEFAULT_DOMAIN = 'messages'
 
-    def __init__(self, fileobj=None, domain=None):
+    def __init__(self, fp=None, domain=None):
         """Initialize the translations catalog.
 
-        :param fileobj: the file-like object the translation should be read
-                        from
+        :param fp: the file-like object the translation should be read from
         :param domain: the message domain (default: 'messages')
         """
-        super(Translations, self).__init__(fp=fileobj)
+        super(Translations, self).__init__(fp=fp)
         self.domain = domain or self.DEFAULT_DOMAIN
 
     @classmethod
--- a/babel/tests/support.py
+++ b/babel/tests/support.py
@@ -170,7 +170,7 @@
         fp = StringIO()
         write_mo(fp, Catalog(locale='de'))
         fp.seek(0)
-        self.translations = support.Translations(fileobj=fp)
+        self.translations = support.Translations(fp=fp)
         self.null_translations = support.NullTranslations(fp=fp)
     
     def method_names(self):
Copyright (C) 2012-2017 Edgewall Software