Unverified Kaydet (Commit) cab06a0d authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

PEP8: E501 line too long ( x > 120 characters )

Automated stuff. PEP8 restrictins and error fixes to improve readibility of code.
üst c9278a01
......@@ -114,7 +114,12 @@ def auto_dodoc():
def install(parameters=''):
"""does ruby setup.rb install"""
if system(
'ruby -w setup.rb --prefix=/{0}/{1} --destdir={1} {2}'.format(get.defaultprefixDIR(), get_gemdir(), get.installDIR(), parameters)):
'ruby -w setup.rb --prefix=/{0}/{1} --destdir={1} {2}'.format(
get.defaultprefixDIR(),
get_gemdir(),
get.installDIR(),
parameters
)):
raise InstallError(_('Install failed.'))
auto_dodoc()
......
......@@ -123,9 +123,8 @@ def unlink(pattern):
ctx.ui.error(
_('ActionsAPI [unlink]: Permission denied: \"{}\"').format(filePath))
elif isDirectory(filePath):
ctx.ui.warning(_(
'ActionsAPI [unlink]: \"{}\" is not a file, use \'unlinkDir\' or \'removeDir\' to remove directories.').format(
filePath))
ctx.ui.warning(
_('ActionsAPI [unlink]: \"{}\" is not a file, use \'unlinkDir\' or \'removeDir\' to remove directories.').format(filePath))
else:
ctx.ui.error(
......
......@@ -186,8 +186,9 @@ def handleConfigFiles():
ctx.ui.info(
_('Creating \"/etc/texmf/{}.d\"').format(dirname))
dodir("/etc/texmf/{}.d".format(dirname))
ctx.ui.info(_('Moving (and symlinking) \"/usr/share/texmf/{0}\" to \"/etc/texmf/{1}.d\"').format(configFile,
dirname))
ctx.ui.info(
_('Moving (and symlinking) \"/usr/share/texmf/{0}\" to \"/etc/texmf/{1}.d\"').format(configFile,
dirname))
domove("/usr/share/texmf/{0}/{1}".format(dirname,
configFile), "/etc/texmf/{}.d".format(dirname))
dosym("/etc/texmf/{0}.d/{1}".format(dirname, configFile),
......
......@@ -53,7 +53,8 @@ You can also give the name of a component.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation."
"Applies all sysconf operations"))
self.parser.add_option_group(group)
......
......@@ -53,7 +53,8 @@ You can also give the name of a component.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation. "
"Applies all sysconf operations"))
self.parser.add_option_group(group)
......
......@@ -61,7 +61,8 @@ expanded to package names.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation."
"Applies all sysconf operations"))
group.add_option("-c", "--component", action="append",
default=None, help=_("Install component's and recursive components' packages."))
group.add_option("-r", "--repository", action="store",
......
......@@ -47,7 +47,8 @@ expanded to package names.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation."
"Applies all sysconf operations"))
group.add_option("--purge", action="store_true",
default=False, help=_("Removes everything including changed config files of the package."))
group.add_option("-c", "--component", action="append",
......
......@@ -48,7 +48,8 @@ Remove all orphaned packages from the system.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation."
"Applies all sysconf operations"))
self.parser.add_option_group(group)
......
......@@ -63,7 +63,8 @@ expanded to package names.
group.add_option("--ignore-sysconf", action="store_true",
default=False, help=_("Skip sysconf operations after installation."))
group.add_option("--force-sysconf", action="store_true",
default=False, help=_("Force sysconf operations after installation. Applies all sysconf operations"))
default=False, help=_("Force sysconf operations after installation. "
"Applies all sysconf operations"))
group.add_option("--preserve-permanent", action="store_true",
default=False,
help=_("Preserves permanent tagged files on upgrade action "
......
......@@ -291,8 +291,13 @@ class RepoDB(lazydb.LazyDB):
if not compatible:
self.deactivate_repo(name)
raise IncompatibleRepoError(
_("Repository \"{}\" is not compatible with your distribution. Repository is disabled.\nYour distribution is {} release {}\nRepository distribution is {} release {}\n\nIf you want add this repository please use \"--ignore-check\" parameter with this command.").format(name,
ctx.config.values.general.distribution,
ctx.config.values.general.distribution_release,
dist_name,
dist_release))
_("Repository \"{}\" is not compatible with your distribution. Repository is disabled."
"Your distribution is {} release {}"
"Repository distribution is {} release {}\n"
"If you want add this repository please use \"--ignore-check\" parameter with this command.").format(
name,
ctx.config.values.general.distribution,
ctx.config.values.general.distribution_release,
dist_name,
dist_release)
)
......@@ -269,7 +269,12 @@ class Fetcher:
c.close()
def _get_wget(self):
return os.system("busybox wget -c --user-agent \"{}\" \"{}\" -O \"{}\" 2>&1".format(self.useragent, self.url.get_uri(), self.partial_file))
return os.system("busybox wget -c --user-agent \"{}\" \"{}\" -O \"{}\" 2>&1".format(
self.useragent,
self.url.get_uri(),
self.partial_file
)
)
def _get_requests(self):
from requests import get
......@@ -397,7 +402,8 @@ class Fetcher:
return True
else:
ctx.ui.debug(
_("Server doesn't support partial downloads. Previously downloaded part of the file will be over-written."))
_("Server doesn't support partial downloads."
"Previously downloaded part of the file will be over-written."))
os.remove(self.partial_file)
return False
......
......@@ -1057,7 +1057,10 @@ package might be a good solution."))
fileinfo = witcher(filepath).name
except ValueError:
ctx.ui.warning(
_("File \"{}\" might be a broken symlink. Check it before publishing package.".format(filepath)))
_("File \"{}\" might be a broken symlink. Check it before publishing package.".format(
filepath)
)
)
fileinfo = "broken symlink"
ctx.ui.info(
_("\'magic\' return of \"{0}\" is \"{1}\"").format(
......@@ -1066,8 +1069,11 @@ package might be a good solution."))
result = util.run_batch(
"file {}".format(filepath), ui_debug=False)
if result[0]:
ctx.ui.error(_("\'file\' command failed with return code {0} for file: \"{1}\"").format(result[0], filepath) +
_("Output:\n{}").format(result[1]))
ctx.ui.error(_("\'file\' command failed with return code {0} for file: \"{1}\"").format(
result[0],
filepath) +
_("Output:\n{}").format(result[1])
)
fileinfo = str(result[1])
ctx.ui.info(
......
......@@ -46,13 +46,17 @@ def create_delta_packages_from_obj(old_packages, new_package_obj, specdir):
if old_pkg_info.name != new_pkg_info.name:
ctx.ui.warning(
_("The file \"{0}\" belongs to a different package other than '{1}'. Skipping it...").format(old_package,
new_pkg_info.name))
_("The file \"{0}\" belongs to a different package other than '{1}'. Skipping it...").format(
old_package,
new_pkg_info.name
)
)
continue
if old_pkg_info.release == new_pkg_info.release:
ctx.ui.warning(
_("Package \"{}\" has the same release number with the new package. Skipping it...").format(old_package))
_("Package \"{}\" has the same release number with the new package. Skipping it...").format(old_package)
)
continue
delta_name = "-".join((old_pkg_info.name,
......@@ -71,9 +75,8 @@ def create_delta_packages_from_obj(old_packages, new_package_obj, specdir):
files_delta = find_delta(old_pkg_files, new_pkg_files)
if len(files_delta) == len(new_pkg_files.list):
ctx.ui.warning(_(
"All files in the package \"{}\" are different from the files in the new package. Skipping it...").format(
old_package))
ctx.ui.warning(
_("All files in the package \"{}\" are different from the files in the new package. Skipping it...").format(old_package))
continue
delta_pkg = inary.package.Package(
......
......@@ -256,7 +256,8 @@ def show_changed_configs(package_dict, opt):
for package in package_dict:
if package_dict[package]:
if ctx.ui.confirm(util.colorize(
_("[?] Would you like to see changes in config files of \"{0}\" package").format(package), color='brightyellow')):
_("[?] Would you like to see changes in config files of \"{0}\" package").format(package),
color='brightyellow')):
for file in package_dict[package]:
new_file = util.join_path(
ctx.config.history_dir(), opt, package, ctx.config.dest_dir(), file)
......
......@@ -211,13 +211,19 @@ def install_pkg_files(package_URIs, reinstall=False):
for x in list(d_t.keys()):
pkg = d_t[x]
if pkg.distributionRelease > ctx.config.values.general.distribution_release:
raise Exception(_('Package \"{0}\" is not compatible with your distribution release \'{1}\' \'{2}\'.').format(
x, ctx.config.values.general.distribution,
ctx.config.values.general.distribution_release))
raise Exception(
_('Package \"{0}\" is not compatible with your distribution release \'{1}\' \'{2}\'.').format(
x,
ctx.config.values.general.distribution,
ctx.config.values.general.distribution_release)
)
if pkg.architecture != ctx.config.values.general.architecture:
raise Exception(
_('Package \"{0}\" (\'{1}\') is not compatible with your \'{2}\' architecture.').format(x, pkg.architecture,
ctx.config.values.general.architecture))
_('Package \"{0}\" (\'{1}\') is not compatible with your \'{2}\' architecture.').format(
x,
pkg.architecture,
ctx.config.values.general.architecture)
)
def satisfiesDep(dep):
# is dependency satisfied among available packages
......
......@@ -112,7 +112,8 @@ class Package:
# Bug 3465
if ctx.get_option('reinstall'):
raise Error(_(
"There was a problem while fetching \"{}\".\nThe package may have been upgraded. Please try to upgrade the package.").format(
"There was a problem while fetching \"{}\"."
"The package may have been upgraded. Please try to upgrade the package.").format(
url))
raise
else:
......
......@@ -47,8 +47,8 @@ class Trigger:
else:
cmd_extra = " > /dev/null"
ret_val = os.system(
'bash --noprofile --norc -c \'source postoperations.sh ; if declare -F {0} &>/dev/null ; then {0} ; fi\''.format(func) +
cmd_extra)
'bash --noprofile --norc -c \'source postoperations.sh ; if declare -F {0} &>/dev/null ; then {0} ; fi\''.format(func) + cmd_extra
)
os.chdir(curDir)
if (ret_val != 0):
return False
......@@ -67,9 +67,10 @@ class Trigger:
"brightyellow")))
else:
cmd_extra = " > /dev/null"
ret_val = os.system(
'python3 -c \'import postoperations\nif(hasattr(postoperations,"{0}")):\n postoperations.{0}()\''.format(func) +
cmd_extra)
'python3 -c \'import postoperations\nif(hasattr(postoperations,"{0}")):\n postoperations.{0}()\''.format(func) + cmd_extra
)
os.chdir(curDir)
if (ret_val != 0):
return False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment