GithubHelp home page GithubHelp logo

Comments (2)

robshakir avatar robshakir commented on May 17, 2024

Hi Tim,

Sorry -- I've been travelling for the last couple of days.

There is a _yang_type element in YANGDynType already - which stores what the leaf was defined as in the model. This would let you get the boolean vs. empty. There are nuances here, such that this may not work in all cases - for example, in the case that you have a typedef that then is a boolean or empty underneath, then this would not be exposed.

The best fix for this (it doesn't matter in other serialisations), would be to add something to YANGBool that is taken by the __init__ there to store whether it is being initialised as an empty or boolean leaf. This is then resilient to typedef features.

Would you be interested in contributing the XML serialisation code back into the project? :-)

Thanks,
r.

from pyangbind.

timmartin avatar timmartin commented on May 17, 2024

Yes, _yang_type gives me what I need. It's not present in the version I'm using in production at the moment, and I forgot to check the most recent version.

In principle, I'd be happy to contribute the XML serialisation code. It probably doesn't cover all the cases at the moment as I've only tested with my own use cases, but hopefully it's a basis to start from. I'll have to check with my employer about the copyright situation, but I don't anticipate that will be a problem.

from pyangbind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.