from __future__ import print_function

import sys

import sputnik
from sputnik.package_list import (PackageNotFoundException,
                                  CompatiblePackageNotFoundException)

from . import about


def download(lang, force=False, fail_on_exist=True):
    if force:
        sputnik.purge(about.__title__, about.__version__)

    try:
        sputnik.package(about.__title__, about.__version__,
                        about.__models__.get(lang, lang))
        if fail_on_exist:
            print("Model already installed. Please run 'python -m "
                  "spacy.%s.download --force' to reinstall." % lang, file=sys.stderr)
            sys.exit(0)
    except (PackageNotFoundException, CompatiblePackageNotFoundException):
        pass

    package = sputnik.install(about.__title__, about.__version__,
                              about.__models__.get(lang, lang))

    try:
        sputnik.package(about.__title__, about.__version__,
                        about.__models__.get(lang, lang))
    except (PackageNotFoundException, CompatiblePackageNotFoundException):
        print("Model failed to install. Please run 'python -m "
              "spacy.%s.download --force'." % lang, file=sys.stderr)
        sys.exit(1)

    print("Model successfully installed.", file=sys.stderr)

@@ -210,16 +210,35 @@
 t about%0A
+from . import util%0A
 %0A%0Adef do
@@ -1264,16 +1264,53 @@
 xit(1)%0A%0A
+    data_path = util.get_data_path()%0A
     prin
@@ -1340,18 +1340,35 @@
 nstalled
-.%22
+ to %25s%22 %25 data_path
 , file=s

Make installation print data path.