Updated for bool

This commit is contained in:
Dimitris Zlatanidis 2023-03-30 10:46:20 +03:00
parent 339559372f
commit 01d07a68f5

View file

@ -6,7 +6,7 @@ import time
import shutil import shutil
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from typing import Generator, Any, Union from typing import Generator, Union
from slpkg.configs import Configs from slpkg.configs import Configs
from slpkg.blacklist import Blacklist from slpkg.blacklist import Blacklist
@ -122,9 +122,11 @@ class Utilities:
return ''.join(re.findall(r'\d+', line)) return ''.join(re.findall(r'\d+', line))
@staticmethod @staticmethod
def is_option(flag: list, flags: list) -> Any: def is_option(flag: list, flags: list) -> bool:
""" Checking for flags. """ """ Checking for flags. """
return [f for f in flag if f in flags] for f in flag:
if f in flags:
return True
def read_packages_from_file(self, file: Path) -> Generator: def read_packages_from_file(self, file: Path) -> Generator:
""" Reads packages from file and split these to list. """ """ Reads packages from file and split these to list. """