From 5bf30e4e42543b6be01448937183f3470cc731f3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 24 Feb 2024 16:52:44 +0300 Subject: [PATCH] Style: Fix `flake8` error E999 SyntaxError: Missing parens in 'print' --- dump_db.py | 2 +- print-filename.py | 6 +++--- print-stats.py | 18 +++++++++--------- reload_db.py | 6 +++--- rescan_fs.py | 6 +++--- xsetbg_conf.py | 4 ++-- xsetbg_db.py | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dump_db.py b/dump_db.py index ea6b0f1..9797299 100755 --- a/dump_db.py +++ b/dump_db.py @@ -13,4 +13,4 @@ if not xsetbg_db: sys.exit("Error: no database found") for row in xsetbg_db.select(orderBy='-last_shown'): - print row.id, row.last_shown, row.full_name.encode(default_encoding) + print(row.id, row.last_shown, row.full_name.encode(default_encoding)) diff --git a/print-filename.py b/print-filename.py index 234d0a3..921f129 100755 --- a/print-filename.py +++ b/print-filename.py @@ -1,7 +1,7 @@ #! /usr/bin/env python -"""Print background filename +"""print(background filename) -Print the filename of the current or previous background image. +print(the filename of the current or previous background image.) This file is a part of XSetBg. @@ -58,4 +58,4 @@ index, output_encoding = get_args() filename = xsetbg_db.select('last_shown IS NOT NULL', orderBy='-last_shown')[index].full_name -print filename.encode(output_encoding) +print(filename.encode(output_encoding)) diff --git a/print-stats.py b/print-stats.py index 4e1770d..daa31a4 100755 --- a/print-stats.py +++ b/print-stats.py @@ -12,15 +12,15 @@ from xsetbg_db import xsetbg_db if not xsetbg_db: sys.exit("Error: no database found") -print "Total files:", xsetbg_db.select().count() -print "Images:", xsetbg_db.select('is_image = 1').count() -print "Non-images:", xsetbg_db.select('is_image = 0').count() -print "Unknown:", xsetbg_db.select('is_image IS NULL').count() -print "Shown files:", xsetbg_db.select('last_shown IS NOT NULL').count() -print "Not shown files:", xsetbg_db.select('last_shown IS NULL').count() +print("Total files:", xsetbg_db.select().count()) +print("Images:", xsetbg_db.select('is_image = 1').count()) +print("Non-images:", xsetbg_db.select('is_image = 0').count()) +print("Unknown:", xsetbg_db.select('is_image IS NULL').count()) +print("Shown files:", xsetbg_db.select('last_shown IS NOT NULL').count()) +print("Not shown files:", xsetbg_db.select('last_shown IS NULL').count()) last_shown = xsetbg_db.select('last_shown IS NOT NULL', orderBy='last_shown')[0].last_shown -print "Oldest:", asctime(localtime(last_shown)) +print("Oldest:", asctime(localtime(last_shown))) min_max = xsetbg_db.select().accumulateMany(('MIN', 'id'), ('MAX', 'id')) -print "Min id:", min_max[0] -print "Max id:", min_max[1] +print("Min id:", min_max[0]) +print("Max id:", min_max[1]) diff --git a/reload_db.py b/reload_db.py index fe25e86..4a96a01 100755 --- a/reload_db.py +++ b/reload_db.py @@ -55,6 +55,6 @@ with SQLiteMassInsert() as txn: dump_file.close() -print "New images:", count_new -print "Existing images:", count_old -print "Updated images:", count_updated +print("New images:", count_new) +print("Existing images:", count_old) +print("Updated images:", count_updated) diff --git a/rescan_fs.py b/rescan_fs.py index 1b74f8f..f2586f3 100755 --- a/rescan_fs.py +++ b/rescan_fs.py @@ -82,6 +82,6 @@ with SQLiteMassInsert() as txn: txn.query(query) NULL.close() -print "New images:", count_new -print "Existing images:", count_old -print "Removed images:", count_del +print("New images:", count_new) +print("Existing images:", count_old) +print("Removed images:", count_del) diff --git a/xsetbg_conf.py b/xsetbg_conf.py index 1066bfa..677b537 100755 --- a/xsetbg_conf.py +++ b/xsetbg_conf.py @@ -30,5 +30,5 @@ else: raise RuntimeError("Cannot find xsetbg.conf; searched %s", config_dirs) if __name__ == '__main__': - print "Config dirs:", config_dirs - print "Config file:", xsetbg_conf_file + print("Config dirs:", config_dirs) + print("Config file:", xsetbg_conf_file) diff --git a/xsetbg_db.py b/xsetbg_db.py index dfa65fc..e64440a 100755 --- a/xsetbg_db.py +++ b/xsetbg_db.py @@ -88,5 +88,5 @@ else: xsetbg_db = None if __name__ == '__main__': - print "DB dirs:", db_dirs - print "DB file:", xsetbg_db_path + print("DB dirs:", db_dirs) + print("DB file:", xsetbg_db_path) -- 2.39.5