(self, full: bool = True)
| 107 | return True |
| 108 | |
| 109 | def display(self, full: bool = True) -> str: |
| 110 | r = '{} '.format(self.vendor) if bool(self.vendor) else '' |
| 111 | r += self.product |
| 112 | if bool(self.version): |
| 113 | r += ' {}'.format(self.version) |
| 114 | if full: |
| 115 | patch = self.patch or '' |
| 116 | if self.product == Product.OpenSSH: |
| 117 | mx = re.match(r'^(p\d)(.*)$', patch) |
| 118 | if mx is not None: |
| 119 | r += mx.group(1) |
| 120 | patch = mx.group(2).strip() |
| 121 | if bool(patch): |
| 122 | r += ' ({})'.format(patch) |
| 123 | if bool(self.os): |
| 124 | r += ' running on {}'.format(self.os) |
| 125 | return r |
| 126 | |
| 127 | def __str__(self) -> str: |
| 128 | return self.display() |
no outgoing calls