Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| class ProgressPercentage(object): | |
| ''' Progress Class | |
| Class for calculating and displaying download progress | |
| ''' | |
| def __init__(self, client, bucket, filename): | |
| ''' Initialize | |
| initialize with: file name, file size and lock. | |
| Set seen_so_far to 0. Set progress bar length | |
| ''' | |
| self._filename = filename |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/sh | |
| # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
| set -e | |
| # Must be a valid filename | |
| NAME=foo | |
| PIDFILE=/var/run/$NAME.pid | |
| #This is the command to be run, give the full pathname | |
| DAEMON=/usr/local/bin/bar |