mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-14 22:13:02 +00:00
Add pre-commit to automatically run formatting when committing
This commit is contained in:
parent
7d07967574
commit
25168ba6e1
14 changed files with 74 additions and 34 deletions
|
@ -25,19 +25,19 @@ if __name__ == "__main__":
|
|||
|
||||
con = sqlite3.connect(args.db, check_same_thread=False)
|
||||
cur = con.cursor()
|
||||
|
||||
|
||||
with open(output_file, 'w', encoding="utf-8") as f:
|
||||
for row in cur.execute('SELECT q, s, source, target FROM suggestions WHERE source != "auto" ORDER BY source'):
|
||||
q, s, source, target = row
|
||||
obj = {
|
||||
'q': q,
|
||||
's': s,
|
||||
's': s,
|
||||
'source': source,
|
||||
'target': target
|
||||
}
|
||||
json.dump(obj, f, ensure_ascii=False)
|
||||
f.write('\n')
|
||||
|
||||
|
||||
print("Wrote %s" % output_file)
|
||||
|
||||
if args.clear:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue