def connect(self):
for tryed_connection_count in range(CFG_FTP_CONNECTION_ATTEMPTS):<EOL><INDENT>try:<EOL><INDENT>self.ftp = FtpHandler(self.config.SPRINGER.URL,<EOL>self.config.SPRINGER.LOGIN,<EOL>self.config.SPRINGER.PASSWORD)<EOL>self.logger.debug(("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>return<EOL><DEDENT>except socket_timeout_exception as err:<EOL><INDENT>self.logger.error(('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>% (tryed_connection_count+<NUM_LIT:1>,<EOL>CFG_FTP_CONNECTION_ATTEMPTS,<EOL>CFG_FTP_TIMEOUT_SLEEP_DURATION))<EOL>time.sleep(CFG_FTP_TIMEOUT_SLEEP_DURATION)<EOL><DEDENT>except Exception as err:<EOL><INDENT>self.logger.error(("<STR_LIT>"<EOL>"<STR_LIT>") % (err,))<EOL>break<EOL><DEDENT><DEDENT>raise LoginException(err)<EOL>
Logs into the specified ftp server and returns connector.