# Buggy code
def update(self):
    """Update the command result attributed."""
    # Search application monitored processes by a regular expression
    processlist = glances_processes.getalllist()

    # Iter upon the AMPs dict
    for k, v in iteritems(self.get()):
        try:
            amps_list = [
                p
                for p in processlist
                for c in p["cmdline"]
                if re.search(v.regex(), c) is not None
            ]
        except TypeError:
            continue
        if len(amps_list) > 0:
            # At least one process is matching the regex
            logger.debug(
                "AMPS: {} process detected (PID={})".format(k, amps_list[0]["pid"])
            )
            # Call the AMP update method
            thread = threading.Thread(target=v.update_wrapper, args=[amps_list])
            thread.start()
        else:
            # Set the process number to 0
            v.set_count(0)
            if v.count_min() > 0:
                # Only display the "No running process message" is countmin is defined
                v.set_result("No running process")

    return self.__amps_dict


# Traceback (TypeError)
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/nicolargo/Dropbox/dev/glances/glances/__main__.py", line 29, in <module>
glances.main()
File "/home/nicolargo/Dropbox/dev/glances/glances/__init__.py", line 127, in main
args=core.get_args())
File "/home/nicolargo/Dropbox/dev/glances/glances/standalone.py", line 68, in __init__
self.stats.update()
File "/home/nicolargo/Dropbox/dev/glances/glances/stats.py", line 154, in update
self._plugins[p].update()
File "/home/nicolargo/Dropbox/dev/glances/glances/plugins/glances_plugin.py", line 734, in wrapper
ret = fct(*args, **kw)
File "/home/nicolargo/Dropbox/dev/glances/glances/plugins/glances_amps.py", line 58, in update
for k, v in iteritems(self.glances_amps.update()):
File "/home/nicolargo/Dropbox/dev/glances/glances/amps_list.py", line 125, in update
if v.count_min() > 0:
TypeError: unorderable types: NoneType() > int()

# Fixed code
def update(self):
    """Update the command result attributed."""
    # Search application monitored processes by a regular expression
    processlist = glances_processes.getalllist()

    # Iter upon the AMPs dict
    for k, v in iteritems(self.get()):
        try:
            amps_list = [
                p
                for p in processlist
                for c in p["cmdline"]
                if re.search(v.regex(), c) is not None
            ]
        except TypeError:
            continue
        if len(amps_list) > 0:
            # At least one process is matching the regex
            logger.debug(
                "AMPS: {} process detected (PID={})".format(k, amps_list[0]["pid"])
            )
            # Call the AMP update method
            thread = threading.Thread(target=v.update_wrapper, args=[amps_list])
            thread.start()
        else:
            # Set the process number to 0
            v.set_count(0)
            if v.count_min() is not None and v.count_min() > 0:
                # Only display the "No running process message" is countmin is defined
                v.set_result("No running process")

    return self.__amps_dict