(local_run_value, package_path)
Initialize path values for sdaps
Initialize path values for sdaps
Initialize path values for sdaps
def init(local_run_value, package_path):
    '''Initialize path values for sdaps
    '''
    global local_run, build_dir, lib_build_dir, source_dir, prefix

    # Initialize local_run
    local_run = local_run_value

    base_dir = os.path.split(os.path.abspath(package_path))[0]

    if local_run:
        source_dir = base_dir

        from pkg_resources import get_build_platform
        from distutils.sysconfig import get_python_version

        # Initialize gettext
        init_gettext(os.path.join(
            base_dir,
            'build',
            'mo'))

        # Initialize build_dir
        build_dir = os.path.join(base_dir, 'build', 'share', 'sdaps')

        # Initialize build_dir
        lib_build_dir = os.path.join(
            base_dir,
            'build', 'lib.%s-%s' % (get_build_platform(), get_python_version()),
            'sdaps')
    else:
        # Look for the data in the parent directories
        path = base_dir
        while True:
            if os.path.exists(os.path.join(path, 'share', 'sdaps')):
                prefix = path
                break
            new_path = os.path.split(path)[0]
            assert not path == new_path, "could not find locales" # Wir wären oben angekommen
            path = new_path

        # Initialize gettext
        init_gettext(os.path.join(prefix, 'share', 'locale'))
def init ( local_run_value , package_path ) : global local_run , build_dir , lib_build_dir , source_dir , prefix # Initialize local_run local_run = local_run_value base_dir = os . path . split ( os . path . abspath ( package_path ) ) [ 0 ] if local_run : source_dir = base_dir from pkg_resources import get_build_platform from distutils . sysconfig import get_python_version # Initialize gettext init_gettext ( os . path . join ( base_dir , 'build' , 'mo' ) ) # Initialize build_dir build_dir = os . path . join ( base_dir , 'build' , 'share' , 'sdaps' ) # Initialize build_dir lib_build_dir = os . path . join ( base_dir , 'build' , 'lib.%s-%s' % ( get_build_platform ( ) , get_python_version ( ) ) , 'sdaps' ) else : # Look for the data in the parent directories path = base_dir while True : if os . path . exists ( os . path . join ( path , 'share' , 'sdaps' ) ) : prefix = path break new_path = os . path . split ( path ) [ 0 ] assert not path == new_path , "could not find locales" # Wir wären oben angekommen path = new_path # Initialize gettext init_gettext ( os . path . join ( prefix , 'share' , 'locale' ) )