wpress-extractor/setup.py

41 lines
929 B
Python

import subprocess
class Setup():
def __check_wp_cli():
"""Checks if WP-CLI is installed."""
try:
subprocess.call(["wp", "--info"])
return True
except Exception:
return False
def __download_core():
print('')
def __format_mysql():
print('')
def __move_folders():
print('')
def __write_config():
print('')
def __import_mysql():
print('')
def wp_setup(self):
# Initial setup for restore
self.__format_mysql()
self.__move_folders()
# Depending on if WP Cli is installed
manual = False if self.__check_wp_cli() else True
# File management
self.__download_core(manual)
self.__write_config() # TODO: Get data from input
self.__import_mysql(manual)
return 'Completed'