Commit d6d64089 authored by Benjamin Winger's avatar Benjamin Winger

Shortened strings to fit within line length

parent c6d0211a
......@@ -48,7 +48,8 @@ def parse_args():
parser.add_argument("mods", metavar="MOD", help="Mods to install", nargs="*")
parser.add_argument(
"--import",
help="automatically generates pybuilds for mods specified in the given file. File should consist a mod atom and url per line, separated by a space",
help="automatically generates pybuilds for mods specified in the given file. \
File should consist a mod atom and url per line, separated by a space",
dest="import_mods",
)
parser.add_argument(
......@@ -57,7 +58,8 @@ def parse_args():
parser.add_argument(
"-c",
"--depclean",
help="Removes mods and their dependencies. Will also remove mods dependent on the given mods",
help="Removes mods and their dependencies. \
Will also remove mods dependent on the given mods",
action="store_true",
)
parser.add_argument(
......@@ -74,13 +76,15 @@ def parse_args():
parser.add_argument(
"-1",
"--oneshot",
help="Do not make any changes to the world set when instaling or removing mods",
help="Do not make any changes to the world set when \
installing or removing mods",
action="store_true",
)
parser.add_argument(
"-v",
"--verbose",
help="Print extra information. Currently shows mod repository and all use flag states, rather than just changed use flags",
help="Print extra information. Currently shows mod repository and all use flag \
states, rather than just changed use flags",
action="store_true",
)
parser.add_argument(
......@@ -93,20 +97,23 @@ def parse_args():
parser.add_argument(
"-u",
"--update",
help="Updates mods to the best version available and excludes packages if they are already up to date.",
help="Updates mods to the best version available and excludes packages \
if they are already up to date.",
action="store_true",
)
parser.add_argument(
"-N",
"--newuse",
help="Includes mods whose use flags have changed since they were last installed",
help="Includes mods whose use flags have changed since they were last \
installed",
action="store_true",
)
# TODO: Implement
parser.add_argument(
"-D",
"--deep",
help="Consider entire dependency tree when doing dependency resolution instead of just the immediate dependencies [unimplemented]",
help="Consider entire dependency tree when doing dependency resolution \
instead of just the immediate dependencies [unimplemented]",
action="store_true",
)
parser.add_argument(
......@@ -118,18 +125,21 @@ def parse_args():
parser.add_argument(
"-S",
"--searchdesc",
help="Searches the repository for mods with the given phrase in their name or description",
help="Searches the repository for mods with the given phrase in their name \
or description",
action="store_true",
)
# TODO: Ensure that installed mods database matches mods that are actually installed
parser.add_argument(
"--validate",
help="Checks if the mods in the mod directory are installed, and that the directories in the config all exist",
help="Checks if the mods in the mod directory are installed, and that the \
directories in the config all exist",
action="store_true",
)
parser.add_argument(
"--sort-config",
help="Sorts the config. This is for debugging purposes, as the config is normally sorted as necessary.",
help="Sorts the config. This is for debugging purposes, as the config is \
normally sorted as necessary.",
action="store_true",
)
parser.add_argument("--debug", help="Enables debug traces", action="store_true")
......@@ -188,11 +198,7 @@ def configure_mods(
pending_mods = load_mod(atom)
if pending_mods is None:
print(
"{}: invalid atom {}".format(
red("ERROR"), green(mod)
)
)
print("{}: invalid atom {}".format(red("ERROR"), green(mod)))
return
elif len(pending_mods) > 0:
(to_install, dep) = select_mod(pending_mods)
......@@ -214,9 +220,8 @@ def configure_mods(
transactions.mods.append((Trans.DELETE, to_remove))
else:
warn(
'trying to remove mod "{}", which is not actually installed. Skipping...'.format(
green(atom)
)
'trying to remove mod "{}", which is not actually '
"installed. Skipping...".format(green(atom))
)
elif installed is not None and installed.ATOM == to_install.ATOM:
transactions.mods.append((Trans.REINSTALL, to_install))
......@@ -226,7 +231,8 @@ def configure_mods(
print("Unable to find mod for atom {}".format(atom))
return
# Find dependencies for mods and build list of mods to install (or uninstall depending on other arguments)
# Find dependencies for mods and build list of mods to install
# (or uninstall depending on other arguments)
if delete:
# Do nothing. We don't care about deps
pass
......@@ -256,9 +262,7 @@ def configure_mods(
else:
c = Fore.YELLOW
print(
" {} {}".format(
green(keyword.atom), colour(c, keyword.keyword)
)
" {} {}".format(green(keyword.atom), colour(c, keyword.keyword))
)
if prompt_bool("Would you like to automatically apply these changes?"):
......@@ -275,9 +279,7 @@ def configure_mods(
)
for license in license_changes:
print(
" {} {}".format(
green(license.atom), colour(c, license.license)
)
" {} {}".format(green(license.atom), colour(c, license.license))
)
def print_restricted_fetch(transactions: Transactions):
......@@ -339,12 +341,15 @@ def configure_mods(
transstring = io.StringIO()
print_transactions(merged, True, transstring, False)
if len(gitrepo.head.commit.diff("HEAD")) > 0:
# There was an error. We report the mods that were successfully merged and note that an error occurred,
# however we still commit anyway.
# There was an error. We report the mods that were successfully merged and
# note that an error occurred, however we still commit anyway.
if error:
gitrepo.git.commit(
m="Successfully merged {} mods. Error occurred when attempting to merge {}\n{}".format(
len(transactions.mods), error, transstring.getvalue()
m=(
"Successfully merged {} mods. Error occurred when attempting to "
"merge {}\n{}".format(
len(transactions.mods), error, transstring.getvalue()
)
)
)
else:
......@@ -375,11 +380,7 @@ def configure_mods(
warn("The following mods need to be rebuilt:")
for atom in get_set("rebuild"):
print(" {}".format(green(atom)))
print(
"Use {} to rebuild these mods".format(
lgreen("mwmerge @rebuild")
)
)
print("Use {} to rebuild these mods".format(lgreen("mwmerge @rebuild")))
# Fix ordering in openmw.cfg
sort_config()
......@@ -404,9 +405,8 @@ def main():
if os.path.exists(TMP_DIR):
if args.no_confirm or prompt_bool(
"Tempdir {} already exists, possibly due to the script exiting prematurely. Remove?".format(
TMP_DIR
)
"Tempdir {} already exists, possibly due to the script exiting "
"prematurely. Remove?".format(TMP_DIR)
):
shutil.rmtree(TMP_DIR)
......@@ -414,16 +414,14 @@ def main():
config = read_config()
for path in nonexistant_mods(config):
warn(
'"{}" does not exist, but is referenced in the OpenMW config file!'.format(
path
)
'"{}" does not exist, but is referenced in the OpenMW '
"config file!".format(path)
)
for path in mods_not_in_config(config):
warn(
'Directory "{}" is in mod directory, but not used in the OpenMW config file!'.format(
path
)
'Directory "{}" is in mod directory, but not used in the '
"OpenMW config file!".format(path)
)
if args.sync:
......@@ -458,9 +456,8 @@ def main():
print("Initialized Repository")
elif repo.auto_sync:
err(
'Sync type "{}" for repo "{}" is not supported. Supported types are: git'.format(
repo.sync_type, repo.name
)
'Sync type "{}" for repo "{}" is not supported. '
"Supported types are: git".format(repo.sync_type, repo.name)
)
if args.search:
......
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