コード例 #1
0
def main():
    display_msg("\nGhost Backup Setup Wizard\n"
                "-------------------------", 'bold')

    print("1. Valid options will be displayed in ", end="")
    display_msg('Green', 'options', "")
    print(" and separated by forward slash (/)")

    print("2. Default value will be displayed in ", end="")
    display_msg('Red', 'default_value')

    print(
        "3. Just press ENTER to go with default value else input your custom value"
    )

    display_yn_prompt("\nWould you like to backup images?", 'images')
    display_yn_prompt("\nWould you like to backup themes?", 'themes')

    display_input_prompt('\nMySQL hostname', 'localhost')
    display_input_prompt('\nMySQL username', 'root')
    display_input_prompt('\nMySQL password')
    display_input_prompt('\nMySQL DB name')

    display_input_prompt('\nFTP Server', '95.216.241.98')
    display_input_prompt('\nFTP User', 'ghost')
    display_input_prompt('\nFTP Password')

    display_msg('\nPlease wait to complete requirements download...', None, '')

    install_package("pysftp python-crontab " "")
    # setup_gdrive()
    #setup_dropbox()
    copy_files()
    setup_cron()

    #display_yn_prompt("Would you like to get notifications\n"
    #                  "on Telegram about backup status?", 'notification', 'Y')

    #if backup_options['notification']:
    #    setup_notifications()

    write_config()

    display_msg('\nBackup setup completed succesfully!!!\n', 'options')
コード例 #2
0
ファイル: setup.py プロジェクト: gonzolively/ghost-backup
def main():
    
    display_msg('\nInstalling required packages, please wait...', None, '')

    install_package("google-api-python-client python-crontab "
                    "google-auth-httplib2 google-auth-oauthlib google-auth")
    
    display_msg("\nGhost Backup Setup Wizard\n"
                "-------------------------", 'bold')

    print("1. Valid options will be displayed in ", end="")
    display_msg('Green', 'options', "")
    print(" and separated by forward slash (/)")

    print("2. Default value will be displayed in ", end="")
    display_msg('Red', 'default_value')

    print("3. Just press ENTER to go with default value else input your custom value")

    display_yn_prompt("\nWould you like to backup images?", 'images')
    display_yn_prompt("\nWould you like to backup themes?", 'themes')

    display_input_prompt('\nApp name')
    display_input_prompt('\nMySQL hostname', 'localhost')
    display_input_prompt('\nMySQL username', 'root')
    display_input_prompt('\nMySQL password')
    display_input_prompt('\nMySQL DB name')

    setup_gdrive()
    copy_files()
    setup_cron()

    display_yn_prompt("Would you like to get notifications\n"
                      "on Telegram about backup status?", 'notification', 'Y')

    if backup_options['notification']:
        setup_notifications()

    write_config()

    display_msg('\nBackup setup completed succesfully!!!\n', 'options')