flet icon indicating copy to clipboard operation
flet copied to clipboard

Added querystring parser

Open StanMathers opened this issue 3 years ago • 5 comments

Well, I accidentally deleted the previous pr, so this is mostly a finished version of query string parser. Soon, I'll add examples to flet examples and get docs ready.

Currently, supported features are:

  • page.query.get(key) -> gets value according to querystring key (../?q=5 -> page.query.get('q') -> 5)
  • page.query.to_dict -> converts querystring into python dictionary
  • page.query.path -> gets URL path

Changes with go function:

  • Added **kwargs which is encoded into querystring. page.go('/something/', key1=val1, key2=val2...)

page.query.post() -> this is for internal use with go function and has nothing to do externally

StanMathers avatar Sep 06 '22 17:09 StanMathers

FYI: CI is failing: https://ci.appveyor.com/project/flet-dev/flet/builds/44694994/job/d9o2avbg4d27u9gd

FeodorFitsner avatar Sep 06 '22 18:09 FeodorFitsner

FYI: CI is failing: https://ci.appveyor.com/project/flet-dev/flet/builds/44694994/job/d9o2avbg4d27u9gd

Now it succeded, I had a really silly mistake I could never imagine I would do.

StanMathers avatar Sep 06 '22 19:09 StanMathers

That what CI is for :)

FeodorFitsner avatar Sep 06 '22 19:09 FeodorFitsner

Are regular expressions still used? Looks like there is some unused code: https://github.com/flet-dev/flet/pull/280/files#diff-254a2814a7c09b3230e978750f3dab115e3fc59d1e243d1e62ceff2e051a5124R74-R75 https://github.com/flet-dev/flet/pull/280/files#diff-254a2814a7c09b3230e978750f3dab115e3fc59d1e243d1e62ceff2e051a5124R84

FeodorFitsner avatar Sep 22 '22 23:09 FeodorFitsner

Are regular expressions still used? Looks like there is some unused code: https://github.com/flet-dev/flet/pull/280/files#diff-254a2814a7c09b3230e978750f3dab115e3fc59d1e243d1e62ceff2e051a5124R74-R75 https://github.com/flet-dev/flet/pull/280/files#diff-254a2814a7c09b3230e978750f3dab115e3fc59d1e243d1e62ceff2e051a5124R84

Done, I reduced regex as much as possible. I left only one line of regex for checking if URL is encoded.

StanMathers avatar Sep 27 '22 12:09 StanMathers