mirror of https://github.com/scrapy/scrapy.git
Use kwargs-only parameters in `ftp_store_file`
This commit is contained in:
parent
8ea8f14827
commit
06ab668ec7
|
|
@ -175,9 +175,9 @@ class FTPFeedStorage(BlockingFeedStorage):
|
|||
|
||||
def _store_in_thread(self, file):
|
||||
ftp_store_file(
|
||||
self.path, file, self.host,
|
||||
self.port, self.username,
|
||||
self.password, self.use_active_mode
|
||||
path=self.path, file=file, host=self.host,
|
||||
port=self.port, username=self.username,
|
||||
password=self.password, use_active_mode=self.use_active_mode
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -269,9 +269,9 @@ class FTPFilesStore(object):
|
|||
def persist_file(self, path, buf, info, meta=None, headers=None):
|
||||
path = '%s/%s' % (self.basedir, path)
|
||||
return threads.deferToThread(
|
||||
ftp_store_file, path,buf,
|
||||
self.host, self.port,self.username,
|
||||
self.password, self.USE_ACTIVE_MODE
|
||||
ftp_store_file, path=path, file=buf,
|
||||
host=self.host, port=self.port, username=self.username,
|
||||
password=self.password, use_active_mode=self.USE_ACTIVE_MODE
|
||||
)
|
||||
|
||||
def stat_file(self, path, info):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def ftp_makedirs_cwd(ftp, path, first_call=True):
|
|||
ftp.cwd(path)
|
||||
|
||||
def ftp_store_file(
|
||||
path, file, host, port,
|
||||
*, path, file, host, port,
|
||||
username, password, use_active_mode=False):
|
||||
"""Opens a FTP connection with passed credentials,sets current directory
|
||||
to the directory extracted from given path, then uploads the file to server
|
||||
|
|
|
|||
Loading…
Reference in New Issue