~comnets/openwns-sdk/openwns-sdk--series--0.9

« back to all changes in this revision

Viewing changes to playground.py

  • Committer: Daniel Bueltmann
  • Date: 2008-11-07 10:00:10 UTC
  • Revision ID: dbn@comnets.rwth-aachen.de-20081107100010-ipfqhr8k0z6m0z98
Modified wnsbase.rcs.Output.Output to handle bzr error messages properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    if not os.path.exists("sandbox"):
49
49
        os.mkdir("sandbox")
50
50
 
51
 
    # The wnsrc.py will always be copied.
52
 
    shutil.copy("config/wnsrc.py", wnsDir)
53
 
    if not os.environ.has_key("PYTHONPATH") or wnsDir not in os.environ["PYTHONPATH"]:
54
 
        print "\nERROR:"
55
 
        print "Please add '" + wnsDir + "' to the environment variable PYTHONPATH"
56
 
        print "You have three options:"
57
 
        print "1.) type 'export PYTHONPATH=$PYTHONPATH:"+wnsDir+"' in your current shell"
58
 
        print "    This affects only your current shell!"
59
 
        print "2.) add the above line to your ~/.bashrc"
60
 
        print "    Prefered: next time you login the variable will already be set."
61
 
        print "3.) call " + os.path.join(os.getcwd(), "bin", "setEnvironment")
62
 
        print "    Again, this affects only your current shell!"
63
 
        print
64
 
        sys.exit(1)
65
 
 
66
51
def installWNSBase():
67
52
    """ Installs wnsbase package to the sandbox.
68
53
 
88
73
installEnvironment()
89
74
installWNSBase()
90
75
 
91
 
import wnsrc
 
76
try:
 
77
    import wnsrc
 
78
except:
 
79
    import sys
 
80
    wnsDir = os.path.join(os.environ["HOME"], ".wns")
 
81
    sys.path.append(wnsDir)
 
82
    import wnsrc
 
83
 
92
84
import wnsbase.playground.Core
93
85
 
94
86
if __name__ == "__main__":