Code Duplication    Length = 21-21 lines in 2 locations

glances/plugins/glances_processlist.py 2 locations

@@ 352-372 (lines=21) @@
349
            ret = self.curse_add_line(msg, optional=True, additional=True)
350
        return ret
351
352
    def _get_process_curses_io_write(self, p, selected, args):
353
        """Return process IO Write curses"""
354
        ret = ''
355
        if 'io_counters' in p and \
356
           p['io_counters'][4] == 1 and \
357
           p['time_since_update'] != 0:
358
            # Display rate if stats is available and io_tag ([4]) == 1
359
            # IO read
360
            io_ws = int((p['io_counters'][0] - p['io_counters']
361
                         [2]) / p['time_since_update'])
362
            if io_ws == 0:
363
                msg = self.layout_stat['iow'].format("0")
364
            else:
365
                msg = self.layout_stat['iow'].format(
366
                    self.auto_unit(io_ws,
367
                                   low_precision=True))
368
            ret = self.curse_add_line(msg, optional=True, additional=True)
369
        else:
370
            msg = self.layout_header['iow'].format("?")
371
            ret = self.curse_add_line(msg, optional=True, additional=True)
372
        return ret
373
374
    def get_process_curses_data(self, p, selected, args):
375
        """Get curses data to display for a process.
@@ 330-350 (lines=21) @@
327
            ret = self.curse_add_line(msg)
328
        return ret
329
330
    def _get_process_curses_io_read(self, p, selected, args):
331
        """Return process IO Read curses"""
332
        ret = ''
333
        if 'io_counters' in p and \
334
           p['io_counters'][4] == 1 and \
335
           p['time_since_update'] != 0:
336
            # Display rate if stats is available and io_tag ([4]) == 1
337
            # IO read
338
            io_rs = int((p['io_counters'][0] - p['io_counters']
339
                         [2]) / p['time_since_update'])
340
            if io_rs == 0:
341
                msg = self.layout_stat['ior'].format("0")
342
            else:
343
                msg = self.layout_stat['ior'].format(
344
                    self.auto_unit(io_rs,
345
                                   low_precision=True))
346
            ret = self.curse_add_line(msg, optional=True, additional=True)
347
        else:
348
            msg = self.layout_header['ior'].format("?")
349
            ret = self.curse_add_line(msg, optional=True, additional=True)
350
        return ret
351
352
    def _get_process_curses_io_write(self, p, selected, args):
353
        """Return process IO Write curses"""