Skip to content

Instantly share code, notes, and snippets.

@clone1018
Created December 28, 2012 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clone1018/4399486 to your computer and use it in GitHub Desktop.
Save clone1018/4399486 to your computer and use it in GitHub Desktop.
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