Skip to content

Commit cde0108

Browse files
committed
Change logging a little so info about DB being rebuilt is always printed to stdout
1 parent 39dc7e4 commit cde0108

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

db_update.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def db_needs_update():
5151
except:
5252
return None
5353
if not os.path.isfile(DB_PATH):
54+
print('Gamedata DB not found')
5455
return True
5556
db_data_version = None
5657
db_schema_version = None
@@ -68,12 +69,21 @@ def db_needs_update():
6869
except KeyboardInterrupt:
6970
raise
7071
except:
72+
print('Error when fetching gamedata DB metadata')
7173
return True
72-
return data_version != db_data_version or GAMEDATA_SCHEMA_VERSION != db_schema_version
74+
if data_version != db_data_version:
75+
print('Gamedata DB data version mismatch: needed {}, DB has {}'.format(data_version, db_data_version))
76+
return True
77+
if GAMEDATA_SCHEMA_VERSION != db_schema_version:
78+
print('Gamedata DB schema version mismatch: needed {}, DB has {}'.format(GAMEDATA_SCHEMA_VERSION, db_schema_version))
79+
return True
80+
return False
7381

7482

7583
def update_db():
7684

85+
print('Building gamedata DB...')
86+
7787
if os.path.isfile(DB_PATH):
7888
os.remove(DB_PATH)
7989

pyfa.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def _process_args(self, largs, rargs, values):
7676

7777
(options, args) = parser.parse_args()
7878

79+
7980
if __name__ == "__main__":
8081

8182
try:
@@ -118,7 +119,6 @@ def _process_args(self, largs, rargs, values):
118119
pyfalog.info("Running in a thawed state.")
119120

120121
if db_needs_update() is True:
121-
pyfalog.info("Gamedata needs an update")
122122
update_db()
123123

124124
# Lets get to the good stuff, shall we?

0 commit comments

Comments
 (0)