Package bootlegger :: Module api :: Class BootLegger
[hide private]
[frames] | no frames]

Class BootLegger

source code

object --+
         |
        BootLegger

The base class for interacting with speakeasy

Instance Methods [hide private]
 
__init__(self, username, pubkey, privkey, host=DEFAULT_HOST, password='', auth=True)
username is the username of the speakeasy user pubkey is the user's public key as a string privkey is the user's private key as a string host is the host that speakeasy is running on (default is localhost) password is the password for the private key (default to blank / no password) auth determines whether to connect and authenticate immediately (default to true)
source code
 
authenticate(self)
Authenticate to speakeasy.
source code
 
upload(self, fname, rname=None)
Encrypt and upload the file given by fname to the server.
source code
 
download(self, fname, lname=None)
Download and decrypt the file given by fname from the server.
source code
 
list_files(self, pattern=None)
Get a list of the names of the files stored on the server.
source code
 
get_info(self, fname)
Get more detailed information about the file called fname from the server.
source code
 
share(self, fname, recipient)
Share a file called fname stored on the server with the recipient
source code
 
versions(self, fname)
Get the dates of previous modifications to the file.
source code
 
delete(self, fname)
Delete a file from the server.
source code
 
get_pubkey(self, username)
Get the public key of a user.
source code
 
_real_auth(self) source code
 
add_pubkey(self)
Add a public key to the server.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, username, pubkey, privkey, host=DEFAULT_HOST, password='', auth=True)
(Constructor)

source code 

username is the username of the speakeasy user pubkey is the user's public key as a string privkey is the user's private key as a string host is the host that speakeasy is running on (default is localhost) password is the password for the private key (default to blank / no password) auth determines whether to connect and authenticate immediately (default to true)

Overrides: object.__init__

authenticate(self)

source code 

Authenticate to speakeasy. You do not need to call this yourself if you set auth = True in the constructor

upload(self, fname, rname=None)

source code 

Encrypt and upload the file given by fname to the server. fname should be the full path to the file. You can set the optional argument rname to give the file a different name on the server

download(self, fname, lname=None)

source code 

Download and decrypt the file given by fname from the server. By default it creates the file in the current directory with the same name as on the server. To give the downloaded file a different name or download it to a different location, set the lname parameter to where you want the file downloaded.

list_files(self, pattern=None)

source code 

Get a list of the names of the files stored on the server. If the optional argument pattern is given, the method will only list files matching the pattern. Pattern should by a unix-style file glob.

get_pubkey(self, username)

source code 

Get the public key of a user. Takes the user's username as an argument. Returns the public key as a string.