From: Shane Jaroch Date: Fri, 26 Dec 2025 10:19:44 +0000 (-0500) Subject: wip; tidy X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=f0116b110b103922d714d0ea3804b28a5efa6d28;p=gamesguru%2Fffpass.git wip; tidy --- diff --git a/ffpass/__init__.py b/ffpass/__init__.py index c955f36..061404a 100755 --- a/ffpass/__init__.py +++ b/ffpass/__init__.py @@ -387,17 +387,18 @@ def readCSV(csv_file): def normalized_iter(): yield first_line.lower() yield from csv_file + logging.info("Using CSV DictReader.") reader = csv.DictReader(normalized_iter()) else: - # No header: Assume default order and provide fieldnames + logging.info("Using CSV RowReader.") reader = csv.reader(csv_file) logins = [] for row in reader: logging.error(f"row: {row}") - if not row: - continue # The Windows CSV parser can give extra empty rows + if not row or (row[0] == '\x04' and len(row) < 3): + break # Windows doesn't have Ctrl+D, so let's break on first empty line if isinstance(reader, csv.DictReader): logging.error("DictReader it is!") @@ -464,9 +465,7 @@ PROFILE_GUESS_DIRS = { def getProfiles() -> list[Path]: paths = Path(PROFILE_GUESS_DIRS[sys.platform]).expanduser() logging.debug(f"Paths: {paths}") - _potential_profile_paths = paths.glob(os.path.join("*", "logins.json")) - logging.debug(f"_potential_profile_paths: {_potential_profile_paths}") - profiles = [path.parent for path in _potential_profile_paths] + profiles = [path.parent for path in paths.glob(os.path.join("*", "logins.json"))] logging.debug(f"Profiles: {profiles}") return profiles @@ -607,14 +606,6 @@ def makeParser(): return parser -def setLogLevel(args): - - if args.debug: - logging.getLogger().setLevel(logging.DEBUG) - elif args.verbose: - logging.getLogger().setLevel(logging.INFO) - - def main(): parser = makeParser() args = parser.parse_args() @@ -628,9 +619,6 @@ def main(): logging.basicConfig(level=log_level, format="%(message)s") - # Adjust log level based on flags - setLogLevel(args) - # Try to obtain profile directory if args.directory is None: try: