File: __init__.py

package info (click to toggle)
manimpango 0.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,804 kB
  • sloc: python: 1,252; sh: 164; makefile: 18
file content (33 lines) | stat: -rw-r--r-- 793 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
import os
import platform
import shutil
from pathlib import Path


def set_dll_search_path():
    # Python 3.8 no longer searches for DLLs in PATH, so we have to add
    # everything in PATH manually.
    if (
        os.name != "nt"
        or "GCC" in platform.python_compiler()
        or not hasattr(os, "add_dll_directory")
    ):
        return
    for p in os.environ.get("PATH", "").split(os.pathsep):
        try:
            os.add_dll_directory(p)
        except OSError:
            pass


def delete_media_dir():
    a = Path("media")  # absolute to the running dir
    if a.exists():
        shutil.rmtree(a)


set_dll_search_path()
delete_media_dir()
CASES_DIR = Path(Path(__file__).parent, "cases").absolute()
FONT_DIR = Path(__file__).parent / "fonts"