prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  No way to disable reloader when starting the development server
  **CKAN version**
  2.9.0
  
  **Describe the bug**
  When trying to start the development server without a reloader i encountered problems with the `--reloader` argument.
  The reloader option requires a TEXT argument, therefore i expected that --reloader False disables the reloader.
  
  
  **Steps to reproduce**
  Start ckan with following command:
  
  `ckan -c [PATH_TO_CONFIG] run --host 0.0.0.0 --reloader False`
  
  **Expected behavior**
  Server starts without reloader
  
  **Additional details**
  
  Currently the `reloader` option is passed as string and if it's not provided it defaults to the boolean value `True`
  
  So we have two cases when the `run_simple` method is called:
  1. `--reloader` argument is not provided --> reloader=True
  2. `--reloader` argument is provided --> some string is passed as reloader argument to the `run_simple` method, which evaluates to true in the if statement distinguishing whether the reloader should be used or not.
  
  So the `--reloader` argument does not affect anything.
  
  _My suggestion:_ rename the argument to `disable-reloader` and turn it into a boolean flag. This enables the user to disable the reloader and the default behaviour (i.e. the dev server starts with a reloader) stays the same.
  
  
  </issue>
  <code>
  [start of ckan/cli/server.py]
  1 # encoding: utf-8
  2 
  3 import logging
  4 
  5 import click
  6 from werkzeug.serving import run_simple
  7 
  8 from ckan.common import config
  9 import ckan.plugins.toolkit as tk
  10 
  11 log = logging.getLogger(__name__)
  12 
  13 
  14 @click.command(u"run", short_help=u"Start development server")
  15 @click.option(u"-H", u"--host", default=u"localhost", help=u"Set host")
  16 @click.option(u"-p", u"--port", default=5000, help=u"Set port")
  17 @click.option(u"-r", u"--reloader", default=True, help=u"Use reloader")
  18 @click.option(
  19     u"-t", u"--threaded", is_flag=True,
  20     help=u"Handle each request in a separate thread"
  21 )
  22 @click.option(u"-e", u"--extra-files", multiple=True)
  23 @click.option(
  24     u"--processes", type=int, default=0,
  25     help=u"Maximum number of concurrent processes"
  26 )
  27 @click.pass_context
  28 def run(ctx, host, port, reloader, threaded, extra_files, processes):
  29     u"""Runs the Werkzeug development server"""
  30     threaded = threaded or tk.asbool(config.get(u"ckan.devserver.threaded"))
  31     processes = processes or tk.asint(
  32         config.get(u"ckan.devserver.multiprocess", 1)
  33     )
  34     if threaded and processes > 1:
  35         tk.error_shout(u"Cannot have a multithreaded and multi process server")
  36         raise click.Abort()
  37 
  38     log.info(u"Running server {0} on port {1}".format(host, port))
  39 
  40     config_extra_files = tk.aslist(
  41         config.get(u"ckan.devserver.watch_patterns")
  42     )
  43     extra_files = list(extra_files) + [
  44         config[u"__file__"]
  45     ] + config_extra_files
  46 
  47     run_simple(
  48         host,
  49         port,
  50         ctx.obj.app,
  51         use_reloader=reloader,
  52         use_evalex=True,
  53         threaded=threaded,
  54         processes=processes,
  55         extra_files=extra_files,
  56     )
  57
  [end of ckan/cli/server.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/ckan/cli/server.py b/ckan/cli/server.py
  --- a/ckan/cli/server.py
  +++ b/ckan/cli/server.py
  @@ -5,8 +5,8 @@
   import click
   from werkzeug.serving import run_simple
   
  -from ckan.common import config
   import ckan.plugins.toolkit as tk
  +from ckan.common import config
   
   log = logging.getLogger(__name__)
   
  @@ -14,7 +14,8 @@
   @click.command(u"run", short_help=u"Start development server")
   @click.option(u"-H", u"--host", default=u"localhost", help=u"Set host")
   @click.option(u"-p", u"--port", default=5000, help=u"Set port")
  -@click.option(u"-r", u"--reloader", default=True, help=u"Use reloader")
  +@click.option(u"-r", u"--disable-reloader", is_flag=True,
  +              help=u"Disable reloader")
   @click.option(
       u"-t", u"--threaded", is_flag=True,
       help=u"Handle each request in a separate thread"
  @@ -25,8 +26,9 @@
       help=u"Maximum number of concurrent processes"
   )
   @click.pass_context
  -def run(ctx, host, port, reloader, threaded, extra_files, processes):
  +def run(ctx, host, port, disable_reloader, threaded, extra_files, processes):
       u"""Runs the Werkzeug development server"""
  +    use_reloader = not disable_reloader
       threaded = threaded or tk.asbool(config.get(u"ckan.devserver.threaded"))
       processes = processes or tk.asint(
           config.get(u"ckan.devserver.multiprocess", 1)
  @@ -48,7 +50,7 @@
           host,
           port,
           ctx.obj.app,
  -        use_reloader=reloader,
  +        use_reloader=use_reloader,
           use_evalex=True,
           threaded=threaded,
           processes=processes,
  
verification_info: {"golden_diff": "diff --git a/ckan/cli/server.py b/ckan/cli/server.py\n--- a/ckan/cli/server.py\n+++ b/ckan/cli/server.py\n@@ -5,8 +5,8 @@\n import click\n from werkzeug.serving import run_simple\n \n-from ckan.common import config\n import ckan.plugins.toolkit as tk\n+from ckan.common import config\n \n log = logging.getLogger(__name__)\n \n@@ -14,7 +14,8 @@\n @click.command(u\"run\", short_help=u\"Start development server\")\n @click.option(u\"-H\", u\"--host\", default=u\"localhost\", help=u\"Set host\")\n @click.option(u\"-p\", u\"--port\", default=5000, help=u\"Set port\")\n-@click.option(u\"-r\", u\"--reloader\", default=True, help=u\"Use reloader\")\n+@click.option(u\"-r\", u\"--disable-reloader\", is_flag=True,\n+              help=u\"Disable reloader\")\n @click.option(\n     u\"-t\", u\"--threaded\", is_flag=True,\n     help=u\"Handle each request in a separate thread\"\n@@ -25,8 +26,9 @@\n     help=u\"Maximum number of concurrent processes\"\n )\n @click.pass_context\n-def run(ctx, host, port, reloader, threaded, extra_files, processes):\n+def run(ctx, host, port, disable_reloader, threaded, extra_files, processes):\n     u\"\"\"Runs the Werkzeug development server\"\"\"\n+    use_reloader = not disable_reloader\n     threaded = threaded or tk.asbool(config.get(u\"ckan.devserver.threaded\"))\n     processes = processes or tk.asint(\n         config.get(u\"ckan.devserver.multiprocess\", 1)\n@@ -48,7 +50,7 @@\n         host,\n         port,\n         ctx.obj.app,\n-        use_reloader=reloader,\n+        use_reloader=use_reloader,\n         use_evalex=True,\n         threaded=threaded,\n         processes=processes,\n", "issue": "No way to disable reloader when starting the development server\n**CKAN version**\r\n2.9.0\r\n\r\n**Describe the bug**\r\nWhen trying to start the development server without a reloader i encountered problems with the `--reloader` argument.\r\nThe reloader option requires a TEXT argument, therefore i expected that --reloader False disables the reloader.\r\n\r\n\r\n**Steps to reproduce**\r\nStart ckan with following command:\r\n\r\n`ckan -c [PATH_TO_CONFIG] run --host 0.0.0.0 --reloader False`\r\n\r\n**Expected behavior**\r\nServer starts without reloader\r\n\r\n**Additional details**\r\n\r\nCurrently the `reloader` option is passed as string and if it's not provided it defaults to the boolean value `True`\r\n\r\nSo we have two cases when the `run_simple` method is called:\r\n1. `--reloader` argument is not provided --> reloader=True\r\n2. `--reloader` argument is provided --> some string is passed as reloader argument to the `run_simple` method, which evaluates to true in the if statement distinguishing whether the reloader should be used or not.\r\n\r\nSo the `--reloader` argument does not affect anything.\r\n\r\n_My suggestion:_ rename the argument to `disable-reloader` and turn it into a boolean flag. This enables the user to disable the reloader and the default behaviour (i.e. the dev server starts with a reloader) stays the same.\r\n\n", "before_files": [{"content": "# encoding: utf-8\n\nimport logging\n\nimport click\nfrom werkzeug.serving import run_simple\n\nfrom ckan.common import config\nimport ckan.plugins.toolkit as tk\n\nlog = logging.getLogger(__name__)\n\n\n@click.command(u\"run\", short_help=u\"Start development server\")\n@click.option(u\"-H\", u\"--host\", default=u\"localhost\", help=u\"Set host\")\n@click.option(u\"-p\", u\"--port\", default=5000, help=u\"Set port\")\n@click.option(u\"-r\", u\"--reloader\", default=True, help=u\"Use reloader\")\n@click.option(\n    u\"-t\", u\"--threaded\", is_flag=True,\n    help=u\"Handle each request in a separate thread\"\n)\n@click.option(u\"-e\", u\"--extra-files\", multiple=True)\n@click.option(\n    u\"--processes\", type=int, default=0,\n    help=u\"Maximum number of concurrent processes\"\n)\n@click.pass_context\ndef run(ctx, host, port, reloader, threaded, extra_files, processes):\n    u\"\"\"Runs the Werkzeug development server\"\"\"\n    threaded = threaded or tk.asbool(config.get(u\"ckan.devserver.threaded\"))\n    processes = processes or tk.asint(\n        config.get(u\"ckan.devserver.multiprocess\", 1)\n    )\n    if threaded and processes > 1:\n        tk.error_shout(u\"Cannot have a multithreaded and multi process server\")\n        raise click.Abort()\n\n    log.info(u\"Running server {0} on port {1}\".format(host, port))\n\n    config_extra_files = tk.aslist(\n        config.get(u\"ckan.devserver.watch_patterns\")\n    )\n    extra_files = list(extra_files) + [\n        config[u\"__file__\"]\n    ] + config_extra_files\n\n    run_simple(\n        host,\n        port,\n        ctx.obj.app,\n        use_reloader=reloader,\n        use_evalex=True,\n        threaded=threaded,\n        processes=processes,\n        extra_files=extra_files,\n    )\n", "path": "ckan/cli/server.py"}]}