(cell)
| 54 | return str(rule_location) |
| 55 | |
| 56 | def format_bbcode_cell(cell): |
| 57 | if cell is None or (isinstance(cell, PfSenseNode) and cell.data is None): |
| 58 | cell = '' |
| 59 | elif cell is True or (isinstance(cell, PfSenseNode) and cell.data is True): |
| 60 | cell = 'x' |
| 61 | elif isinstance(cell, PfSenseRuleAlias): |
| 62 | cell = format_rule_alias(cell.data) |
| 63 | elif isinstance(cell, PfSenseRuleInterface): |
| 64 | cell = format_rule_interface(cell.data) |
| 65 | elif isinstance(cell, PfSenseRuleLocation): |
| 66 | if hasattr(cell, 'not'): |
| 67 | data = '**!** ' |
| 68 | else: |
| 69 | data = '' |
| 70 | if hasattr(cell, 'any'): |
| 71 | data += 'any' |
| 72 | elif hasattr(cell, 'address'): |
| 73 | data += format_rule_location(cell.address) |
| 74 | elif hasattr(cell, 'network'): |
| 75 | data += format_rule_location(cell.network) |
| 76 | if hasattr(cell, 'port'): |
| 77 | data += ':' |
| 78 | data += str(cell.port) |
| 79 | cell = data |
| 80 | return str(cell).replace('[', '{').replace(']', '}').replace('\n', ' ') |
| 81 | |
| 82 | def output_bbcode_table(stream, header, rows): |
| 83 | stream.write("[table]\n") |
no test coverage detected