def load_library(libname, cdll=False):
    if paths.is_frozen():
        libfile = os.path.join(paths.embedded_data_path(),
                               "accessible_output2", "lib", libname)
    else:
        libfile = os.path.join(paths.module_path(), "lib", libname)
    if not os.path.exists(libfile):
        _cxfreeze_libfile = os.path.join(paths.embedded_data_path(), "lib",
                                         "accessible_output2", "lib", libname)
        if os.path.exists(_cxfreeze_libfile):
            libfile = _cxfreeze_libfile
    if cdll:
        return ctypes.cdll[libfile]
    return ctypes.windll[libfile]
Beispiel #2
0
def load_library(libname, cdll=False):
 if paths.is_frozen():
  libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname)
 else:
  libfile = os.path.join(paths.module_path(), 'lib', libname)
 if cdll:
  return ctypes.cdll[libfile]
 else:
  return ctypes.windll[libfile]
Beispiel #3
0
def load_library(libname, cdll=False):
	if paths.is_frozen():
		libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname)
	else:
		libfile = os.path.join(paths.module_path(), 'lib', libname)
	if cdll:
		return ctypes.cdll[libfile]
	else:
		return ctypes.windll[libfile]
Beispiel #4
0
def get_locale_path(module=None):
    """

    Args:
      module: (Default value = None)

    Returns:

    """
    if not paths.is_frozen():
        return os.path.join(os.path.split(module.__file__)[0], "locale")
    return os.path.join(paths.embedded_data_path(), "locale")
import os
from platform_utils.paths import module_path, is_frozen, embedded_data_path

if is_frozen():
    x86_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x86')
    x64_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x64')
else:
    x86_path = os.path.join(module_path(), '..', 'lib', 'x86')
    x64_path = os.path.join(module_path(), '..', 'lib', 'x64')
Beispiel #6
0
from platform_utils import paths
import pickle
import babel.core

if paths.is_frozen():
    import pytz

    pytz.resource_exists = lambda name: False
    with open(os.path.join(paths.embedded_data_path(), "babel", "global.dat"),
              "rb") as fp:
        babel.core._global_data = pickle.load(fp)

import babel.localedata

if paths.is_frozen():
    babel.localedata._dirname = os.path.join(paths.embedded_data_path(),
                                             "locale-data")
Beispiel #7
0
import os
from platform_utils.paths import module_path, is_frozen, embedded_data_path

if is_frozen():
 x86_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x86')
 x64_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x64')
else:
 x86_path = os.path.join(module_path(), '..', 'lib', 'x86')
 x64_path = os.path.join(module_path(), '..', 'lib', 'x64')