[Elisa-commits] Changeset 4786 by lionel
Linda
linda at fluendo.com
Tue Jan 29 17:02:43 CET 2008
Hola,
I'm Linda, the friendly SVN commit spy.
On Tue, 29 Jan 2008 16:02:40 -0000, lionel has committed some new stuff. The
log message was:
"""
* setup.py:
* win32/__init__.py:
* win32/elisa.ico:
* win32/setup.nsi:
* win32/tools.py:
* win32/win_set_env.py:
rename win32 package to mswin32 to avoid conflict
"""
Maintainers of changed files are:
- trunk/mswin32/win_set_env.py
* Lionel Martin <lionel at fluendo.com>
Please see https://code.fluendo.com/elisa/trac/changeset/4786 for details about this commit!
Diff of the changeset appears below:
--- trunk/ChangeLog
+++ trunk/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-29 Lionel Martin <lionel at fluendo.com>
+
+ * setup.py:
+ * win32/__init__.py:
+ * win32/elisa.ico:
+ * win32/setup.nsi:
+ * win32/tools.py:
+ * win32/win_set_env.py:
+ rename win32 package to mswin32 to avoid conflict
+
2008-01-29 Alessandro Decina <alessandro at fluendo.com>
* elisa/plugins/good/gstreamer_plugin/gst_metadata.py:
--- trunk/mswin32/win_set_env.py
+++ trunk/mswin32/win_set_env.py
@@ -1,0 +1,164 @@
+# -*- coding: utf-8 -*-
+# Elisa - Home multimedia server
+# Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com).
+# All rights reserved.
+#
+# This file is available under one of two license agreements.
+#
+# This file is licensed under the GPL version 3.
+# See "LICENSE.GPL" in the root of this distribution including a special
+# exception to use Elisa with Fluendo's plugins.
+#
+# The GPL part of Elisa is also available under a commercial licensing
+# agreement from Fluendo.
+# See "LICENSE.Elisa" in the root directory of this distribution package
+# for details on that license.
+
+
+__maintainer__ = 'Lionel Martin <lionel at fluendo.com>'
+
+"""
+Module loaded before Elisa
+used to set the windows version evironement
+"""
+
+import sys, platform, os
+
+if platform.system() == 'Windows':
+
+ relative_library_paths = [
+ 'python\\Dlls',
+ 'gtk-deps',
+ 'glib\\glib-2.14.2\\bin',
+ 'gtk\\gtk+-2.12.1\\bin',
+ 'gstreamer\\0.10\\bin',
+ 'gstreamer\\0.10\\lib\\gstreamer-0.10',
+ 'gstreamer\\0.10\\deps',
+ 'pigment\\pigment-0.3.4.1',
+ 'temp'
+ ]
+
+ relative_python_paths = [
+ 'python\\Lib\\site-packages\\setuptools-0.6c7-py2.5.egg',
+ 'python\\Dlls',
+ 'python\\Lib',
+ 'python\\Lib\\site-packages',
+ 'python\\Lib\\site-packages\\PIL',
+ 'python\\Lib\\site-packages\\gtk-2.0',
+ 'python\\Lib\\site-packages\\zope',
+ 'gstreamer\\0.10\\site-packages',
+ 'gstreamer\\0.10\\site-packages\\gst-0.10',
+ 'pigment\\pigment-python-0.3.2.1',
+ 'temp',
+ ''
+ ]
+
+
+ def get_prefix():
+ if sys.argv[0].endswith('elisa.exe'):
+ return sys.prefix
+
+ if os.environ.has_key('ELISA_DEPS'):
+ return os.environ['ELISA_DEPS']
+
+ return sys.prefix
+
+ def add_python_path(path):
+ sys.path.insert(0,path)
+
+
+ def add_env(key, new_value, env_file=None):
+ if os.environ.has_key(key):
+ value = os.environ[key]
+ os.environ[key] = "%s;%s" % (new_value, value)
+ else:
+ os.environ[key] = new_value
+
+ if env_file != None:
+ t = "SET %s=%s;%%%s%%\r\n" % (key, new_value, key)
+ env_file.write(t)
+
+
+ def add_library_paths(env_file):
+ #add relavite path to the system path
+ new_value = ''
+ prefix = get_prefix()
+ for path in relative_library_paths:
+ lib_path = "%s\\%s" % (prefix, path)
+ add_env('PATH', lib_path, None)
+ new_value = "%s;%s" % (new_value, lib_path)
+
+ if env_file != None:
+ key = 'PATH'
+ t = "SET %s=%s;%%%s%%\r\n" % (key, new_value, key)
+ env_file.write(t)
+
+ def add_python_paths(env_file):
+ new_value = ''
+ prefix = get_prefix()
+ #add relavite path to the system path
+ for path in relative_python_paths:
+ lib_path = "%s\\%s" % (prefix, path)
+ add_python_path(lib_path)
+ new_value = "%s;%s" % (new_value, lib_path)
+
+ if env_file != None:
+ key = 'PYTHONPATH'
+ t = "SET %s=%s;%%%s%%\r\n" % (key, new_value, key)
+ env_file.write(t)
+
+ def show_path():
+ for p in sys.path:
+ print p
+
+
+ def install_eggs():
+ from setuptools.command import easy_install
+ path = "%s\\eggs" % (get_prefix())
+ if os.path.exists(path):
+ for egg in os.listdir(path):
+ if egg[-3:] == 'egg':
+ egg_path = "%s\\%s" % (path, egg)
+ #easy_install.main([egg_path])
+ add_python_path(egg_path)
+
+
+ env_file = None
+ try:
+ filepath = os.path.join(os.path.abspath(os.curdir), 'set_env.bat')
+ env_file = open(filepath, 'w')
+ except:
+ print "Can't write set_env.bat file"
+
+ #set the Gstreamer plugin path
+ prefix = get_prefix()
+ add_env('GST_PLUGIN_PATH', "%s\\%s" % (prefix, 'gstreamer\\0.10\\lib\\gstreamer-0.10'), env_file)
+ add_env('PGM_PLUGIN_PATH', "%s\\%s" % (prefix, 'pigment\\pigment-0.3.4.1\\pigment-0.3\\0.3.4.1'), env_file)
+ add_env('ELISA_PLUGIN_PATH', "%s\\%s" % (prefix, 'eggs'), env_file)
+
+ add_library_paths(env_file)
+ add_python_paths(env_file)
+ install_eggs()
+
+
+ if sys.argv[0].endswith('elisa.exe'):
+ pass
+ #add_env('ELISA_DEBUG', "*:5")
+ #FIXME : does not work under windows !!!
+ #sys.argv.append('-l')
+
+ if env_file != None:
+ env_file.close()
+
+ if 'interactive' in sys.argv[1:]:
+ print "enter in interactive mode"
+ import pdb
+ pdb.set_trace()
+ sys.exit()
+
+ for arg in sys.argv[1:]:
+ if arg[0] != '-' and arg[-3:] =='.py':
+ import_line = arg[0:-3].replace('\\', '.')
+ mod = __import__(import_line)
+ sys.exit()
+ --- trunk/setup.py
+++ trunk/setup.py
@@ -24,7 +24,7 @@
if platform.system() == 'Windows' and os.environ.has_key('ELISA_DEPS'):
#Load the developement environement for windows
- from win32 import win_set_env
+ from mswin32 import win_set_env
from elisa.core import __version__, log
@@ -230,13 +230,13 @@
pass
elif platform.system() == 'Windows':
- module_include = ['tarfile', 'md5', 'win32file']
+ module_include = ['tarfile', 'md5']
package_include = ['distutils', 'win32']
module_exclude = ['gst', 'pygst', 'elisa', 'twisted', 'pgm', 'gtk',
'gobject']
dll_exclude = ['libglade-2.0-0.dll']
- options = {"custom_boot_script" : 'win32/win_set_env.py',
+ options = {"custom_boot_script" : 'mswin32/win_set_env.py',
"includes" : module_include,
"packages" : package_include,
"excludes" : module_exclude,
Feel free to slap lionel if he did something wrong. I'm not
able to determine that.
Cheers,
Linda
More information about the Elisa-commits
mailing list