Hi Sam,

Thanks, that's exactly what I was doing. I just wanted to know if there is
a direct way to do that.

Regards,

--Bhathiya

On Fri, Jul 6, 2012 at 2:20 AM, sam ” <[email protected]> wrote:

> check the type of value. if it is object, {},  it's a node. otherwise, it's
> property.
>
> in python:
>     def ls(self, path=None):
>         if path is None:
>             path = self.cwd
>
>         path = os.path.join(self.cwd, path)
>
>         l = []
>         d = self.get_json(path)
>         for k,v in d.iteritems():
> *            if isinstance(v, dict):
>                 l.append(k + '/')*
>             else:
>                 l.append(k)
>         return l
>
>
> the bold part is test if value is dictionary (node),  and appends /
>
>
>
> On Thu, Jul 5, 2012 at 4:12 PM, Bhathiya Jayasekara
> <[email protected]>wrote:
>
> > Hi,
> >
> > I want to get a node's child nodes in jason (at least the names of them)
> > without the main node's properties, because when I get a node as
> > /path/to/node.1.json , I can't distinguish properties and child nodes by
> > looking their names. Is there a way to do that?
> >
> > Thank you.
> >
> > --Bhathiya
> >
>

Reply via email to