Exemple #1
0
def _localdir_texlive(osname=""):
    """
prototype::
    arg = str: osname = "" in [OS_WIN , OS_LINUX , OS_MAC];
          the name of the ¨os (logical, isn't it ?), that can be found
          automatically if you use the default value ``osname = ""``

    return = PPath ;
             the path of the ¨texlive directory where we have to put special
             ¨latex packages.
    """
    if osname == "":
        osname = system()

    if osname == OS_WIN:
        localdir = runthis("kpsexpand '$TEXMFLOCAL'")
        localdir = PPath(localdir.strip()).normpath

    elif osname in [OS_LINUX, OS_MAC]:
        localdir = runthis('kpsewhich --var-value=TEXMFLOCAL')
        localdir = PPath(localdir.strip()).normpath

    else:
        raise OSError("unsupported OS << {0} >>.".format(osname))

    return localdir