Files @ f1f8a2421f92
Branch filter:

Location: OneEye/exp/kerokero/ftp.py - annotation

Laman
updated readme
import os
import ftplib
import logging as log

import config as cfg


def push(path):
	ftp=ftplib.FTP_TLS()
	ftp.connect(cfg.ftp["host"],cfg.ftp["port"])
	ftp.login(cfg.ftp["user"],cfg.ftp["password"])

	filename=os.path.basename(path)

	log.info("uploading %s",path)
	with open(path,mode="rb") as f:
		ftp.storbinary("STOR "+filename,f)

	ftp.close()


if __name__=="__main__":
	push(os.path.join(cfg.thisDir,"ftp.py"))