mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-27 03:03:47 +00:00
removed deprecated Request.__getitem__ method
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40629
This commit is contained in:
parent
8d1d5102be
commit
8a404c4480
@ -1,5 +1,4 @@
|
||||
import urllib
|
||||
import warnings
|
||||
import hashlib
|
||||
from copy import copy
|
||||
from base64 import urlsafe_b64encode
|
||||
@ -84,10 +83,6 @@ class Request(object):
|
||||
http_pass = ''
|
||||
self.headers['Authorization'] = 'Basic ' + urlsafe_b64encode("%s:%s" % (http_user, http_pass))
|
||||
|
||||
def __getitem__(self, key):
|
||||
warnings.warn("Request tuples have been deprecated, Request objects are now used. Index mappings: 0 -> r.url, 1 -> r.body, 2 -> r.deferred, 3 -> r.options ", DeprecationWarning)
|
||||
return (self.url, self.body, self.deferred, {})[key]
|
||||
|
||||
def __str__(self):
|
||||
if self.method != 'GET':
|
||||
return "<(%s) %s>" % (self.method, self.url)
|
||||
|
Loading…
x
Reference in New Issue
Block a user