From dfb1a5a6a626e310e223f7e5b2ab08b1b348c2f0 Mon Sep 17 00:00:00 2001 From: SevenChords <31819497+SevenChords@users.noreply.github.com> Date: Sun, 19 Jul 2020 19:10:18 +0200 Subject: [PATCH] added Username to config and uploaded filename --- FTPManagement.py | 3 ++- config.txt | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/FTPManagement.py b/FTPManagement.py index 81e43be..37335eb 100644 --- a/FTPManagement.py +++ b/FTPManagement.py @@ -1,6 +1,7 @@ import re from ftplib import FTP from logger import log +from config import getConfig ftp = FTP("ftp.byethost7.com") ftp.login("b7_26300774", "Wxu8dLdV2/") @@ -44,7 +45,7 @@ def testRecord(value): ftp.cwd("htdocs/roadmap/results") if(localRecord <= remoteRecord): with open("results/[" + str(localRecord) + "].txt", "rb") as localFile: - ftp.storlines("STOR %s" % "[" + str(localRecord) + "].txt", localFile) + ftp.storlines("STOR %s" % "[" + str(localRecord) + "]_" + getConfig("Username") + ".txt", localFile) localFile.close() log(1, "FTP", "File", "Upload", "File [" + str(localRecord) + "].txt has been uploaded.") ftp.quit() \ No newline at end of file diff --git a/config.txt b/config.txt index 56913e4..074b8ef 100644 --- a/config.txt +++ b/config.txt @@ -58,3 +58,11 @@ ############################################### # [workerCount = 4] (default: 4) # ############################################### + +############################################### +# Username # +############################################### +# Your username under which your records are # +# Uploaded to the remote server # +# [Username = DefaultUser] # +############################################### \ No newline at end of file