def get_requests(self):
"""Parses URL from first selection, and passes it in special `explore` arg
to call to requests.
"""
view = self.view
if not view or not view.settings().get('requester.response_view', False):
sublime.error_message('Explore Error: you can only explore URLs from response tabs')
return []
try:
url = view.substr(view.sel()[0]).replace('"', '')
except:
return []
if not url:
return []
self._explore_url = url
try:
request = self.get_replay_request()
except:
return []
unclosed = request[:-1].strip()
if unclosed[-1] == ',':
unclosed = unclosed[:-1]
return ["{}, explore=({}, {}))".format(unclosed, repr(request), repr(url))]
评论列表
文章目录