51 lines
1.1 KiB
Python
51 lines
1.1 KiB
Python
import distutils.text_file
|
|
import platform
|
|
import os
|
|
import shutil
|
|
import pkg_resources
|
|
|
|
|
|
WORKDIR = os.getcwd()
|
|
OS_SUPPORTED = platform.system() in ['Linux', 'Mac', 'Windows']
|
|
PYTHON_SUPPORTED = platform.python_version() >= '3.10'
|
|
|
|
|
|
def install_linux():
|
|
install_path = os.path.join('~', '.local', 'share', 'AutoPicture_v3')
|
|
if os.path.exists(install_path): exit('Sorry, this software is already installed')
|
|
# shutil.copy()
|
|
|
|
|
|
def install_mac():
|
|
pass
|
|
|
|
|
|
def install_windows():
|
|
pass
|
|
|
|
|
|
def check_pip():
|
|
pkg_resources.require(open(os.path.join(WORKDIR,'requirements.txt' ), mode='r'))
|
|
|
|
|
|
def check_supported_host():
|
|
print(f'Detected OS: {platform.system()}')
|
|
print(f'Detected Python: {platform.python_version()}')
|
|
print()
|
|
print('OS Supported: OK') if OS_SUPPORTED else print('OS Supported: NO')
|
|
print('Python supported: OK') if PYTHON_SUPPORTED else print('Python supported: NO')
|
|
|
|
|
|
check_supported_host()
|
|
check_pip()
|
|
|
|
|
|
match platform.system():
|
|
case 'Linux': install_linux()
|
|
case 'Mac': install_mac()
|
|
case 'Windows': install_windows()
|
|
case _: print("Your system is not supported.")
|
|
|
|
|
|
|