-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsteve.py
More file actions
26 lines (23 loc) · 891 Bytes
/
steve.py
File metadata and controls
26 lines (23 loc) · 891 Bytes
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
from fabric.api import run, sudo, local, cd, env
from fabric.operations import put, get, prompt
from fabric.contrib.files import exists, append
from fabric.context_managers import settings
from fabric.api import env
import time
import os
def install():
"""Installs your bittorrent client on a fresh Ubuntu 12.04"""
sudo('apt-get update')
sudo('apt-get install -y python-pip python-dev build-essential git')
run('git clone https://github.com/phsteve/bt.git bt')
with cd('bt'):
sudo('pip install -r requirements.txt')
def torrentfile(torrentfile):
"""What to do with the local torrent file"""
#This version copies the torrent file to the ubuntu home directy
put(os.path.basename(torrentfile), 'bt/test.torrent')
def download():
"""Code to download """
# after the torrent file
with cd('bt'):
run('time python bt.py test.torrent')