Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

function arg could be empty string, the matching rule regex updated. #70

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

ulion commented Dec 31, 2012

sometimes, like an optional search keyboard, could be an empty string in the url like // will result '//', which could not be corrected parsed. this commit will fix it.

Owner

jbeluch commented Jan 1, 2013

I'm not sure this is the best soluton. I want xbmcswift's URL routing code to behave like real world URLs so there aren't any surprises. I believe a double slash "//" in the path of the URL is technically invalid. Most web frameworks that I've tested seem to condense multiple slashes into a single one.

When I encounter this situation, I attach multiple routes to a view and have a default arg of None:

@plugin.route('/categories/', name='all_categories')
@plugin.route('/categories/<category>/')
def show_categories(category=None):
   pass

What do you think?

Contributor

ulion commented Jan 1, 2013

well, your workaround works for it, I didn't thought it.
but, the plugin:// url used only in xbmc and resolved only by xbmcswift2 itself
it's still not a remarkable reason for not support empty argument matching, right?
on the other hand, support empty argument will let the code simple, and as an option.
developers can choose if he want pretty url slash or he want simple.

@ghost ghost assigned jbeluch Feb 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment