code style reformatting using black

This commit is contained in:
Goffi 2018-06-27 20:14:46 +02:00
commit 744cb0c503

View file

@ -21,6 +21,7 @@ from sat.core.i18n import _
from os.path import exists, splitext
from optparse import OptionParser
def getNewPath(path):
""" Check if path exists, and find a non existant path if needed """
idx = 2
@ -31,21 +32,23 @@ def getNewPath(path):
new_path = "%s_%d%s" % (root, idx, ext)
if not exists(new_path):
return new_path
idx+=1
idx += 1
def check_options():
"""Check command line options"""
usage = _("""
usage = _(
"""
%prog [options]
%prog --help for options list
""")
parser = OptionParser(usage=usage) # TODO: use argparse
"""
)
parser = OptionParser(usage=usage) # TODO: use argparse
parser.add_option("-p", "--profile", help=_("Select the profile to use"))
(options, args) = parser.parse_args()
if options.profile:
options.profile = options.profile.decode('utf-8')
options.profile = options.profile.decode("utf-8")
return options