prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `sync_stores` doesn't handle disabled projects
  We addressed the similar issue for `update_stores` #4198.
  `sync_stores` should work for disabled projects as well https://github.com/translate/pootle/issues/4198#issuecomment-161717337.
  
  
  </issue>
  <code>
  [start of pootle/apps/pootle_app/management/commands/sync_stores.py]
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 #
  4 # Copyright (C) Pootle contributors.
  5 #
  6 # This file is a part of the Pootle project. It is distributed under the GPL3
  7 # or later license. See the LICENSE file for a copy of the license and the
  8 # AUTHORS file for copyright and authorship information.
  9 
  10 import os
  11 os.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'
  12 from optparse import make_option
  13 
  14 from pootle_app.management.commands import PootleCommand
  15 
  16 
  17 class Command(PootleCommand):
  18     option_list = PootleCommand.option_list + (
  19         make_option(
  20             '--overwrite',
  21             action='store_true',
  22             dest='overwrite',
  23             default=False,
  24             help="Don't just save translations, but "
  25                  "overwrite files to reflect state in database",
  26         ),
  27         make_option(
  28             '--skip-missing',
  29             action='store_true',
  30             dest='skip_missing',
  31             default=False,
  32             help="Ignore missing files on disk",
  33         ),
  34         make_option(
  35             '--force',
  36             action='store_true',
  37             dest='force',
  38             default=False,
  39             help="Don't ignore stores synced after last change",
  40         ),
  41     )
  42     help = "Save new translations to disk manually."
  43 
  44     def handle_all_stores(self, translation_project, **options):
  45         translation_project.sync(
  46             conservative=not options['overwrite'],
  47             skip_missing=options['skip_missing'],
  48             only_newer=not options['force']
  49         )
  50 
  51     def handle_store(self, store, **options):
  52         store.sync(
  53             conservative=not options['overwrite'],
  54             update_structure=options['overwrite'],
  55             skip_missing=options['skip_missing'],
  56             only_newer=not options['force']
  57         )
  58
  [end of pootle/apps/pootle_app/management/commands/sync_stores.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/pootle/apps/pootle_app/management/commands/sync_stores.py b/pootle/apps/pootle_app/management/commands/sync_stores.py
  --- a/pootle/apps/pootle_app/management/commands/sync_stores.py
  +++ b/pootle/apps/pootle_app/management/commands/sync_stores.py
  @@ -40,13 +40,15 @@
           ),
       )
       help = "Save new translations to disk manually."
  +    process_disabled_projects = True
   
       def handle_all_stores(self, translation_project, **options):
  -        translation_project.sync(
  -            conservative=not options['overwrite'],
  -            skip_missing=options['skip_missing'],
  -            only_newer=not options['force']
  -        )
  +        if translation_project.directory_exists_on_disk():
  +            translation_project.sync(
  +                conservative=not options['overwrite'],
  +                skip_missing=options['skip_missing'],
  +                only_newer=not options['force']
  +            )
   
       def handle_store(self, store, **options):
           store.sync(
  
verification_info: {"golden_diff": "diff --git a/pootle/apps/pootle_app/management/commands/sync_stores.py b/pootle/apps/pootle_app/management/commands/sync_stores.py\n--- a/pootle/apps/pootle_app/management/commands/sync_stores.py\n+++ b/pootle/apps/pootle_app/management/commands/sync_stores.py\n@@ -40,13 +40,15 @@\n         ),\n     )\n     help = \"Save new translations to disk manually.\"\n+    process_disabled_projects = True\n \n     def handle_all_stores(self, translation_project, **options):\n-        translation_project.sync(\n-            conservative=not options['overwrite'],\n-            skip_missing=options['skip_missing'],\n-            only_newer=not options['force']\n-        )\n+        if translation_project.directory_exists_on_disk():\n+            translation_project.sync(\n+                conservative=not options['overwrite'],\n+                skip_missing=options['skip_missing'],\n+                only_newer=not options['force']\n+            )\n \n     def handle_store(self, store, **options):\n         store.sync(\n", "issue": "`sync_stores` doesn't handle disabled projects\nWe addressed the similar issue for `update_stores` #4198.\n`sync_stores` should work for disabled projects as well https://github.com/translate/pootle/issues/4198#issuecomment-161717337.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport os\nos.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'\nfrom optparse import make_option\n\nfrom pootle_app.management.commands import PootleCommand\n\n\nclass Command(PootleCommand):\n    option_list = PootleCommand.option_list + (\n        make_option(\n            '--overwrite',\n            action='store_true',\n            dest='overwrite',\n            default=False,\n            help=\"Don't just save translations, but \"\n                 \"overwrite files to reflect state in database\",\n        ),\n        make_option(\n            '--skip-missing',\n            action='store_true',\n            dest='skip_missing',\n            default=False,\n            help=\"Ignore missing files on disk\",\n        ),\n        make_option(\n            '--force',\n            action='store_true',\n            dest='force',\n            default=False,\n            help=\"Don't ignore stores synced after last change\",\n        ),\n    )\n    help = \"Save new translations to disk manually.\"\n\n    def handle_all_stores(self, translation_project, **options):\n        translation_project.sync(\n            conservative=not options['overwrite'],\n            skip_missing=options['skip_missing'],\n            only_newer=not options['force']\n        )\n\n    def handle_store(self, store, **options):\n        store.sync(\n            conservative=not options['overwrite'],\n            update_structure=options['overwrite'],\n            skip_missing=options['skip_missing'],\n            only_newer=not options['force']\n        )\n", "path": "pootle/apps/pootle_app/management/commands/sync_stores.py"}]}