Beispiel #1
0
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()
Beispiel #2
0
def download(host, port, path, file, logconf=None):
    init_logging(logconf)
    conf = netfs.init({'server': '{}:{}'.format(host, port), 'cachedir': '.'})
    conf.connect().download(path, file)