def handle(self, *args, **options):
        skip = options.get('skip')
        resource_urlhandlers = []
        if not args:
            resource_urlhandlers = URLInfo.objects.filter(auto_update=True)
        else:
            resources = []
            for arg in args:
                try:
                    prj, res = arg.split('.')
                    resources.extend(Resource.objects.filter(project__slug=prj,
                        slug=res) or None)
                except (__HOLE__, TypeError), e:
                    sys.stderr.write((u"No matching resource was found for %s\n" % arg).encode('UTF-8'))

            resource_urlhandlers = URLInfo.objects.filter(resource__in=resources)

        num = resource_urlhandlers.count()

        if num == 0:
            sys.stderr.write("No resources suitable for updating found. Exiting...\n")
            sys.exit()

        sys.stdout.write("A total of %s resources are listed for updating.\n" % num)

        for seq, handler in enumerate(resource_urlhandlers):
            sys.stdout.write((u"Updating resource %s.%s (%s of %s)\n" %
                ( handler.resource.project.slug, handler.resource.slug, seq+1,num)).encode('UTF-8'))
            try:
                handler.update_source_file()
            except Exception, e:
                sys.stderr.write((u"Error updating source file for resource %s.%s\n" %
                    ( handler.resource.project.slug, handler.resource.slug)).encode('UTF-8'))
                sys.stderr.write("Exception was: %s\n" % e)
                if skip:
                    continue
                sys.stderr.write("Aborting...\n")
                sys.exit(1)
            else:
               sys.stdout.write((u"Updated source file for resource %s.%s\n" %
                    (handler.resource.project.slug, handler.resource.slug)).encode('UTF-8'))
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/addons/autofetch/management/commands/txfetch.py/Command.handle