On Sun, Feb 05, 2017 at 01:13:18PM -0700, Simon Glass wrote: > At present libfdt consists of only a C implementation. Many scripts are > written using Python so it useful to have Python bindings for libfdt. > Apparently this has never been attempted before, or if so I cannot find a > reference. > > This series starts the process of adding this support, with just a > bare-bones set of methods. > > The v4 series provides binding that can be used like this: > > fdt = libfdt.Fdt(open(fname).read()) > node = fdt.path_offset('/subnode@1') > print fdt.get_prop(node, 'compatible') > subnode = fdt.first_subnode_quiet(node) > while subnode > 0: > print fdt.get_name(subnode) > subnode = fdt.next_subnode_quiet(subnode) > > This version does not include a class for properties. That can be added > if it is felt to be useful, but I want to get some basic functionality > agreed first. The get_property_by_offset() function would likely benefit > from this. Sorry I've taken so long to look at this, I've finally given it a review. Fwiw, I ran into someone at linux.conf.au who also seemed to be rather interested in a Python libfdt wrapper. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature