from django.core.management.base import BaseCommand
from fabric.api import *
import fabfile
from fabtastic.util.req_syncer import compare_reqs_to_env

class Command(BaseCommand):
    help = "Compares your current virtualenv to requirements.txt."

    def handle(self, *args, **options):
        missing_pkgs, wrong_version_pkgs = compare_reqs_to_env(env.PIP_REQUIREMENTS_PATH)

        if wrong_version_pkgs:
            print "==== Version mis-matches ===="
            for pkg_tuple in wrong_version_pkgs:
                pkg_name, req_version, local_version = pkg_tuple
                print ' %s %s -> %s' % (pkg_name, req_version, local_version)

        if missing_pkgs:
            print "==== Missing packages ===="
            for pkg_name in missing_pkgs:
                print ' %s' % pkg_name
@@ -596,58 +596,191 @@
 ' %25s
- %25s -%3E %25s' %25 (pkg_name, req_version, local_version
+==%25s in reqs.txt, but %25s==%25s local' %25 (%0A                    pkg_name,%0A                    req_version,%0A                    pkg_name,%0A                    local_version%0A                
 )%0A%0A 
@@ -834,16 +834,26 @@
  Missing
+ (locally)
  package
@@ -932,16 +932,141 @@
 ' %25s' %25 pkg_name
+%0A%0A        if not wrong_version_pkgs and not missing_pkgs:%0A            print %22Your local environment is up to date, good job.%22

Improve output of ft_check_reqs.