Beispiel #1
0
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# ###################################################

import os
import sys

if __name__ == '__main__':
    #chdir to unknownhorizons root
    os.chdir(os.path.split(os.path.realpath(sys.argv[0]))[0])

    import gettext
    gettext.install('', unicode=True)  # necessary for init_environment
    from run_uh import init_environment, get_fife_path
    init_environment()

    os.chdir(get_fife_path() + '/tools/editor')
    #start editor
    args = [sys.executable, './run.py']
    os.execvp(args[0], args)
Beispiel #2
0
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# ###################################################

import os
import sys

if __name__ == '__main__':
	#chdir to unknownhorizons root
	os.chdir( os.path.split( os.path.realpath( sys.argv[0]) )[0] )

	import gettext
	gettext.install('', unicode=True) # necessary for init_environment
	from run_uh import init_environment, get_fife_path
	init_environment()

	os.chdir(get_fife_path() + '/tools/editor')
	#start editor
	args = [sys.executable, './run.py']
	os.execvp(args[0], args)
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# ###################################################

import os
import sys

if __name__ == "__main__":
    # chdir to unknownhorizons root
    os.chdir(os.path.split(os.path.realpath(sys.argv[0]))[0])

    import gettext

    gettext.install("")  # necessary for init_environment
    from run_uh import init_environment, get_fife_path

    init_environment()

    os.chdir(get_fife_path() + "/tools/editor")
    # start editor
    args = [sys.executable, "./run.py"]
    os.execvp(args[0], args)
Beispiel #4
0
	gettext.install('', unicode=True) # necessary for init_environment

	# prepare sys path and init UH
	def up(path):
		return os.path.split(path)[0]
	uh_path = up(up(os.path.realpath(sys.argv[0])))
	sys.path.append(uh_path)
	from run_uh import init_environment, get_fife_path
	init_environment()

	# append again in case init_environment() restarts
	uh_path = up(up(os.path.realpath(sys.argv[0])))
	sys.path.append(uh_path)

	(options, argv) = get_option_parser().parse_args()
	editor_path = get_fife_path(options.fife_path) + '/tools/editor'
	os.chdir(editor_path)
	sys.path.append(editor_path)

	# Start editor
	class MockOptions:
		plugin_dir = uh_path + '/editor/plugins'
	options = MockOptions()
	mapfile = None
	if len(argv) > 0:
		mapfile = argv[0]

	from scripts.editor import Editor, TDS
	# force UH plugins to be enabled
	TDS.set("Plugins", "UHObjectLoader", True)
	TDS.set("Plugins", "UHMapLoader", True)