sbin/sync/fabfile.py
changeset 761 08f962473d45
parent 759 6d341beaf632
child 769 a49769a3088d
equal deleted inserted replaced
760:6a7fa48480d0 761:08f962473d45
    29     
    29     
    30 def get_remote_env(remotepath, remotevirtualenvpath, platform_web_module, settings_key):
    30 def get_remote_env(remotepath, remotevirtualenvpath, platform_web_module, settings_key):
    31     activate_path = os.path.join(remotevirtualenvpath, "bin/activate")
    31     activate_path = os.path.join(remotevirtualenvpath, "bin/activate")
    32     res = ""
    32     res = ""
    33     with prefix("source \"%s\"" % activate_path), prefix("export PYTHONPATH=\"%s\"" % remotepath), cd(remotepath):
    33     with prefix("source \"%s\"" % activate_path), prefix("export PYTHONPATH=\"%s\"" % remotepath), cd(remotepath):
    34         tempfilepath = run("mktemp ldtplatform.XXXXXX")
    34         tempfilepath = run("mktemp --tmpdir ldtplatform.XXXXXX")
    35         with settings(warn_only=True):
    35         with settings(warn_only=True):
    36             run("echo \"import os\" > %s" % (tempfilepath))
    36             run("echo \"import os\" > %s" % (tempfilepath))
    37             map(lambda str: run("echo \"%s\" >> %s" % (str, tempfilepath)),
    37             map(lambda str: run("echo \"%s\" >> %s" % (str, tempfilepath)),
    38                 ["os.environ.setdefault('DJANGO_SETTINGS_MODULE', '%s.settings')" % (platform_web_module),
    38                 ["os.environ.setdefault('DJANGO_SETTINGS_MODULE', '%s.settings')" % (platform_web_module),
    39                  "from django.conf import settings",
    39                  "from django.conf import settings",