Minor code cleanup
This commit is contained in:
parent
bc54dd803a
commit
5dca985412
10
bin/addpkg
10
bin/addpkg
@ -59,14 +59,12 @@ def add_pkgfile(pkgfile, cachedir):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c", "--cachedir", help="alternative directory to use for moving package"
|
||||||
"--cachedir",
|
|
||||||
help="alternative directory to use for moving package"
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d",
|
"-d",
|
||||||
"--db-filename",
|
"--db-filename",
|
||||||
help="alternative filename for database without extension"
|
help="alternative filename for database without extension",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-s",
|
"-s",
|
||||||
@ -101,8 +99,8 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
||||||
|
|
||||||
if args.db-filename is not None:
|
if args.db_filename is not None:
|
||||||
db = os.path.join(cachedir, f"{args.db-filename}.{DB_EXT}")
|
db = os.path.join(cachedir, f"{args.db_filename}.{DB_EXT}")
|
||||||
else:
|
else:
|
||||||
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||||
|
|
||||||
|
10
bin/delpkg
10
bin/delpkg
@ -54,14 +54,12 @@ def del_pkgfile(pkg):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c", "--cachedir", help="alternative directory to use for moving package"
|
||||||
"--cachedir",
|
|
||||||
help="alternative directory to use for moving package"
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d",
|
"-d",
|
||||||
"--db-filename",
|
"--db-filename",
|
||||||
help="alternative filename for database without extension"
|
help="alternative filename for database without extension",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-s",
|
"-s",
|
||||||
@ -96,8 +94,8 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
||||||
|
|
||||||
if args.db-filename is not None:
|
if args.db_filename is not None:
|
||||||
db = os.path.join(cachedir, f"{args.db-filename}.{DB_EXT}")
|
db = os.path.join(cachedir, f"{args.db_filename}.{DB_EXT}")
|
||||||
else:
|
else:
|
||||||
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user