#!/usr/bin/env python3

import mobius
import sys

def print_filesystems (disk):
  for fs in disk.get_filesystems ():
    print ()
    print ('   Type: %s' % fs.type)
    print ('   Offset: 0x%08x' % fs.offset)
    print ('   Size: %d bytes' % fs.size)
    print ('   Name: %s' % fs.name)

    for key, value in fs.metadata.get_values ():
      print ('   %s: %s' % (key.capitalize (), value))

app = mobius.core.application ()
app.start ()

for url in sys.argv[1:]:
   print ()
   print (">>", url)

   disk = mobius.disk.new_disk_from_url (url)

   if disk.is_available ():
     print_filesystems (disk)

app.stop ()
