diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-02-08 14:07:17 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-02-08 14:07:17 +1300 |
commit | 7e6196511f5dc761d5361ac89ff4e6641881d05c (patch) | |
tree | d67ecf78a5627f6dcec19455056f1acfe7b0f692 /libmproxy/console/connview.py | |
parent | cdd5a53767e51a6d992bf8d08df2733e7af916b8 (diff) | |
download | mitmproxy-7e6196511f5dc761d5361ac89ff4e6641881d05c.tar.gz mitmproxy-7e6196511f5dc761d5361ac89ff4e6641881d05c.tar.bz2 mitmproxy-7e6196511f5dc761d5361ac89ff4e6641881d05c.zip |
Editable fields for KVEditor.
Diffstat (limited to 'libmproxy/console/connview.py')
-rw-r--r-- | libmproxy/console/connview.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/libmproxy/console/connview.py b/libmproxy/console/connview.py index 1e9d0c60..f4f6c662 100644 --- a/libmproxy/console/connview.py +++ b/libmproxy/console/connview.py @@ -370,9 +370,28 @@ class ConnectionView(common.WWrap): self.master.prompt_edit("Message", conn.msg, self.set_resp_msg) self.master.refresh_connection(self.flow) + def _view_nextprev_flow(self, np, flow): + try: + idx = self.state.view.index(flow) + except IndexError: + return + if np == "next": + new_flow, new_idx = self.state.get_next(idx) + else: + new_flow, new_idx = self.state.get_prev(idx) + if new_idx is None: + return + self.master.view_flow(new_flow) + + def view_next_flow(self, flow): + return self._view_nextprev_flow("next", flow) + + def view_prev_flow(self, flow): + return self._view_nextprev_flow("prev", flow) + def keypress(self, size, key): if key == " ": - self.master.view_next_flow(self.flow) + self.view_next_flow(self.flow) return key key = common.shortcuts(key) @@ -423,7 +442,7 @@ class ConnectionView(common.WWrap): ) key = None elif key == "p": - self.master.view_prev_flow(self.flow) + self.view_prev_flow(self.flow) elif key == "r": r = self.master.replay_request(self.flow) if r: |