The ui common module contains methods and classes that are deemed useful for all the interfaces.
Convert a list of paths in a file tree.
| Parameter: | paths (list) – The paths to be converted. |
|---|
Return the tree, after first converting all file lists to a tuple.
| Returns: | the file tree. |
|---|---|
| Return type: | dictionary |
Walk through the file tree calling the callback function on each item contained.
| Parameter: | callback (function) – The function to be used as a callback, it should have the signature func(item, path) where item is a tuple for a file and dict for a directory. |
|---|
Converts a list of paths in to a file tree.
| Parameter: | paths (list) – The paths to be converted |
|---|
Return the tree.
| Returns: | the file tree. |
|---|---|
| Return type: | dictionary |
Walk through the file tree calling the callback function on each item contained.
| Parameter: | callback (function) – The function to be used as a callback, it should have the signature func(item, path) where item is a tuple for a file and dict for a directory. |
|---|
Collects information about a torrent file.
| Parameter: | filename (string) – The path to the torrent |
|---|
Return the torrent info as a dictionary, only including the passed in keys.
| Parameter: | keys (string) – a number of key strings |
|---|
The torrents file data. This will be the bencoded dictionary read from the torrent file.
| Return type: | string |
|---|
A list of the files that the torrent contains.
| Return type: | list |
|---|
A dictionary based tree of the files.
{
"some_directory": {
"some_file": (index, size, download)
}
}
| Return type: | dictionary |
|---|
The torrents info_hash
| Return type: | string |
|---|
The torrents metadata.
| Return type: | dictionary |
|---|
The name of the torrent.
| Return type: | string |
|---|
Decodes a string and re-encodes it in utf8. If it cannot decode using :param:encoding then it will try to detect the string encoding and decode it.
| Parameters: |
|
|---|
Grabs the localclient auth line from the ‘auth’ file and creates a localhost uri
| Returns: | with the username and password to login as |
|---|---|
| Return type: | tuple |