| 73 | return "Filter Expressions" |
| 74 | |
| 75 | def filtexp(self): |
| 76 | text = [] |
| 77 | text.extend(common.format_keyvals(flowfilter.help, indent=4)) |
| 78 | text.append( |
| 79 | urwid.Text( |
| 80 | [ |
| 81 | "\n", |
| 82 | ("text", " Regexes are Python-style.\n"), |
| 83 | ("text", " Regexes can be specified as quoted strings.\n"), |
| 84 | ( |
| 85 | "text", |
| 86 | ' Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".\n', |
| 87 | ), |
| 88 | ( |
| 89 | "text", |
| 90 | " Expressions with no operators are regex matches against URL.\n", |
| 91 | ), |
| 92 | ("text", " Default binary operator is &.\n"), |
| 93 | ("head", "\n Examples:\n"), |
| 94 | ] |
| 95 | ) |
| 96 | ) |
| 97 | examples = [ |
| 98 | (r"google\.com", r"Url containing \"google.com"), |
| 99 | ("~q ~b test", r"Requests where body contains \"test\""), |
| 100 | ( |
| 101 | r"!(~q & ~t \"text/html\")", |
| 102 | "Anything but requests with a text/html content type.", |
| 103 | ), |
| 104 | ] |
| 105 | text.extend(common.format_keyvals(examples, indent=4)) |
| 106 | return CListBox(text) |
| 107 | |
| 108 | def layout_pushed(self, prev): |
| 109 | """ |