Hi David, On 21 March 2017 at 10:02, Simon Glass <sjg@xxxxxxxxxxxx> wrote: > Hi David, > > On 20 March 2017 at 23:35, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> wrote: >> On Fri, Mar 17, 2017 at 04:14:29PM -0600, 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 v11 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(node, quiet=[libfdt.NOTFOUND]) >>> while subnode > 0: >>> print fdt.get_name(subnode) >>> subnode = fdt.next_subnode(subnode, quiet=[libfdt.NOTFOUND]) >>> >>> This version includes a simple class for properties. >> >> Applied to master. I made a small change in the last patch, so that >> the error message when the python packages aren't installed is less >> scary looking. > > Yes that is better, but note the 'pylibgfdt' typo. > > I suppose it is too soon for a new release tag? Actually before this we need to make sure the library is installed properly. > > I'm also interested in your thoughts on where to take this next. > Presumably we should support the rest of the functions in libfdt. > > Benjamin, any plans? > > Regards, > Simon Regards, Simon -- To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html