Coder Social home page Coder Social logo

Comments (9)

da3dsoul avatar da3dsoul commented on August 16, 2024 1

plugin = routing.Plugin('some base url', convert_args=True)

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

I might just PR this myself, but if someone does it first, then cool.

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

#10 implements this

from kodi-plugin-routing.

dagwieers avatar dagwieers commented on August 16, 2024

I am not a big fan of this automatic conversion. It also breaks existing uses.

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

You need to ask it to do this. It defaults to False. I didn't do anything that would be a breaking change

from kodi-plugin-routing.

dagwieers avatar dagwieers commented on August 16, 2024

Still no fan ;-)

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

The argument for this is that when you use routing systems, you want it to give back what you put in. Python's type...fun...makes checking your expected types even more annoying. This simple feature saves a lot of heartache and frustration just from knowing that if you give it a number, it'll give you a number back.

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

To further discuss this, as it seems at least @dagwieers doesn't like it, I'm thinking that optional strict typing in the URL may be a solution.

Similar to how we have paths, essentially, you apply a modifier to enforce both matching a specific type and automatically converting back to the desired type. This will allow simple types, such as int, float, etc, but also models to be serialized and deserialized. I wouldn't suggest anything more complicated than

{ "Name": "Dave", "Dead":True }

but it could help with passing simple models without a lot of effort trying to convert back and forth, as mentioned in #7

from kodi-plugin-routing.

da3dsoul avatar da3dsoul commented on August 16, 2024

With object persistence, theoretically it could build a small cache, then the Object is saved to the cache and referenced by a one-time ID to be retrieved on the next call. This method wouldn't work for communication with a script, which is another issue, but it could allow for much cleaner URLs while allowing more automagical persistence for devs that depend on this project. That in itself may be beyond the scope of this project, as well, though.

from kodi-plugin-routing.

Related Issues (16)

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.