<commit_before>'''
Created on Oct 9, 2014

@author: <NAME>

Specialized DB class to clean all user db objects
functions | stored procedures | views | triggers
'''
import mysql.connector as My

import config
import app.meta as meta

class AllDBObj():
    '''
    Get command line params Loop on all specified DBs and get the objects we need to remove
    '''

    def __init__(self, parser):
        '''
        Stores a dictionary of what to clean
        '''
        # Process arguments
        self.args = parser.parse_args()
        handle_all = self.args.handle_all
        
        if handle_all:
            self.what_to_handle = {'s':'All','w':'All', 't':'All', 'f':'All'}
            self._load_all_db_names()

        else:
            self.what_to_handle = {'s':self.args.stored_proc,'w':self.args.views, 't':self.args.triggers, 'f':self.args.functions}

        meta.TrackedDBs(meta.STORED_PROCEDURES)
        meta.TrackedDBs(meta.TRIGGERS)
        meta.TrackedDBs(meta.FUNCTIONS)
        meta.TrackedDBs(meta.VIEWS)
        exit()
        
        self.dry_run = self.args.dry_run
        self.verbosity = self.args.verbosity
        self.ignore_dbs = [('information_schema',),('performance_schema',),('sys',)]
        self.ignore_dbs_str = "'information_schema','performance_schema','sys'"
        self.connect()

    def _load_all_db_names(self):<commit_msg>comments to rememmber where I stopped<commit_after>'''
Created on Oct 9, 2014

@author: <NAME>

Specialized DB class to clean all user db objects
functions | stored procedures | views | triggers
'''
import mysql.connector as My

import config
import app.meta as meta

class AllDBObj():
    '''
    Get command line params Loop on all specified DBs and get the objects we need to remove
    '''

    def __init__(self, parser):
        '''
        Stores a dictionary of what to clean
        '''
        # Process arguments
        self.args = parser.parse_args()
        handle_all = self.args.handle_all
        
        if handle_all:
            self.what_to_handle = {'s':'All','w':'All', 't':'All', 'f':'All'}
            self._load_all_db_names()

        else:
            self.what_to_handle = {'s':self.args.stored_proc,'w':self.args.views, 't':self.args.triggers, 'f':self.args.functions}

        # Loads the database names rcom is tracking. This will be used in case of --all, this will also be used in case a specific db 
        # is targeted to make sure i is a tracked DB.
        meta.TrackedDBs(meta.STORED_PROCEDURES)
        meta.TrackedDBs(meta.TRIGGERS)
        meta.TrackedDBs(meta.FUNCTIONS)
        meta.TrackedDBs(meta.VIEWS)
        exit()
        
        self.dry_run = self.args.dry_run
        self.verbosity = self.args.verbosity
        self.ignore_dbs = [('information_schema',),('performance_schema',),('sys',)]
        self.ignore_dbs_str = "'information_schema','performance_schema','sys'"
        self.connect()

    def _load_all_db_names(self):
{'fraction_non_alphanumeric': 0.11802502536354413, 'fraction_numerical': 0.0033818058843422386, 'mean_word_length': 2.6699751861042182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2703334', 'n_tokens_mistral': 940, 'n_tokens_neox': 899, 'n_words': 229}