renamed add_request to create_request and added a tiny docstring

This commit is contained in:
Marcelo Glezer 2015-02-11 16:05:49 -03:00
parent 1df78f75c5
commit 493cecfaf2
2 changed files with 8 additions and 2 deletions

View File

@ -267,7 +267,7 @@ class FlowListBox(urwid.ListBox):
def new_request(self, url, method): def new_request(self, url, method):
try: try:
scheme, host, port, path = http.parse_url(url) scheme, host, port, path = http.parse_url(url)
f = self.master.add_request(method, scheme, host, port, path) f = self.master.create_request(method, scheme, host, port, path)
self.master.view_flow(f) self.master.view_flow(f)
except ValueError: except ValueError:
self.master.statusbar.message("Invalid Url") self.master.statusbar.message("Invalid Url")

View File

@ -763,7 +763,13 @@ class FlowMaster(controller.Master):
def duplicate_flow(self, f): def duplicate_flow(self, f):
return self.load_flow(f.copy()) return self.load_flow(f.copy())
def add_request(self, method, scheme, host, port, path): def create_request(self, method, scheme, host, port, path):
"""
Creates a new request from params and add it to flow list.
created request is empty (except for method and url) but is able
to be replayed
"""
f = http.HTTPFlow(None,None); f = http.HTTPFlow(None,None);
headers = ODictCaseless() headers = ODictCaseless()