convert csv header to lowercase
authorlouisabraham <louis.abraham@yahoo.fr>
Fri, 31 May 2019 12:54:45 +0000 (14:54 +0200)
committerlouisabraham <louis.abraham@yahoo.fr>
Fri, 31 May 2019 12:54:45 +0000 (14:54 +0200)
ffpass/__init__.py

index bf8ede8dd0fb1d116949d3b0d9034c1697c2c9e3..0d2521cb15b72a29f3f9c599f06e006920a7e7e6 100644 (file)
@@ -175,9 +175,15 @@ def exportLogins(key, jsonLogins):
     return logins
 
 
+def lower_header(from_file):
+    it = iter(from_file)
+    yield next(it).lower()
+    yield from it
+
+
 def readCSV(from_file):
     logins = []
-    reader = csv.DictReader(from_file)
+    reader = csv.DictReader(lower_header(from_file))
     for row in reader:
         logins.append((rawURL(row["url"]), row["username"], row["password"]))
     return logins