<commit_before>import sys
import dropbox
import os
import configparser
#from dropbox.files import WriteMode
from dropbox.exceptions import ApiError, AuthError
from backup import mysqlBackup

if __name__ == '__main__':

    # Reading config
    print("Getting config...")
    currentDir = os.path.dirname(os.path.abspath(__file__))
    config = configparser.ConfigParser()
    config.read(currentDir + '/config.ini')

    # Check for an access token
    if 'dropbox' not in config:
        sys.exit('ERROR: [dropbox] section is required')
    if 'token' not in config['dropbox']:
        sys.exit('ERROR: [dropbox][token] section is required')

    # Check for backup at all
    if 'databases' not in config and 'folders' not in config:
        sys.exit('WARNING: Nothing to backup, exit...')

    # Create an instance of a Dropbox class, which can make requests to the API.
    print("Creating a Dropbox object...")
    dbx = dropbox.Dropbox(config['dropbox']['token'])

    # Check that the access token is valid
    try:
        dbx.users_get_current_account()
    except AuthError as err:
        sys.exit("ERROR: Invalid access token; try re-generating an access token from the app console on the web.")

    mysql = mysqlBackup(config)
    mysql.backup()
<commit_msg>Temporary get rif of dropbox<commit_after>import sys
import dropbox
import os
import configparser
#from dropbox.files import WriteMode
from dropbox.exceptions import ApiError, AuthError
from backup import mysqlBackup

if __name__ == '__main__':

    # Reading config
    print("Getting config...")
    currentDir = os.path.dirname(os.path.abspath(__file__))
    config = configparser.ConfigParser()
    config.read(currentDir + '/config.ini')

    # Check for an access token
    if 'dropbox' not in config:
        sys.exit('ERROR: [dropbox] section is required')
    if 'token' not in config['dropbox']:
        sys.exit('ERROR: [dropbox][token] section is required')

    # Check for backup at all
    if 'databases' not in config and 'folders' not in config:
        sys.exit('WARNING: Nothing to backup, exit...')

    # Create an instance of a Dropbox class, which can make requests to the API.
    # print("Creating a Dropbox object...")
    # dbx = dropbox.Dropbox(config['dropbox']['token'])
    #
    # # Check that the access token is valid
    # try:
    #     dbx.users_get_current_account()
    # except AuthError as err:
    #     sys.exit("ERROR: Invalid access token; try re-generating an access token from the app console on the web.")

    mysql = mysqlBackup(config)
    mysql.backup()

{'fraction_non_alphanumeric': 0.10318076027928627, 'fraction_numerical': 0.0, 'mean_word_length': 3.327181208053691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7603135', 'n_tokens_mistral': 750, 'n_tokens_neox': 740, 'n_words': 266}