def setup(): """Sets paths and initializes modules, to be able to run the tests.""" res = True # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() sys.path.insert(0, pitivi_dir) from pitivi import configure # Make available the compiled C code. sys.path.append(configure.BUILDDIR) subproject_paths = os.path.join(configure.BUILDDIR, "subprojects", "gst-transcoder") _prepend_env_paths(LD_LIBRARY_PATH=subproject_paths, GST_PLUGIN_PATH=subproject_paths, GI_TYPELIB_PATH=subproject_paths, GST_PRESET_PATH=[os.path.join(pitivi_dir, "data", "videopresets"), os.path.join(pitivi_dir, "data", "audiopresets")], GST_ENCODING_TARGET_PATH=[os.path.join(pitivi_dir, "data", "encoding-profiles")]) os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() res = check.check_requirements() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') return res
def setup(): res = True # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) _prepend_env_path("GST_PRESET_PATH", [ os.path.join(pitivi_dir, "data", "videopresets"), os.path.join(pitivi_dir, "data", "audiopresets")]) _prepend_env_path("GST_ENCODING_TARGET_PATH", [ os.path.join(pitivi_dir, "data", "encoding-profiles")]) # Make available the compiled C code. build_dir = get_build_dir() libs_dir = os.path.join(build_dir, "pitivi/coptimizations/.libs") sys.path.append(libs_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() res = check.check_requirements() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') return res
def setup(): """Sets paths and initializes modules, to be able to run the tests.""" # Make sure xdg_*_home return temp dirs, to avoid touching # the config files of the developer. os.environ['XDG_DATA_HOME'] = mkdtemp() os.environ['XDG_CONFIG_HOME'] = mkdtemp() os.environ['XDG_CACHE_HOME'] = mkdtemp() # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() sys.path.insert(0, pitivi_dir) from pitivi import configure # Let Gst overrides from our prefix take precedence over any # other, making sure they are used. This allows us to ensure that # Gst overrides from gst-python are used when within flatpak local_overrides = os.path.join(configure.LIBDIR, "python" + sys.version[:3], "site-packages", "gi", "overrides") gi.overrides.__path__.insert(0, local_overrides) # Make available the compiled C code. sys.path.append(configure.BUILDDIR) subproject_paths = os.path.join(configure.BUILDDIR, "subprojects", "gst-transcoder") _prepend_env_paths(LD_LIBRARY_PATH=subproject_paths, GST_PLUGIN_PATH=subproject_paths, GI_TYPELIB_PATH=subproject_paths, GST_PRESET_PATH=[ os.path.join(pitivi_dir, "data", "videopresets"), os.path.join(pitivi_dir, "data", "audiopresets") ], GST_ENCODING_TARGET_PATH=[ os.path.join(pitivi_dir, "tests", "test-encoding-targets"), os.path.join(pitivi_dir, "data", "encoding-profiles") ]) os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() res = check.check_requirements() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') return res
def setup(): """Sets paths and initializes modules, to be able to run the tests.""" # Make sure xdg_*_home return temp dirs, to avoid touching # the config files of the developer. os.environ['XDG_DATA_HOME'] = mkdtemp() os.environ['XDG_CONFIG_HOME'] = mkdtemp() os.environ['XDG_CACHE_HOME'] = mkdtemp() # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() sys.path.insert(0, pitivi_dir) from pitivi import configure # Let Gst overrides from our prefix take precedence over any # other, making sure they are used. local_overrides = os.path.join(configure.LIBDIR, "python" + sys.version[:3], "site-packages", "gi", "overrides") gi.overrides.__path__.insert(0, local_overrides) # Make sure that flatpak gst-python overrides are always used first. flatpak_gst_python_path = os.path.join("/app/lib/", "python" + sys.version[:3], "site-packages", "gi", "overrides") if os.path.exists(flatpak_gst_python_path): gi.overrides.__path__.insert(0, flatpak_gst_python_path) # Make available the compiled C code. sys.path.append(configure.BUILDDIR) subproject_paths = os.path.join(configure.BUILDDIR, "subprojects", "gst-transcoder") _prepend_env_paths(LD_LIBRARY_PATH=subproject_paths, GST_PLUGIN_PATH=subproject_paths, GI_TYPELIB_PATH=subproject_paths, GST_PRESET_PATH=[os.path.join(pitivi_dir, "data", "videopresets"), os.path.join(pitivi_dir, "data", "audiopresets")], GST_ENCODING_TARGET_PATH=[os.path.join(pitivi_dir, "tests", "test-encoding-targets"), os.path.join(pitivi_dir, "data", "encoding-profiles")]) os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() res = check.check_requirements() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') return res
def setup(): # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make available the compiled C code. libs_dir = os.path.join(pitivi_dir, "pitivi/coptimizations/.libs") sys.path.append(libs_dir) # Make sure the modules are initialized correctly. from pitivi.check import initialize_modules initialize_modules() try: import mock except ImportError, e: raise Exception("Python mock library missing! www.voidspace.org.uk/python/mock", e)
def setup(): # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() os.environ.setdefault("PITIVI_TOP_LEVEL_DIR", pitivi_dir) # Make available the compiled C code. build_dir = get_build_dir() libs_dir = os.path.join(build_dir, "pitivi/coptimizations/.libs") sys.path.append(libs_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() assert check.check_requirements() from pitivi.utils import loggable as log log.init("PITIVI_DEBUG")
def setup(): """Sets paths and initializes modules, to be able to run the tests.""" # Make sure xdg_*_home return temp dirs, to avoid touching # the config files of the developer. os.environ['XDG_DATA_HOME'] = mkdtemp() os.environ['XDG_CONFIG_HOME'] = mkdtemp() os.environ['XDG_CACHE_HOME'] = mkdtemp() # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() sys.path.insert(0, pitivi_dir) from pitivi import configure # Make available the compiled C code. sys.path.append(configure.BUILDDIR) subproject_paths = os.path.join(configure.BUILDDIR, "subprojects", "gst-transcoder") _prepend_env_paths(LD_LIBRARY_PATH=subproject_paths, GST_PLUGIN_PATH=subproject_paths, GI_TYPELIB_PATH=subproject_paths, GST_PRESET_PATH=[ os.path.join(pitivi_dir, "data", "videopresets"), os.path.join(pitivi_dir, "data", "audiopresets") ], GST_ENCODING_TARGET_PATH=[ os.path.join(pitivi_dir, "tests", "test-encoding-targets"), os.path.join(pitivi_dir, "data", "encoding-profiles") ]) os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make sure the modules are initialized correctly. from pitivi import check check.initialize_modules() res = check.check_requirements() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') return res
def setup(): # Make available to configure.py the top level dir. pitivi_dir = get_pitivi_dir() os.environ.setdefault('PITIVI_TOP_LEVEL_DIR', pitivi_dir) # Make available the compiled C code. build_dir = get_build_dir() libs_dir = os.path.join(build_dir, "pitivi/coptimizations/.libs") sys.path.append(libs_dir) # Make sure the modules are initialized correctly. from pitivi.check import initialize_modules initialize_modules() from pitivi.utils import loggable as log log.init('PITIVI_DEBUG') try: import mock except ImportError: print("\n\nPython mock library missing! www.voidspace.org.uk/python/mock\n\n", file=sys.stderr) raise