autopep8 run

This commit is contained in:
Evgenii Alekseev 2021-03-15 02:27:42 +03:00
parent d3e79120cb
commit 663e822a92
47 changed files with 71 additions and 68 deletions

View File

@ -73,9 +73,11 @@ def update(args: argparse.Namespace) -> None:
update packages callback update packages callback
:param args: command line args :param args: command line args
''' '''
app = Application.from_args(args)
# typing workaround # typing workaround
log_fn = lambda line: print(line) if args.dry_run else app.logger.info(line) def log_fn(line: str) -> None:
return print(line) if args.dry_run else app.logger.info(line)
app = Application.from_args(args)
packages = app.get_updates(args.package, args.no_aur, args.no_manual, args.no_vcs, log_fn) packages = app.get_updates(args.package, args.no_aur, args.no_manual, args.no_vcs, log_fn)
if args.dry_run: if args.dry_run:
return return
@ -128,7 +130,8 @@ if __name__ == '__main__':
update_parser = subparsers.add_parser('update', description='run updates') update_parser = subparsers.add_parser('update', description='run updates')
update_parser.add_argument('package', help='filter check by packages', nargs='*') update_parser.add_argument('package', help='filter check by packages', nargs='*')
update_parser.add_argument('--dry-run', help='just perform check for updates, same as check command', action='store_true') update_parser.add_argument(
'--dry-run', help='just perform check for updates, same as check command', action='store_true')
update_parser.add_argument('--no-aur', help='do not check for AUR updates', action='store_true') update_parser.add_argument('--no-aur', help='do not check for AUR updates', action='store_true')
update_parser.add_argument('--no-manual', help='do not include manual updates', action='store_true') update_parser.add_argument('--no-manual', help='do not include manual updates', action='store_true')
update_parser.add_argument('--no-vcs', help='do not check VCS packages', action='store_true') update_parser.add_argument('--no-vcs', help='do not check VCS packages', action='store_true')

View File

@ -62,11 +62,11 @@ class Package:
:return: True in case if package base looks like VCS package and false otherwise :return: True in case if package base looks like VCS package and false otherwise
''' '''
return self.base.endswith('-bzr') \ return self.base.endswith('-bzr') \
or self.base.endswith('-csv')\ or self.base.endswith('-csv')\
or self.base.endswith('-darcs')\ or self.base.endswith('-darcs')\
or self.base.endswith('-git')\ or self.base.endswith('-git')\
or self.base.endswith('-hg')\ or self.base.endswith('-hg')\
or self.base.endswith('-svn') or self.base.endswith('-svn')
@property @property
def web_url(self) -> str: def web_url(self) -> str:
@ -113,7 +113,7 @@ class Package:
return cls(package.base, package.version, aur_url, {package.name: os.path.basename(path)}) return cls(package.base, package.version, aur_url, {package.name: os.path.basename(path)})
@classmethod @classmethod
def from_aur(cls: Type[Package], name: str, aur_url: str)-> Package: def from_aur(cls: Type[Package], name: str, aur_url: str) -> Package:
''' '''
construct package properties from AUR page construct package properties from AUR page
:param name: package name (either base or normal name) :param name: package name (either base or normal name)