diff --git a/exp/kerokero/ftp.py b/exp/kerokero/ftp.py --- a/exp/kerokero/ftp.py +++ b/exp/kerokero/ftp.py @@ -1,17 +1,14 @@ import os -import json import ftplib import logging as log -thisDir=os.path.dirname(__file__) -with open(os.path.join(thisDir,"ftp.json")) as f: - cfg=json.load(f) +import config as cfg def push(path): ftp=ftplib.FTP_TLS() - ftp.connect(cfg["host"],cfg["port"]) - ftp.login(cfg["user"],cfg["password"]) + ftp.connect(cfg.ftp["host"],cfg.ftp["port"]) + ftp.login(cfg.ftp["user"],cfg.ftp["password"]) filename=os.path.basename(path) @@ -23,4 +20,4 @@ def push(path): if __name__=="__main__": - push(os.path.join(thisDir,"ftp.py")) + push(os.path.join(cfg.thisDir,"ftp.py"))