mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-15 01:32:53 -07:00
Standardize string formatting to use .format instead of concat
This commit is contained in:
parent
a3a59af3f8
commit
2ad9f2e35f
18 changed files with 259 additions and 239 deletions
|
@ -42,18 +42,17 @@ class InitialSchema(nzbToMediaDB.SchemaUpgrade):
|
|||
cur_db_version = self.checkDBVersion()
|
||||
|
||||
if cur_db_version < MIN_DB_VERSION:
|
||||
logger.log_error_and_exit("Your database version (" + str(
|
||||
cur_db_version) + ") is too old to migrate from what this version of nzbToMedia supports (" + \
|
||||
str(MIN_DB_VERSION) + ").\n" + \
|
||||
"Please remove nzbtomedia.db file to begin fresh."
|
||||
)
|
||||
logger.log_error_and_exit(u"Your database version ({current}) is too old to migrate "
|
||||
u"from what this version of nzbToMedia supports ({min})."
|
||||
u"\nPlease remove nzbtomedia.db file to begin fresh.".format
|
||||
(current=cur_db_version, min=MIN_DB_VERSION))
|
||||
|
||||
if cur_db_version > MAX_DB_VERSION:
|
||||
logger.log_error_and_exit("Your database version (" + str(
|
||||
cur_db_version) + ") has been incremented past what this version of nzbToMedia supports (" + \
|
||||
str(MAX_DB_VERSION) + ").\n" + \
|
||||
"If you have used other forks of nzbToMedia, your database may be unusable due to their modifications."
|
||||
)
|
||||
logger.log_error_and_exit(u"Your database version ({current}) has been incremented "
|
||||
u"past what this version of nzbToMedia supports ({max})."
|
||||
u"\nIf you have used other forks of nzbToMedia, your database "
|
||||
u"may be unusable due to their modifications.".format
|
||||
(current=cur_db_version, max=MAX_DB_VERSION))
|
||||
if cur_db_version < MAX_DB_VERSION: # We need to upgrade.
|
||||
queries = [
|
||||
"CREATE TABLE downloads2 (input_directory TEXT, input_name TEXT, input_hash TEXT, input_id TEXT, client_agent TEXT, status INTEGER, last_update NUMERIC, CONSTRAINT pk_downloadID PRIMARY KEY (input_directory, input_name));",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue