Clean if statement block and globs
This commit is contained in:
parent
6c49217b0b
commit
c789f779ef
@ -16,7 +16,7 @@ def get_pkgfiles(query=None, directory=None, signatures_only=False):
|
|||||||
:param query: names of package files to search for
|
:param query: names of package files to search for
|
||||||
:type query: str
|
:type query: str
|
||||||
:param directory: a directory to search in
|
:param directory: a directory to search in
|
||||||
:type directory: str, bytes, or path-like object
|
:type directory: str
|
||||||
:param signatures_only: include only signature files
|
:param signatures_only: include only signature files
|
||||||
:type signatures_only: bool
|
:type signatures_only: bool
|
||||||
:returns: paths of package files
|
:returns: paths of package files
|
||||||
@ -27,13 +27,11 @@ def get_pkgfiles(query=None, directory=None, signatures_only=False):
|
|||||||
else:
|
else:
|
||||||
path = os.getcwd()
|
path = os.getcwd()
|
||||||
|
|
||||||
if signatures_only:
|
if signatures_only and query is not None:
|
||||||
if query is not None:
|
return glob.glob(f"{path}/*{query}*.{SIGEXT}")
|
||||||
return glob.glob(f"{path}/{query}*.{SIGEXT}")
|
elif signatures_only and query is None:
|
||||||
else:
|
|
||||||
return glob.glob(f"{path}/*.{SIGEXT}")
|
return glob.glob(f"{path}/*.{SIGEXT}")
|
||||||
else:
|
elif not signatures_only and query is not None:
|
||||||
if query is not None:
|
return glob.glob(f"{path}/*{query}*.{PKGEXT}")
|
||||||
return glob.glob(f"{path}/{query}*.{PKGEXT}")
|
elif not signatures_only and query is None:
|
||||||
else:
|
|
||||||
return glob.glob(f"{path}/*.{PKGEXT}")
|
return glob.glob(f"{path}/*.{PKGEXT}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user