diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-14 13:59:03 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-14 13:59:03 +0000 |
| commit | bebcd423e7ca5aa620b8ceeef67e77daa3f14f0f (patch) | |
| tree | abae3b3f09d9dce311485475a02d3bbb8d67ac67 /obfuscator | |
| parent | afcf7339eec26144e4ab99a3e67e60fb38932960 (diff) | |
| download | gdpr-obfuscator-bebcd423e7ca5aa620b8ceeef67e77daa3f14f0f.tar.gz gdpr-obfuscator-bebcd423e7ca5aa620b8ceeef67e77daa3f14f0f.zip | |
process path in CSVReader methods & fix import paths
Diffstat (limited to 'obfuscator')
| -rw-r--r-- | obfuscator/csv_reader.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/obfuscator/csv_reader.py b/obfuscator/csv_reader.py index 42e8f8a..901d396 100644 --- a/obfuscator/csv_reader.py +++ b/obfuscator/csv_reader.py @@ -1,24 +1,24 @@ import csv from typing import List, Dict -from logger import get_logger +from obfuscator.logger import get_logger logger = get_logger("CSVReader") class CSVReader: - def __init__(self, path: str): - self.path = path + def __init__(self): + pass - def read_local(self) -> List[Dict[str, str]]: - logger.debug(f"Reading local CSV from: {self.path}") + def read_local(self, path) -> List[Dict[str, str]]: + logger.debug(f"Reading local CSV from: {path}") data = [] try: - with open(self.path, mode="r", encoding="utf-8") as file: + with open(path, mode="r", encoding="utf-8") as file: reader = csv.DictReader(file) for row in reader: data.append(dict(row)) except FileNotFoundError: - logger.error(f"File not found: {self.path}") + logger.error(f"File not found: {path}") except Exception as e: logger.error(f"Error reading file: {e}") |
