comparison babel/messages/extract.py @ 560:86524be05b60 trunk

fix docstring for babel.messages.extract() so it mentions the correct return type
author fschwarz
date Sat, 03 Sep 2011 08:31:43 +0000
parents ca203b2af83c
children 1b801a0cb2cb
comparison
equal deleted inserted replaced
559:8831b754f81e 560:86524be05b60
202 def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(), 202 def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),
203 options=None, strip_comment_tags=False): 203 options=None, strip_comment_tags=False):
204 """Extract messages from the given file-like object using the specified 204 """Extract messages from the given file-like object using the specified
205 extraction method. 205 extraction method.
206 206
207 This function returns a list of tuples of the form: 207 This function returns tuples of the form:
208 208
209 ``(lineno, message, comments)`` 209 ``(lineno, message, comments)``
210 210
211 The implementation dispatches the actual extraction to plugins, based on the 211 The implementation dispatches the actual extraction to plugins, based on the
212 value of the ``method`` parameter. 212 value of the ``method`` parameter.
235 :param comment_tags: a list of translator tags to search for and include 235 :param comment_tags: a list of translator tags to search for and include
236 in the results 236 in the results
237 :param options: a dictionary of additional options (optional) 237 :param options: a dictionary of additional options (optional)
238 :param strip_comment_tags: a flag that if set to `True` causes all comment 238 :param strip_comment_tags: a flag that if set to `True` causes all comment
239 tags to be removed from the collected comments. 239 tags to be removed from the collected comments.
240 :return: the list of extracted messages 240 :return: an iterator over ``(lineno, message, comments)`` tuples
241 :rtype: `list` 241 :rtype: `iterator`
242 :raise ValueError: if the extraction method is not registered 242 :raise ValueError: if the extraction method is not registered
243 """ 243 """
244 func = None 244 func = None
245 if ':' in method or '.' in method: 245 if ':' in method or '.' in method:
246 if ':' not in method: 246 if ':' not in method:
Copyright (C) 2012-2017 Edgewall Software