This repository has been archived by the owner on Oct 26, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46a4e55
commit aa58b6a
Showing
9 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 *-* | ||
# This file is part of Minecraft Backup | ||
|
||
# Minecraft Backup | ||
from minecraft_backup.resources import GAME_PATH | ||
from minecraft_backup.core.configuration import get_os | ||
|
||
# OS | ||
from os import listdir | ||
from os import mkdir | ||
from os import path | ||
|
||
# Shutil | ||
from shutil import copytree | ||
from shutil import copy2 | ||
from shutil import copystat | ||
|
||
|
||
def make_backup(dst): | ||
"""This function make a Minecraft backup""" | ||
|
||
os = get_os() | ||
|
||
names = listdir(GAME_PATH[os]) | ||
mkdir(dst) | ||
|
||
for name in names: | ||
src_name = path.join(GAME_PATH[os], name) | ||
dst_name = path.join(dst, name) | ||
|
||
if path.isdir(src_name): | ||
copytree(src_name, dst_name) | ||
else: | ||
copy2(src_name, dst_name) | ||
|
||
copystat(GAME_PATH[os], dst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
#-*- coding: utf-8 -*- | ||
|
||
# This file is part of Minecraft backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# This file is part of Minecraft Backup | ||
|
||
|
||
# Others imports | ||
# os | ||
from os import path | ||
|
||
|
||
|