# Buggy code
def msg_curse(self, args=None):
    """Return the dict to display in the curse interface."""
    # Init the return message
    ret = []

    # Only process if stats exist and plugin not disabled
    if not self.stats or args.disable_load:
        return ret

    # Build the string message
    # Header
    msg = "{0:8}".format("LOAD")
    ret.append(self.curse_add_line(msg, "TITLE"))
    # Core number
    if self.stats["cpucore"] > 0:
        msg = "{0}-core".format(int(self.stats["cpucore"]))
        ret.append(self.curse_add_line(msg))
    # New line
    ret.append(self.curse_new_line())
    # 1min load
    msg = "{0:8}".format("1 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min1"])
    ret.append(self.curse_add_line(msg))
    # New line
    ret.append(self.curse_new_line())
    # 5min load
    msg = "{0:8}".format("5 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min5"])
    ret.append(
        self.curse_add_line(msg, self.get_views(key="min5", option="decoration"))
    )
    # New line
    ret.append(self.curse_new_line())
    # 15min load
    msg = "{0:8}".format("15 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min15"])
    ret.append(
        self.curse_add_line(msg, self.get_views(key="min15", option="decoration"))
    )

    return ret


# Traceback (KeyError)
Traceback (most recent call last):
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Scripts\glances.exe\__main__.py", line 9, in <module>
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\__init__.py", line 125, in main
standalone.serve_forever()
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\core\glances_standalone.py", line 108, in serve_forever
return self.__serve_forever()
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\core\glances_standalone.py", line 93, in __serve_forever
self.screen.update(self.stats)
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 914, in update
self.flush(stats, cs_status=cs_status)
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 892, in flush
self.display(stats, cs_status=cs_status)
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 458, in display
stats_load = stats.get_plugin('load').get_stats_display(args=self.args)
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\plugins\glances_plugin.py", line 551, in get_stats_display
'msgdict': self.msg_curse(args),
File "C:\PERF\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\glances\plugins\glances_load.py", line 148, in msg_curse
if self.stats['cpucore'] > 0:
KeyError: 'cpucore'

# Fixed code
def msg_curse(self, args=None):
    """Return the dict to display in the curse interface."""
    # Init the return message
    ret = []

    # Only process if stats exist and plugin not disabled
    if not self.stats or args.disable_load:
        return ret

    # Build the string message
    # Header
    msg = "{0:8}".format("LOAD")
    ret.append(self.curse_add_line(msg, "TITLE"))
    # Core number
    if "cpucore" in self.stats and self.stats["cpucore"] > 0:
        msg = "{0}-core".format(int(self.stats["cpucore"]))
        ret.append(self.curse_add_line(msg))
    # New line
    ret.append(self.curse_new_line())
    # 1min load
    msg = "{0:8}".format("1 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min1"])
    ret.append(self.curse_add_line(msg))
    # New line
    ret.append(self.curse_new_line())
    # 5min load
    msg = "{0:8}".format("5 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min5"])
    ret.append(
        self.curse_add_line(msg, self.get_views(key="min5", option="decoration"))
    )
    # New line
    ret.append(self.curse_new_line())
    # 15min load
    msg = "{0:8}".format("15 min:")
    ret.append(self.curse_add_line(msg))
    msg = "{0:>6.2f}".format(self.stats["min15"])
    ret.append(
        self.curse_add_line(msg, self.get_views(key="min15", option="decoration"))
    )

    return ret