def __init__(self, input_data, logger=None): """This class requires an input data to operate on. """ self.input_data = input_data self.logger = logger if ( logger is not None) else audiotagger_logger.get_logger()
def __init__(self, src, logger=None): if not isinstance(src, str): raise Exception("INVALID SOURCE") self.src = src self.logger = logger if ( logger is not None) else audiotagger_logger.get_logger()
def __init__(self, src, input_to_excel=False, logger=None): if logger is not None: self.logger = logger else: self.logger = audiotagger_logger.get_logger() input_data = at_in.AudioTaggerInput(logger=self.logger) # load data -- singleton to be modified continuously as needed. input_data.load_metadata(src=src) if input_to_excel: input_data.write_to_excel() self.input_data = input_data
def __init__(self, logger=None): self.logger = logger if ( logger is not None) else audiotagger_logger.get_logger()
# SPDX-License-Identifier: GPL-3.0-or-later # pylint: disable=missing-module-docstring # pylint: disable=redefined-outer-name # pylint: disable=line-too-long # pylint: disable=invalid-name import os import pathlib import pytest from audiotagger.core import audiotagger from audiotagger.data import at_input as at_in, loader from audiotagger.util import audiotagger_logger logger = audiotagger_logger.get_logger(name="test_audiotagger.log") @pytest.fixture def input_object(): """Returns an input instance with metadata structure. """ test_dir = pathlib.Path(__file__).parent.parent src = os.path.join(test_dir, "sample_data/test_metadata.xlsx") ldr = loader.AudioTaggerMetadataLoader(src) metadata = ldr.load_metadata_df() input_obj = at_in.AudioTaggerInput() input_obj.set_metadata(metadata) return input_obj
def __init__(self, input_data, logger=None): self.logger = logger if ( logger is not None) else audiotagger_logger.get_logger() self.input_data = input_data
parser.add_argument("--create-playlist", type=str, dest="playlist_query", help=help_msg) help_msg = "Generates an Excel (.xlsx) metadata template file." parser.add_argument("--generate-metadata-template", action="store_true", help=help_msg) return parser.parse_args() if __name__ == "__main__": # Set up logging. logger = audiotagger_logger.get_logger(paths.audiotagger_log_dir()) logger.info("-" * 40) logger.info("Starting audiotagger.") logger.info("-" * 40) args = get_args() logger.info(args) # If the app was never configured, generate configuration once. if not os.path.exists(paths.audiotagger_config_path()): logger.info("Application will configure for the first time...") audiotagger_setup.generate_config() logger.info("Default configuration generated, exiting app.") sys.exit(0)
def __init__(self, logger=None): self.logger = logger if ( logger is not None) else audiotagger_logger.get_logger() self.metadata = pd.DataFrame()