Comments (9)
plugin = routing.Plugin('some base url', convert_args=True)
from kodi-plugin-routing.
I might just PR this myself, but if someone does it first, then cool.
from kodi-plugin-routing.
#10 implements this
from kodi-plugin-routing.
I am not a big fan of this automatic conversion. It also breaks existing uses.
from kodi-plugin-routing.
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.
Still no fan ;-)
from kodi-plugin-routing.
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.
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.
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)
- Please document <path:foo> syntax HOT 1
- Creating sub menu for Kodi addon? HOT 1
- Support for trailing slashes
- Can we have a new release? HOT 1
- Is there a way to redirect one url to another ? HOT 2
- Stripping of trailing slashes breaks stuff HOT 12
- error after upgrade from v0.2.1 to v0.2.3 in kodi HOT 10
- Plugin not working HOT 2
- Discussion about project governance HOT 4
- Variables are Escaped in Query, but Nowhere Else HOT 2
- script.module.routing missing from Kodi v19 (Matrix) HOT 1
- pass variable parts with splash at the end HOT 1
- Broken in v18 with reusepython HOT 4
- How to pass JSON object or dict? HOT 1
- Allow Override Static URLs HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kodi-plugin-routing.