prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Adding new column to `plugins` output
  I'm trying to understand the concepts of 'phase' and 'interface' of a plugin. The output of the CLI command `flexget plugins` has been helpful. But I think I noticed that the output is missing a column. It has 'Keyword', 'Phases' and 'Flags', but no 'Interfaces'. I found out that all plugins _do_ defined a list of interfaces for themselves. 
  
  Shall I create a PR adding the column 'Interfaces' to the output?
  I wanted to ask before I put the effort in.
  
  And if someone can explain what a 'phase' and 'interface' is I'll write up a wiki page. ;)
  
  </issue>
  <code>
  [start of flexget/plugins/cli/plugins.py]
  1 from __future__ import unicode_literals, division, absolute_import
  2 from builtins import *  # noqa pylint: disable=unused-import, redefined-builtin
  3 
  4 import logging
  5 
  6 from colorclass.toggles import disable_all_colors
  7 from flexget import options
  8 from flexget.event import event
  9 from flexget.plugin import get_plugins
  10 from flexget.terminal import TerminalTable, TerminalTableError, table_parser, console, colorize
  11 
  12 log = logging.getLogger('plugins')
  13 
  14 
  15 def plugins_summary(manager, options):
  16     if options.table_type == 'porcelain':
  17         disable_all_colors()
  18     header = ['Keyword', 'Phases', 'Flags']
  19     table_data = [header]
  20     for plugin in sorted(get_plugins(phase=options.phase, interface=options.interface)):
  21         if options.builtins and not plugin.builtin:
  22             continue
  23         flags = []
  24         if plugin.instance.__doc__:
  25             flags.append('doc')
  26         if plugin.builtin:
  27             flags.append('builtin')
  28         if plugin.debug:
  29             if not options.debug:
  30                 continue
  31             flags.append('developers')
  32         handlers = plugin.phase_handlers
  33         roles = []
  34         for phase in handlers:
  35             priority = handlers[phase].priority
  36             roles.append('{0}({1})'.format(phase, priority))
  37 
  38         name = colorize('green', plugin.name) if 'builtin' in flags else plugin.name
  39         table_data.append([name, ', '.join(roles), ', '.join(flags)])
  40 
  41     try:
  42         table = TerminalTable(options.table_type, table_data, wrap_columns=[1, 2])
  43         console(table.output)
  44     except TerminalTableError as e:
  45         console('ERROR: %s' % str(e))
  46         return
  47     console(colorize('green', ' Built-in plugins'))
  48 
  49 
  50 @event('options.register')
  51 def register_parser_arguments():
  52     parser = options.register_command('plugins', plugins_summary, help='Print registered plugin summaries',
  53                                       parents=[table_parser])
  54     parser.add_argument('--interface', help='Show plugins belonging to this interface')
  55     parser.add_argument('--phase', help='Show plugins that act on this phase')
  56     parser.add_argument('--builtins', action='store_true', help='Show just builtin plugins')
  57
  [end of flexget/plugins/cli/plugins.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/flexget/plugins/cli/plugins.py b/flexget/plugins/cli/plugins.py
  --- a/flexget/plugins/cli/plugins.py
  +++ b/flexget/plugins/cli/plugins.py
  @@ -15,11 +15,12 @@
   def plugins_summary(manager, options):
       if options.table_type == 'porcelain':
           disable_all_colors()
  -    header = ['Keyword', 'Phases', 'Flags']
  +    header = ['Keyword', 'Interfaces', 'Phases', 'Flags']
       table_data = [header]
       for plugin in sorted(get_plugins(phase=options.phase, interface=options.interface)):
           if options.builtins and not plugin.builtin:
               continue
  +
           flags = []
           if plugin.instance.__doc__:
               flags.append('doc')
  @@ -29,6 +30,7 @@
               if not options.debug:
                   continue
               flags.append('developers')
  +
           handlers = plugin.phase_handlers
           roles = []
           for phase in handlers:
  @@ -36,7 +38,7 @@
               roles.append('{0}({1})'.format(phase, priority))
   
           name = colorize('green', plugin.name) if 'builtin' in flags else plugin.name
  -        table_data.append([name, ', '.join(roles), ', '.join(flags)])
  +        table_data.append([name, ', '.join(plugin.interfaces), ', '.join(roles), ', '.join(flags)])
   
       try:
           table = TerminalTable(options.table_type, table_data, wrap_columns=[1, 2])
  
verification_info: {"golden_diff": "diff --git a/flexget/plugins/cli/plugins.py b/flexget/plugins/cli/plugins.py\n--- a/flexget/plugins/cli/plugins.py\n+++ b/flexget/plugins/cli/plugins.py\n@@ -15,11 +15,12 @@\n def plugins_summary(manager, options):\n     if options.table_type == 'porcelain':\n         disable_all_colors()\n-    header = ['Keyword', 'Phases', 'Flags']\n+    header = ['Keyword', 'Interfaces', 'Phases', 'Flags']\n     table_data = [header]\n     for plugin in sorted(get_plugins(phase=options.phase, interface=options.interface)):\n         if options.builtins and not plugin.builtin:\n             continue\n+\n         flags = []\n         if plugin.instance.__doc__:\n             flags.append('doc')\n@@ -29,6 +30,7 @@\n             if not options.debug:\n                 continue\n             flags.append('developers')\n+\n         handlers = plugin.phase_handlers\n         roles = []\n         for phase in handlers:\n@@ -36,7 +38,7 @@\n             roles.append('{0}({1})'.format(phase, priority))\n \n         name = colorize('green', plugin.name) if 'builtin' in flags else plugin.name\n-        table_data.append([name, ', '.join(roles), ', '.join(flags)])\n+        table_data.append([name, ', '.join(plugin.interfaces), ', '.join(roles), ', '.join(flags)])\n \n     try:\n         table = TerminalTable(options.table_type, table_data, wrap_columns=[1, 2])\n", "issue": "Adding new column to `plugins` output\nI'm trying to understand the concepts of 'phase' and 'interface' of a plugin. The output of the CLI command `flexget plugins` has been helpful. But I think I noticed that the output is missing a column. It has 'Keyword', 'Phases' and 'Flags', but no 'Interfaces'. I found out that all plugins _do_ defined a list of interfaces for themselves. \r\n\r\nShall I create a PR adding the column 'Interfaces' to the output?\r\nI wanted to ask before I put the effort in.\r\n\r\nAnd if someone can explain what a 'phase' and 'interface' is I'll write up a wiki page. ;)\n", "before_files": [{"content": "from __future__ import unicode_literals, division, absolute_import\nfrom builtins import *  # noqa pylint: disable=unused-import, redefined-builtin\n\nimport logging\n\nfrom colorclass.toggles import disable_all_colors\nfrom flexget import options\nfrom flexget.event import event\nfrom flexget.plugin import get_plugins\nfrom flexget.terminal import TerminalTable, TerminalTableError, table_parser, console, colorize\n\nlog = logging.getLogger('plugins')\n\n\ndef plugins_summary(manager, options):\n    if options.table_type == 'porcelain':\n        disable_all_colors()\n    header = ['Keyword', 'Phases', 'Flags']\n    table_data = [header]\n    for plugin in sorted(get_plugins(phase=options.phase, interface=options.interface)):\n        if options.builtins and not plugin.builtin:\n            continue\n        flags = []\n        if plugin.instance.__doc__:\n            flags.append('doc')\n        if plugin.builtin:\n            flags.append('builtin')\n        if plugin.debug:\n            if not options.debug:\n                continue\n            flags.append('developers')\n        handlers = plugin.phase_handlers\n        roles = []\n        for phase in handlers:\n            priority = handlers[phase].priority\n            roles.append('{0}({1})'.format(phase, priority))\n\n        name = colorize('green', plugin.name) if 'builtin' in flags else plugin.name\n        table_data.append([name, ', '.join(roles), ', '.join(flags)])\n\n    try:\n        table = TerminalTable(options.table_type, table_data, wrap_columns=[1, 2])\n        console(table.output)\n    except TerminalTableError as e:\n        console('ERROR: %s' % str(e))\n        return\n    console(colorize('green', ' Built-in plugins'))\n\n\n@event('options.register')\ndef register_parser_arguments():\n    parser = options.register_command('plugins', plugins_summary, help='Print registered plugin summaries',\n                                      parents=[table_parser])\n    parser.add_argument('--interface', help='Show plugins belonging to this interface')\n    parser.add_argument('--phase', help='Show plugins that act on this phase')\n    parser.add_argument('--builtins', action='store_true', help='Show just builtin plugins')\n", "path": "flexget/plugins/cli/plugins.py"}]}