Restore compatibility with python 3.5
This commit is contained in:
parent
9c9773f489
commit
0c3ddea197
2 changed files with 11 additions and 7 deletions
|
@ -4,3 +4,4 @@ disable=invalid-name,
|
|||
too-many-arguments,
|
||||
too-many-branches,
|
||||
line-too-long,
|
||||
consider-using-f-string, # to keep compatibility with python 3.5
|
||||
|
|
17
gitdch
17
gitdch
|
@ -15,7 +15,9 @@ DEFAULT_GIT_PATCH = './'
|
|||
DEFAULT_CODE_NAME = 'unstable'
|
||||
DEFAULT_URGENCY = 'medium'
|
||||
|
||||
parser = argparse.ArgumentParser(description=f'{__doc__} (version: {VERSION})')
|
||||
parser = argparse.ArgumentParser(
|
||||
description='{0} (version: {1})'.format(__doc__, VERSION)
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-d', '--debug',
|
||||
|
@ -55,7 +57,7 @@ parser.add_argument(
|
|||
'--path',
|
||||
type=str,
|
||||
dest='git_path',
|
||||
help=f'Git repository path (default: {DEFAULT_GIT_PATCH}',
|
||||
help='Git repository path (default: %s)' % DEFAULT_GIT_PATCH,
|
||||
default=DEFAULT_GIT_PATCH
|
||||
)
|
||||
|
||||
|
@ -97,7 +99,7 @@ parser.add_argument(
|
|||
'--code-name',
|
||||
type=str,
|
||||
dest='code_name',
|
||||
help=f'Debian code name (default: {DEFAULT_CODE_NAME})',
|
||||
help='Debian code name (default: %s)' % DEFAULT_CODE_NAME,
|
||||
default=DEFAULT_CODE_NAME
|
||||
)
|
||||
|
||||
|
@ -106,7 +108,7 @@ parser.add_argument(
|
|||
'--urgency',
|
||||
type=str,
|
||||
dest='urgency',
|
||||
help=f'Package urgency (default: {DEFAULT_URGENCY})',
|
||||
help='Package urgency (default: %s)' % DEFAULT_URGENCY,
|
||||
default=DEFAULT_URGENCY
|
||||
)
|
||||
|
||||
|
@ -144,8 +146,9 @@ if not options.package_name:
|
|||
# Initialize log
|
||||
log = logging.getLogger()
|
||||
logformat = logging.Formatter(
|
||||
f'%(asctime)s - {os.path.basename(sys.argv[0])} - %(levelname)s '
|
||||
': %(message)s'
|
||||
'%(asctime)s - {} - %(levelname)s : %(message)s'.format(
|
||||
os.path.basename(sys.argv[0])
|
||||
)
|
||||
)
|
||||
# Set root logger to DEBUG (filtering done by handlers)
|
||||
log.setLevel(logging.DEBUG)
|
||||
|
@ -272,7 +275,7 @@ if options.release_notes:
|
|||
log.info('Generate Markdown release notes')
|
||||
release_notes_lines = ['# Changelog:\n\n']
|
||||
release_notes_lines.extend([
|
||||
f'* {message}\n'
|
||||
'* {0}\n'.format(message)
|
||||
for message in versions[0]['messages']
|
||||
])
|
||||
log.info(
|
||||
|
|
Loading…
Reference in a new issue