Beispiel #1
0
def main():
    args = parser.parse_args()
    logging.basicConfig(
        format='%(asctime)s %(name)s: %(levelname)s: %(message)s',
        level=logging.DEBUG if args.debug else logging.INFO)

    try:
        os.makedirs(args.outdir)
    except OSError:
        pass

    comm = lglaf.autodetect_device()
    with closing(comm):
        lglaf.try_hello(comm)
        _logger.debug("Using Protocol version: 0x%x" % comm.protocol_version)

        with partitions.laf_open_disk(comm) as disk_fd:
            _logger.debug("Opened fd %d for disk", disk_fd)
            dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024,
                            args.batch)

    if args.batch:
        print("#All finished")
    else:
        _logger.info("All finished!")
def main():
    args = parser.parse_args()
    logging.basicConfig(format='%(asctime)s %(name)s: %(levelname)s: %(message)s',
            level=logging.DEBUG if args.debug else logging.INFO)

    try: os.makedirs(args.outdir)
    except OSError: pass

    comm = lglaf.autodetect_device()
    with closing(comm):
        lglaf.try_hello(comm)
        with partitions.laf_open_disk(comm) as disk_fd:
            _logger.debug("Opened fd %d for disk", disk_fd)
            dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024)
def main():
    args = parser.parse_args()
    logging.basicConfig(format='%(asctime)s %(name)s: %(levelname)s: %(message)s',
            level=logging.DEBUG if args.debug else logging.INFO)

    try: os.makedirs(args.outdir)
    except OSError: pass

    comm = lglaf.autodetect_device()
    with closing(comm):
        if not args.skip_hello:
            lglaf.try_hello(comm)

        with partitions.laf_open_disk(comm) as disk_fd:
            _logger.debug("Opened fd %d for disk", disk_fd)
            dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024)