Created
December 28, 2012 16:40
-
-
Save clone1018/4399486 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def default(self): | |
droplets = do.show_active_droplets() | |
table = PrettyTable(['Status', 'Name', 'Size', 'Region', 'Image', 'Backups']) | |
# Type == List | |
regions = do.regions() | |
images = do.images() | |
sizes = do.sizes() | |
for droplet in droplets: | |
# There is a better way to do this yes? | |
for size in sizes: | |
if size.id == droplet.size_id: | |
size = size | |
for image in images: | |
if image.id == droplet.image_id: | |
image = image | |
for region in regions: | |
if region.id == droplet.region_id: | |
region = region | |
table.add_row([droplet.status, droplet.name, size.name, region.name, image.name, droplet.backups_active]) | |
print table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment