Code Duplication    Length = 15-15 lines in 2 locations

glances/exports/export.py 1 location

@@ 60-74 (lines=15) @@
57
        # Save last export list
58
        self._last_exported_list = None
59
60
    def _log_result_decorator(fct):
61
        """Log (DEBUG) the result of the function fct."""
62
63
        def wrapper(*args, **kw):
64
            counter = Counter()
65
            ret = fct(*args, **kw)
66
            duration = counter.get()
67
            logger.debug(
68
                "{} {} {} return {} in {} seconds".format(
69
                    args[0].__class__.__name__, args[0].__class__.__module__, fct.__name__, ret, duration
70
                )
71
            )
72
            return ret
73
74
        return wrapper
75
76
    def exit(self):
77
        """Close the export module."""

glances/plugins/plugin/model.py 1 location

@@ 1180-1194 (lines=15) @@
1177
1178
        return wrapper
1179
1180
    def _log_result_decorator(fct):
1181
        """Log (DEBUG) the result of the function fct."""
1182
1183
        def wrapper(*args, **kw):
1184
            counter = Counter()
1185
            ret = fct(*args, **kw)
1186
            duration = counter.get()
1187
            logger.debug(
1188
                "{} {} {} return {} in {} seconds".format(
1189
                    args[0].__class__.__name__, args[0].__class__.__module__, fct.__name__, ret, duration
1190
                )
1191
            )
1192
            return ret
1193
1194
        return wrapper
1195
1196
    def _manage_rate(fct):
1197
        """Manage rate decorator for update method."""