def upload(host, port, path, file, logconf=None): init_logging(logconf) conf = netfs.init({'server': '{}:{}'.format(host, port), 'cachedir': '.'}) fp = open(file, 'rb') conn = conf.connect() conn.upload(path, fp) conn.commit()
def download(host, port, path, file, logconf=None): init_logging(logconf) conf = netfs.init({'server': '{}:{}'.format(host, port), 'cachedir': '.'}) conf.connect().download(path, file)