Refactored the devel/bin structure to hopefully make the system work better on Windows.
This commit is contained in:
parent
6323ba965b
commit
f780f469b1
12 changed files with 32 additions and 21 deletions
11
bin/unix/evennia
Executable file
11
bin/unix/evennia
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#! /usr/bin/python2.7
|
||||||
|
"""
|
||||||
|
Linux launcher
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
||||||
|
|
||||||
|
from evennia.server.evennia_launcher import main
|
||||||
|
main()
|
||||||
1
bin/windows/evennia.bat
Normal file
1
bin/windows/evennia.bat
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
@"python" "evennia.py" %*
|
||||||
11
bin/windows/evennia.py
Executable file
11
bin/windows/evennia.py
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#! /usr/bin/python2.7
|
||||||
|
"""
|
||||||
|
Linux launcher
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
||||||
|
|
||||||
|
from evennia.server.evennia_launcher import main
|
||||||
|
main()
|
||||||
19
bin/evennia → evennia/server/evennia_launcher.py
Executable file → Normal file
19
bin/evennia → evennia/server/evennia_launcher.py
Executable file → Normal file
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
EVENNIA SERVER STARTUP SCRIPT
|
EVENNIA SERVER LAUNCHER SCRIPT
|
||||||
|
|
||||||
This is the start point for running Evennia.
|
This is the start point for running Evennia.
|
||||||
|
|
||||||
|
|
@ -22,15 +22,15 @@ import django
|
||||||
SIG = signal.SIGINT
|
SIG = signal.SIGINT
|
||||||
|
|
||||||
# Set up the main python paths to Evennia
|
# Set up the main python paths to Evennia
|
||||||
EVENNIA_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
EVENNIA_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
EVENNIA_BIN = os.path.join(EVENNIA_ROOT, "bin")
|
|
||||||
|
|
||||||
import evennia
|
import evennia
|
||||||
EVENNIA_LIB = os.path.join(os.path.dirname(os.path.abspath(evennia.__file__)))
|
EVENNIA_LIB = os.path.join(os.path.dirname(os.path.abspath(evennia.__file__)))
|
||||||
EVENNIA_RUNNER = os.path.join(EVENNIA_BIN, "evennia_runner.py")
|
EVENNIA_SERVER = os.path.join(EVENNIA_LIB, "server")
|
||||||
|
EVENNIA_RUNNER = os.path.join(EVENNIA_SERVER, "evennia_runner.py")
|
||||||
EVENNIA_TEMPLATE = os.path.join(EVENNIA_LIB, "game_template")
|
EVENNIA_TEMPLATE = os.path.join(EVENNIA_LIB, "game_template")
|
||||||
EVENNIA_BINTESTING = os.path.join(EVENNIA_BIN, "testing")
|
EVENNIA_TESTING = os.path.join(EVENNIA_SERVER, "testing")
|
||||||
EVENNIA_DUMMYRUNNER = os.path.join(EVENNIA_BINTESTING, "dummyrunner.py")
|
EVENNIA_DUMMYRUNNER = os.path.join(EVENNIA_TESTING, "dummyrunner.py")
|
||||||
|
|
||||||
TWISTED_BINARY = "twistd"
|
TWISTED_BINARY = "twistd"
|
||||||
|
|
||||||
|
|
@ -59,11 +59,6 @@ TWISTED_MIN = '12.0'
|
||||||
DJANGO_MIN = '1.7'
|
DJANGO_MIN = '1.7'
|
||||||
DJANGO_REC = '1.7'
|
DJANGO_REC = '1.7'
|
||||||
|
|
||||||
# add Evennia root to PYTHONPATH note that bin/evennia.py is
|
|
||||||
# automatically added to sys.modules and will be imported first, which
|
|
||||||
# is not what we want. So we remove it manually and set the path so
|
|
||||||
# the root/evennia package is found first instead.
|
|
||||||
del sys.modules["evennia"]
|
|
||||||
sys.path[0] = EVENNIA_ROOT
|
sys.path[0] = EVENNIA_ROOT
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
|
|
@ -656,7 +651,7 @@ def init_game_directory(path, check_db=True):
|
||||||
print ERROR_WINDOWS_WIN32API
|
print ERROR_WINDOWS_WIN32API
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(EVENNIA_BIN, TWISTED_BINARY)):
|
if not os.path.exists(os.path.join(EVENNIA_SERVER, TWISTED_BINARY)):
|
||||||
# Test for executable twisted batch file. This calls the
|
# Test for executable twisted batch file. This calls the
|
||||||
# twistd.py executable that is usually not found on the
|
# twistd.py executable that is usually not found on the
|
||||||
# path in Windows. It's not enough to locate
|
# path in Windows. It's not enough to locate
|
||||||
11
setup.py
11
setup.py
|
|
@ -26,17 +26,10 @@ def get_scripts():
|
||||||
Determine which executable scripts should be added. For Windows,
|
Determine which executable scripts should be added. For Windows,
|
||||||
this means creating a .bat file.
|
this means creating a .bat file.
|
||||||
"""
|
"""
|
||||||
execlist = []
|
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
# Windows
|
return [os.path.join("bin", "windows", "evennia.bat"), os.path.join("bin", "windows", "evennia.py")]
|
||||||
with open(os.path.join("bin", "evennia.bat"), "w") as bat_file:
|
|
||||||
bat_file.write("@\"%s\" \"%s\" %%*" % (sys.executable, "evennia"))
|
|
||||||
execlist.extend(["bin/evennia.bat", "bin/evennia"])
|
|
||||||
else:
|
else:
|
||||||
# Linux, Mac
|
return [os.path.join("bin", "unix", "evennia")]
|
||||||
execlist.append("bin/evennia")
|
|
||||||
execlist.append("bin/evennia_runner.py")
|
|
||||||
return execlist
|
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue