diff options
author | Sunaina Pai <sunainapai.in@gmail.com> | 2018-03-17 14:45:21 +0530 |
---|---|---|
committer | Sunaina Pai <sunainapai.in@gmail.com> | 2018-03-17 14:45:21 +0530 |
commit | 62d0aa159fc046a27bed47e337d787a08f4687d0 (patch) | |
tree | c1162f14377890c290d2ad114b3892cbb9848975 /test/path.py |
Add makesite: A simple static site generator
Diffstat (limited to 'test/path.py')
-rw-r--r-- | test/path.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/path.py b/test/path.py new file mode 100644 index 0000000..38c0991 --- /dev/null +++ b/test/path.py @@ -0,0 +1,16 @@ +import os +import tempfile +import shutil + + +def temppath(*paths): + return os.path.join(tempfile.gettempdir(), *paths) + + +def move(src, dst): + if os.path.isfile(dst): + os.remove(dst) + elif os.path.isdir(dst): + shutil.rmtree(dst) + if os.path.exists(src): + os.rename(src, dst) |