mirror of https://github.com/scrapy/scrapy.git
spelling: instanciated -> instantiated
This commit is contained in:
parent
d7fbccdff7
commit
292d21ca86
|
|
@ -170,7 +170,7 @@ class XPathItemLoader(ItemLoader):
|
|||
def __init__(self, *a, **kw):
|
||||
import warnings
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
warnings.warn('%s is deprecated, instanciate scrapy.contrib.loader.ItemLoader '
|
||||
warnings.warn('%s is deprecated, instantiate scrapy.contrib.loader.ItemLoader '
|
||||
'instead' % type(self).__name__,
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
super(XPathItemLoader, self).__init__(*a, **kw)
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ class XPathSelector(Selector):
|
|||
def __init__(self, *a, **kw):
|
||||
import warnings
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
warnings.warn('%s is deprecated, instanciate scrapy.selector.Selector '
|
||||
warnings.warn('%s is deprecated, instantiate scrapy.selector.Selector '
|
||||
'instead' % type(self).__name__,
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
super(XPathSelector, self).__init__(*a, **kw)
|
||||
|
||||
def css(self, *a, **kw):
|
||||
raise RuntimeError('.css() method not available for %s, '
|
||||
'instanciate scrapy.selector.Selector '
|
||||
'instantiate scrapy.selector.Selector '
|
||||
'instead' % type(self).__name__)
|
||||
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class XPathSelectorList(SelectorList):
|
|||
def __init__(self, *a, **kw):
|
||||
import warnings
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
warnings.warn('XPathSelectorList is deprecated, instanciate '
|
||||
warnings.warn('XPathSelectorList is deprecated, instantiate '
|
||||
'scrapy.selector.SelectorList instead',
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
super(XPathSelectorList, self).__init__(*a, **kw)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class WarnWhenSubclassedTest(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
str(msg.message),
|
||||
"scrapy.tests.test_utils_deprecate.Deprecated is deprecated, "
|
||||
"instanciate scrapy.tests.test_utils_deprecate.NewName instead."
|
||||
"instantiate scrapy.tests.test_utils_deprecate.NewName instead."
|
||||
)
|
||||
self.assertEqual(msg.lineno, lineno)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ def create_deprecated_class(name, new_class, clsdict=None,
|
|||
"deprecated class {old}, please inherit "\
|
||||
"from {new}.",
|
||||
instance_warn_message="{cls} is deprecated, "\
|
||||
"instanciate {new} instead."):
|
||||
"instantiate {new} instead."):
|
||||
"""
|
||||
Return a "deprecated" class that causes its subclasses to issue a warning.
|
||||
Subclasses of ``new_class`` are considered subclasses of this class.
|
||||
It also warns when the deprecated class is instanciated, but do not when
|
||||
its subclasses are instanciated.
|
||||
It also warns when the deprecated class is instantiated, but do not when
|
||||
its subclasses are instantiated.
|
||||
|
||||
It can be used to rename a base class in a library. For example, if we
|
||||
have
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ This page shows different usage scenarios for the two new proposed API for popul
|
|||
* {{{__setitem__(field_name, selector_or_value)}}}
|
||||
* set field value
|
||||
* {{{__getitem__(field_name)}}}
|
||||
* return the "computed" value of a field (the one that would be set to the item). returns None if not set.
|
||||
* return the "computed" value of a field (the one that would be set to the item). returns None if not set.
|
||||
* {{{get_item()}}}
|
||||
* return the item populated with the data provided so far
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ This page shows different usage scenarios for the two new proposed API for popul
|
|||
* {{{replace_value(field_name, selector_or_value, **adaptor_args)}}}
|
||||
* replace existing field value
|
||||
* {{{get_value(field_name)}}}
|
||||
* return the "computed" value of a field (the one that would be set to the item). returns None if not set.
|
||||
* return the "computed" value of a field (the one that would be set to the item). returns None if not set.
|
||||
* {{{get_item()}}}
|
||||
* return the item populated with the data provided so far
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ il.add_value('headline', x.x('//h1[@class="headline"]'))
|
|||
|
||||
{{{
|
||||
#!python
|
||||
# Only approach is passing arguments when instanciating the form
|
||||
# Only approach is passing arguments when instantiating the form
|
||||
ia = NewsForm(response, default_unit='cm')
|
||||
ia['width'] = x.x('//p[@class="width"]')
|
||||
}}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue