예제 #1
0
 def test_upload_small(self):
     conn = DropboxConnection(email, password)
     conn.upload_file("small_test_file.txt","/","small_test_file.txt")
예제 #2
0
def upload_file(local_file,remote_dir,remote_file,email,password):
    """ Upload a local file to Dropbox """
    
    conn = DropboxConnection(email, password)
    conn.upload_file(local_file,remote_dir,remote_file)
예제 #3
0
from getpass import getpass

email = raw_input("Enter Dropbox email address:")
password = getpass("Enter Dropbox password:"******"small_test_file.txt","w")
fh.write("Small test file")
fh.close()

try:
    # Create the connection
    conn = DropboxConnection(email, password)
    
    # Upload the file
    conn.upload_file("small_test_file.txt","/","small_test_file.txt")
except:
    print("Upload failed")
else:
    print("Uploaded small_test_file.txt to the root of your Dropbox")
########NEW FILE########
__FILENAME__ = test
from dbupload import upload_file, DropboxConnection
from getpass import getpass
import unittest
import mechanize

# This won't function until these variables are set to valid credentials
email = ""
password = ""