diff --git a/docs/topics/api.rst b/docs/topics/api.rst index 1c461a511..52509ffdf 100644 --- a/docs/topics/api.rst +++ b/docs/topics/api.rst @@ -91,7 +91,7 @@ how you :ref:`configure the downloader middlewares provided while constructing the crawler, and it is created after the arguments given in the :meth:`crawl` method. - .. method:: crawl(\*args, \**kwargs) + .. method:: crawl(*args, **kwargs) Starts the crawler by instantiating its spider class with the given ``args`` and ``kwargs`` arguments, while setting the execution engine in diff --git a/docs/topics/contracts.rst b/docs/topics/contracts.rst index 319f577bc..b8b3078c4 100644 --- a/docs/topics/contracts.rst +++ b/docs/topics/contracts.rst @@ -78,7 +78,7 @@ override three methods: .. module:: scrapy.contracts -.. class:: Contract(method, \*args) +.. class:: Contract(method, *args) :param method: callback function to which the contract is associated :type method: function diff --git a/docs/topics/exporters.rst b/docs/topics/exporters.rst index de8b51195..7daf25ab3 100644 --- a/docs/topics/exporters.rst +++ b/docs/topics/exporters.rst @@ -236,7 +236,7 @@ PythonItemExporter XmlItemExporter --------------- -.. class:: XmlItemExporter(file, item_element='item', root_element='items', \**kwargs) +.. class:: XmlItemExporter(file, item_element='item', root_element='items', **kwargs) Exports Items in XML format to the specified file object. @@ -290,7 +290,7 @@ XmlItemExporter CsvItemExporter --------------- -.. class:: CsvItemExporter(file, include_headers_line=True, join_multivalued=',', \**kwargs) +.. class:: CsvItemExporter(file, include_headers_line=True, join_multivalued=',', **kwargs) Exports Items in CSV format to the given file-like object. If the :attr:`fields_to_export` attribute is set, it will be used to define the @@ -323,7 +323,7 @@ CsvItemExporter PickleItemExporter ------------------ -.. class:: PickleItemExporter(file, protocol=0, \**kwargs) +.. class:: PickleItemExporter(file, protocol=0, **kwargs) Exports Items in pickle format to the given file-like object. @@ -343,7 +343,7 @@ PickleItemExporter PprintItemExporter ------------------ -.. class:: PprintItemExporter(file, \**kwargs) +.. class:: PprintItemExporter(file, **kwargs) Exports Items in pretty print format to the specified file object. @@ -363,7 +363,7 @@ PprintItemExporter JsonItemExporter ---------------- -.. class:: JsonItemExporter(file, \**kwargs) +.. class:: JsonItemExporter(file, **kwargs) Exports Items in JSON format to the specified file-like object, writing all objects as a list of objects. The additional ``__init__`` method arguments are @@ -392,7 +392,7 @@ JsonItemExporter JsonLinesItemExporter --------------------- -.. class:: JsonLinesItemExporter(file, \**kwargs) +.. class:: JsonLinesItemExporter(file, **kwargs) Exports Items in JSON format to the specified file-like object, writing one JSON-encoded item per line. The additional ``__init__`` method arguments are passed diff --git a/docs/topics/loaders.rst b/docs/topics/loaders.rst index 5f75ccbff..eb804f1db 100644 --- a/docs/topics/loaders.rst +++ b/docs/topics/loaders.rst @@ -273,7 +273,7 @@ There are several ways to modify Item Loader context values: ItemLoader objects ================== -.. class:: ItemLoader([item, selector, response], \**kwargs) +.. class:: ItemLoader([item, selector, response], **kwargs) Return a new Item Loader for populating the given Item. If no item is given, one is instantiated automatically using the class in @@ -303,7 +303,7 @@ ItemLoader objects :class:`ItemLoader` instances have the following methods: - .. method:: get_value(value, \*processors, \**kwargs) + .. method:: get_value(value, *processors, **kwargs) Process the given ``value`` by the given ``processors`` and keyword arguments. @@ -321,7 +321,7 @@ ItemLoader objects >>> loader.get_value(u'name: foo', TakeFirst(), unicode.upper, re='name: (.+)') 'FOO` - .. method:: add_value(field_name, value, \*processors, \**kwargs) + .. method:: add_value(field_name, value, *processors, **kwargs) Process and then add the given ``value`` for the given field. @@ -343,11 +343,11 @@ ItemLoader objects loader.add_value('name', u'name: foo', TakeFirst(), re='name: (.+)') loader.add_value(None, {'name': u'foo', 'sex': u'male'}) - .. method:: replace_value(field_name, value, \*processors, \**kwargs) + .. method:: replace_value(field_name, value, *processors, **kwargs) Similar to :meth:`add_value` but replaces the collected data with the new value instead of adding it. - .. method:: get_xpath(xpath, \*processors, \**kwargs) + .. method:: get_xpath(xpath, *processors, **kwargs) Similar to :meth:`ItemLoader.get_value` but receives an XPath instead of a value, which is used to extract a list of unicode strings from the @@ -367,7 +367,7 @@ ItemLoader objects # HTML snippet:
the price is $1200
loader.get_xpath('//p[@id="price"]', TakeFirst(), re='the price is (.*)') - .. method:: add_xpath(field_name, xpath, \*processors, \**kwargs) + .. method:: add_xpath(field_name, xpath, *processors, **kwargs) Similar to :meth:`ItemLoader.add_value` but receives an XPath instead of a value, which is used to extract a list of unicode strings from the @@ -385,12 +385,12 @@ ItemLoader objects # HTML snippet:the price is $1200
loader.add_xpath('price', '//p[@id="price"]', re='the price is (.*)') - .. method:: replace_xpath(field_name, xpath, \*processors, \**kwargs) + .. method:: replace_xpath(field_name, xpath, *processors, **kwargs) Similar to :meth:`add_xpath` but replaces collected data instead of adding it. - .. method:: get_css(css, \*processors, \**kwargs) + .. method:: get_css(css, *processors, **kwargs) Similar to :meth:`ItemLoader.get_value` but receives a CSS selector instead of a value, which is used to extract a list of unicode strings @@ -410,7 +410,7 @@ ItemLoader objects # HTML snippet:the price is $1200
loader.get_css('p#price', TakeFirst(), re='the price is (.*)') - .. method:: add_css(field_name, css, \*processors, \**kwargs) + .. method:: add_css(field_name, css, *processors, **kwargs) Similar to :meth:`ItemLoader.add_value` but receives a CSS selector instead of a value, which is used to extract a list of unicode strings @@ -428,7 +428,7 @@ ItemLoader objects # HTML snippet:the price is $1200
loader.add_css('price', 'p#price', re='the price is (.*)') - .. method:: replace_css(field_name, css, \*processors, \**kwargs) + .. method:: replace_css(field_name, css, *processors, **kwargs) Similar to :meth:`add_css` but replaces collected data instead of adding it. @@ -678,7 +678,7 @@ Here is a list of all built-in processors: >>> proc(['one', 'two', 'three']) 'one