
from django.core.management import BaseCommand

from ...event import sync_events


class Command(BaseCommand):
    def handle(self, *args, **options):
        num_new_events, num_updated_ids, num_deleted_ids, \
            unsynced_event_names = sync_events()
        print("{} new events, {} event ids updated,"
              " {} event ids deleted"
              .format(num_new_events, num_updated_ids, num_deleted_ids))
        if unsynced_event_names:
            print("unsynced event names:\n    {}"
                  .format('\n    '.join(unsynced_event_names)))


from __future__ import unicode_literals

from django.core.management import BaseCommand

from ...event import sync_events


class Command(BaseCommand):
    def handle(self, *args, **options):
        num_new_events, num_updated_ids, num_deleted_ids, \
            unsynced_event_names = sync_events()
        print("{} new events, {} event ids updated,"
              " {} event ids deleted"
              .format(num_new_events, num_updated_ids, num_deleted_ids))
        if unsynced_event_names:
            print("unsynced event names:\n    {}"
                  .format('\n    '.join(unsynced_event_names)))

Fix issue with management command log output and non ascii event names
Fix issue with management command log output and non ascii event names

+ 
+ from __future__ import unicode_literals
  
  from django.core.management import BaseCommand
  
  from ...event import sync_events
  
  
  class Command(BaseCommand):
      def handle(self, *args, **options):
          num_new_events, num_updated_ids, num_deleted_ids, \
              unsynced_event_names = sync_events()
          print("{} new events, {} event ids updated,"
                " {} event ids deleted"
                .format(num_new_events, num_updated_ids, num_deleted_ids))
          if unsynced_event_names:
              print("unsynced event names:\n    {}"
                    .format('\n    '.join(unsynced_event_names)))
  
Fix issue with management command log output and non ascii event names
## Code Before:

from django.core.management import BaseCommand

from ...event import sync_events


class Command(BaseCommand):
    def handle(self, *args, **options):
        num_new_events, num_updated_ids, num_deleted_ids, \
            unsynced_event_names = sync_events()
        print("{} new events, {} event ids updated,"
              " {} event ids deleted"
              .format(num_new_events, num_updated_ids, num_deleted_ids))
        if unsynced_event_names:
            print("unsynced event names:\n    {}"
                  .format('\n    '.join(unsynced_event_names)))

## Instruction:
Fix issue with management command log output and non ascii event names
## Code After:

from __future__ import unicode_literals

from django.core.management import BaseCommand

from ...event import sync_events


class Command(BaseCommand):
    def handle(self, *args, **options):
        num_new_events, num_updated_ids, num_deleted_ids, \
            unsynced_event_names = sync_events()
        print("{} new events, {} event ids updated,"
              " {} event ids deleted"
              .format(num_new_events, num_updated_ids, num_deleted_ids))
        if unsynced_event_names:
            print("unsynced event names:\n    {}"
                  .format('\n    '.join(unsynced_event_names)))
