예제 #1
0
def write_gdir_doc():
    """This is to write the docs for glacierdir automatically."""

    here = os.path.dirname(__file__)
    origfile = os.path.join(here, '_templates', 'basenames.txt')
    filename = os.path.join(here, '_generated', 'basenames.txt')

    try:
        os.makedirs(os.path.dirname(filename))
    except FileExistsError:
        pass

    shutil.copyfile(origfile, filename)

    from oggm.cfg import BASENAMES

    cnt = ['    ']
    for k in sorted(BASENAMES.keys()):
        cnt += [BASENAMES.info_str(k)] + ['    ']
    cnt = '\n'.join(cnt)

    file = open(filename, 'a')
    try:
        file.write(cnt)
    finally:
        file.close()
예제 #2
0
파일: conf.py 프로젝트: bearecinos/oggm
def write_gdir_doc():
    """This is to write the docs for glacierdir automatically."""

    here = os.path.dirname(__file__)
    origfile = os.path.join(here, '_templates', 'basenames.txt')
    filename = os.path.join(here, '_generated', 'basenames.txt')

    try:
        os.makedirs(os.path.dirname(filename))
    except FileExistsError:
        pass

    shutil.copyfile(origfile, filename)

    from oggm.cfg import BASENAMES

    cnt = ['    ']
    for k in sorted(BASENAMES.keys()):
        cnt += [BASENAMES.info_str(k)] + ['    ']
    cnt = '\n'.join(cnt)

    file = open(filename, 'a')
    try:
        file.write(cnt)
    finally:
        file.close()
예제 #3
0
def write_gdir_doc():
    """This is to write the docs for glacierdir automatically."""

    origfile = os.path.join(os.path.dirname(__file__), 'glacierdir.txt')
    filename = os.path.join(os.path.dirname(__file__), 'glacierdir-gen.rst')

    shutil.copyfile(origfile, filename)

    from oggm.cfg import BASENAMES

    cnt = ['    ']
    for k in sorted(BASENAMES.keys()):
        cnt += [BASENAMES.info_str(k)] + ['    ']
    cnt = '\n'.join(cnt)

    file = open(filename, 'a')
    try:
        file.write(cnt)
    finally:
        file.close()
예제 #4
0
파일: conf.py 프로젝트: OGGM/oggm
def write_gdir_doc():
    """This is to write the docs for glacierdir automatically."""

    origfile = os.path.join(os.path.dirname(__file__), "glacierdir.txt")
    filename = os.path.join(os.path.dirname(__file__), "glacierdir-gen.rst")

    shutil.copyfile(origfile, filename)

    from oggm.cfg import BASENAMES

    cnt = ["    "]
    for k in sorted(BASENAMES.keys()):
        cnt += [BASENAMES.info_str(k)] + ["    "]
    cnt = "\n".join(cnt)

    file = open(filename, "a")
    try:
        file.write(cnt)
    finally:
        file.close()