[Git][NTPsec/ntpsec][master] ntpmon: more unicode() removals.

Gary E. Miller gitlab at mg.gitlab.com
Tue Aug 15 21:28:58 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
6f916f48 by Gary E. Miller at 2017-08-15T14:28:02-07:00
ntpmon: more unicode() removals.

ntpmon now starts on Python 3, but crashes in some modes.

- - - - -


1 changed file:

- ntpclients/ntpmon


Changes:

=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -269,7 +269,7 @@ if __name__ == '__main__':
                 stdscr.clear()
                 stdscr.addstr(0, 0, u"".encode('UTF-8'))
                 if helpmode:
-                    stdscr.addstr(unicode(__doc__).encode('UTF-8'))
+                    stdscr.addstr(__doc__.encode('UTF-8'))
                     tempStr = u"\nPress any key to resume monitoring"
                     stdscr.addstr(tempStr.encode('UTF-8'))
                     stdscr.refresh()
@@ -318,7 +318,7 @@ if __name__ == '__main__':
                             data = peer_report.summary(session.rstatus,
                                                        variables,
                                                        peer.associd)
-                            data = unicode(data).encode('UTF-8')
+                            data = data.encode('UTF-8')
                             stdscr.addstr(data, hilite)
                             if (('refid' in variables and
                                  'INIT' in variables['refid'])):
@@ -341,7 +341,7 @@ if __name__ == '__main__':
                                            debug, 1)
                         # The status line
                         sl = statline(peer_report, mru_report, nyquist)
-                        strconvert = unicode(sl + "\n")
+                        strconvert = sl + "\n"
                         stdscr.addstr(strconvert.encode('UTF-8'),
                                       curses.A_REVERSE | curses.A_DIM)
                         if detailmode:
@@ -368,11 +368,11 @@ if __name__ == '__main__':
                                 pass
                         elif span.entries:
                             strconvert = ntp.util.MRUSummary.header + "\n"
-                            stdscr.addstr(unicode(strconvert).encode('UTF-8'),
+                            stdscr.addstr(strconvert.encode('UTF-8'),
                                           curses.A_BOLD)
                             for entry in reversed(span.entries):
                                 strcon = mru_report.summary(entry) + "\n"
-                                stdscr.addstr(unicode(strcon).encode('UTF-8'))
+                                stdscr.addstr(strcon.encode('UTF-8'))
                     except curses.error:
                         # An addstr overran the screen, no worries
                         pass



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6f916f48c66c836d85016933ff749732ce63eb5e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6f916f48c66c836d85016933ff749732ce63eb5e
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170815/38914e7c/attachment.html>


More information about the vc mailing list