code: def show(self, f, pattern=None):
          '''write status to status.txt'''
          if pattern is None:
              f.write('Counters: ')
              for c in self.counters:
                  f.write('%s:%s ' % (c, self.counters[c]))
              f.write('\n')
              f.write('MAV Errors: %u\n' % self.mav_error)
              f.write(str(self.gps)+'\n')
          for m in sorted(self.msgs.keys()):
              if pattern is not None and not fnmatch.fnmatch(str(m).upper(), pattern.upper()):
                  continue
              f.write("%u: %s\n" % (self.msg_count[m], str(self.msgs[m]))f show(self, f, pattern=None):
          '''write status to status.txt'''
          if pattern is None:
              f.write('Counters: ')
              for c in self.counters:
                  f.write('%s:%s ' % (c, self.counters[c]))
              f.write('\n')
              f.write('MAV Errors: %u\n' % self.mav_error)
              f.write(str(self.gps)+'\n')
          for m in sorted(self.msgs.keys()):
              if pattern is not None and not fnmatch.fnmatch(str(m).upper(), pattern.upper()):
                  continue
              f.write("%u: %s\n" % (self.msg_count[m], str(self.msgs[m])))
docs: write status to status.txt