forked from gureckis/collecting_behavioral_data_online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.py
35 lines (31 loc) · 709 Bytes
/
upload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from paramiko import SSHClient
from scp import SCPClient
import os, sys
from config import *
manifest = ['index.html',
'syllabus.html',
'lecture1.html',
'lecture2.html',
'lecture3.html',
'lecture4.html',
'lecture5.html',
'lecture9.html',
'slides.html',
'lectures',
'images',
'files',
'build_site.py',
'LICENSE',
'README.md',
'css',
'js',
'fonts']
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect(HOST,username=USERNAME,password=PASSWORD)
# SCPCLient takes a paramiko transport as its only argument
scp = SCPClient(ssh.get_transport())
print manifest
for item in manifest:
if item is not 'config.py':
scp.put(item, BASEPATH, recursive=True)