xbmcswift2 icon indicating copy to clipboard operation
xbmcswift2 copied to clipboard

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

Open ulion opened this issue 12 years ago • 2 comments

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.

ulion avatar Dec 31 '12 05:12 ulion

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?

jbeluch avatar Jan 01 '13 01:01 jbeluch

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.

ulion avatar Jan 01 '13 11:01 ulion