$ python --version Python 2.7.3 |
$ sudo apt install python-pip $ sudo pip install dropbox |
$ sudo apt-get install python3-pip $ sudo pip install dropbox |
$ ls -l dropbox-2.2.0/example total 44 -rwxr-xr-x 1 pi pi 10091 Apr 25 07:23 cli_client.py → クライアント プログラム -rwxr-xr-x 1 pi pi 4253 Sep 19 2014 copy_between_accounts.py drwxr-xr-x 2 pi pi 4096 Apr 25 07:21 datastore_app drwxr-xr-x 4 pi pi 4096 Apr 25 07:21 flask_app -rwxr-xr-x 1 pi pi 1215 Sep 19 2014 oauth1_upgrade.py -rwxr-xr-x 1 pi pi 8863 Sep 19 2014 search_cache.py |
# XXX Fill in your consumer key and secret
below # You can find these at http://www.dropbox.com/developers/apps APP_KEY = 'ron0m5ovj8vq9f7' # GuidoFullAccessApp APP_SECRET = 'ussirz6zlo6s6x6' |
$ python dropbox-2.2.0/example/cli_client.py Dropbox> login_oauth1 /usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning 1. Go to: https://www.dropbox.com/1/oauth/authorize?oauth_token=XXXXXXXXXXXX 2. Click "Allow" (you might have to log in first). 3. Press ENTER. |
Dropbox> ls → クラウド上のファイル一覧を表示 out2.jpg Dropbox> get out2.jpg /tmp/out2.jpg → クラウドからローカルにファイルをダウンロード Metadata: {u'revision': 443, u'bytes': 64665, u'thumb_exists': True, u'rev': u'1bb35162150', u'modified': u'Fri, 24 Apr 2015 22:54:43 +0000', u'mime_type': u'image/jpeg', u'path': u'/out2.jpg', u'is_dir': False, u'size': u'63.1 KB', u'root': u'app_folder', u'client_mtime': u'Fri, 24 Apr 2015 22:54:43 +0000', u'icon': u'page_white_picture'} Dropbox> rm out2.jpg → クラウド上のファイルを削除 Dropbox> ls Dropbox> put /tmp/out2.jpg out2.jpg → ローカルからクラウドにファイルをアップ ロード Dropbox> ls out2.jpg Dropbox> logout → ログアウト Dropbox> exit |
$ python dropbox-2.2.0/example/cli_client.py Dropbox> login_oauth1 /usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning 1. Go to: https://www.dropbox.com/1/oauth/authorize?oauth_token=XXXXXXXXXXXX 2. Click "Allow" (you might have to log in first). 3. Press ENTER. Dropbox> ls out2.jpg Dropbox> exit → ログインしたまま終了 $ python dropbox-2.2.0/example/cli_client.py [loaded OAuth 1 access token] Dropbox> ls → いきなり使える /usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning out2.jpg Dropbox> |