diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-02-07 16:39:37 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-02-07 16:39:37 +0100 |
commit | 165a94c200f753109b0011995162ab3cb97a64d6 (patch) | |
tree | 2906a5d82b0c66d38ab41b61fe62edce5c27035c | |
parent | 00be6f7530a16eb17f367b45d498e1e483b61b8d (diff) |
Various fixes to the database script
-rw-r--r-- | scripts/database/database.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/database/database.py b/scripts/database/database.py index 89fe8286..f2d47717 100644 --- a/scripts/database/database.py +++ b/scripts/database/database.py @@ -207,7 +207,7 @@ def PrintData(df, outputdir): f.write(GetDeviceVendor(vendor, devtype)) for device, dfdevice in dfdevtype.groupby(["device"]): devicename = "\"%s\"," % device - f.write(" { %-48s { " % devicename) + f.write(" { %-50s { " % devicename) # Collects the paramaters for this case and prints them parameters = [] @@ -265,6 +265,7 @@ for file_json in glob.glob(glob_json): # Loads the newly imported data sys.stdout.write("## Processing '"+file_json+"'") imported_data = ImportDataFromFile(file_json) + imported_data = SanitizeVendorNames(imported_data) # Adds the new data to the database old_size = len(database.index) @@ -273,9 +274,9 @@ for file_json in glob.glob(glob_json): new_size = len(database.index) print("with "+str(new_size-old_size)+" new items") - database = SanitizeVendorNames(database) - # Stores the modified database back to disk +# Stores the modified database back to disk +if len(glob.glob(glob_json)) >= 1: print("## Storing the database to disk...") SaveDatabase(database, file_db) |