Created
November 6, 2013 10:01
-
-
Save greggyNapalm/7333649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> SRC_URL = 'http://log.firebat.yandex-team.ru/messages? | |
| utf8=%E2%9C%93&filters%5Bmessage%5D=&filters%5Bfull_message%5D=&filters%5Bdate%5D=&filters%5Bfacility%5D=&filters%5Bfile%5D=&filters%5Bline%5D=&filters%5Bseverity%5D=&filters%5Bhost%5D=&fil | |
| ters%5Badditional%5D%5Bkeys%5D%5B%5D=test_id&filters%5Badditional%5D%5Bvalues%5D%5B%5D=31&filters%5Badditional%5D%5Bkeys%5D%5B%5D=env&filters%5Badditional%5D%5Bvalues%5D%5B%5D=%27lunaport-dev%2 | |
| 7' | |
| >>> from urlparse import urlparse | |
| >>> import urlparse | |
| >>> urlparse.parse_qs(SRC_URL) | |
| {'http://log.firebat.yandex-team.ru/messages? utf8': [' | |
| \xe2\x9c\x93'], 'filters[additional][keys][]': ['test_id', 'env'], 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> | |
| >>> | |
| >>> urlparse.parse_qs(SRC_URL.split('?')[1]) | |
| {' utf8': ['\xe2\x9c\x93'], 'filters[additional][keys][ | |
| ]': ['test_id', 'env'], 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> | |
| >>> import pprint | |
| >>> pp = pprint.PrettyPrinter(indent=4).pprint | |
| >>> pp(urlparse.parse_qs(SRC_URL.split('?')[1])) | |
| { ' utf8': [ '\xe2\x9c\x93'], | |
| 'filters[additional][keys][]': ['test_id', 'env'], | |
| 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> from cgi import parse_qs | |
| >>> parse_qs(SRC_URL.split('?')[1]) | |
| {' utf8': ['\xe2\x9c\x93'], 'filters[additional][keys][ | |
| ]': ['test_id', 'env'], 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> | |
| >>> pp(parse_qs(SRC_URL.split('?')[1])) | |
| { ' utf8': [ '\xe2\x9c\x93'], | |
| 'filters[additional][keys][]': ['test_id', 'env'], | |
| 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> pp(urlparse.parse_qs(SRC_URL.split('?')[1])) | |
| { ' utf8': [ '\xe2\x9c\x93'], | |
| 'filters[additional][keys][]': ['test_id', 'env'], | |
| 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> SRC_URL = 'http://log.firebat.yandex-team.ru/messages?filters%5Bfull_message%5D=&filters%5Bdate%5D=&filters%5Bfacility%5D=&filters%5Bfile%5D=&filters%5Bline%5D=&filters%5Bseverity%5D=&filte | |
| rs%5Bhost%5D=&filters%5Badditional%5D%5Bkeys%5D%5B%5D=test_id&filters%5Badditional%5D%5Bvalues%5D%5B%5D=31&filters%5Badditional%5D%5Bkeys%5D%5B%5D=env&filters%5Badditional%5D%5Bvalues%5D%5B%5D= | |
| %27lunaport-dev%27' | |
| >>> pp(urlparse.parse_qs(SRC_URL.split('?')[1])) | |
| { 'filters[additional][keys][]': ['test_id', 'env'], | |
| 'filters[additional][values][]': ['31', "'lunaport-dev'"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment