Skip to content

Commit

Permalink
Add docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemadden42 committed Dec 31, 2023
1 parent 8a0e316 commit afa263b
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions fub
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ logging.basicConfig(


def get_arch(mac_app: Union[str, Path]) -> List[str]:
"""Determine the type of macOS app."""
"""
Determine the architecture type(s) of a macOS app.
Args:
mac_app (Union[str, Path]): Path to the macOS app.
Returns:
List[str]: List of architecture types present in the app.
"""
m = MachO.MachO(str(mac_app))
archs = []
for header in m.headers:
Expand All @@ -32,15 +40,26 @@ def get_arch(mac_app: Union[str, Path]) -> List[str]:


def print_list(items: List[str], header: str) -> None:
"""Print list with provided header."""
"""
Print a list with the provided header.
Args:
items (List[str]): List of items to be printed.
header (str): Header to be printed before the list.
"""
print(header)
for item in items:
print(item)
print()


def filter_binaries(mac_apps: List[Union[str, Path]]) -> None:
"""Determine the type of macOS app."""
"""
Determine the architecture type(s) of macOS apps and print them categorized.
Args:
mac_apps (List[Union[str, Path]]): List of paths to macOS apps.
"""
intel_binaries = []
apple_binaries = []
universal_binaries = []
Expand All @@ -67,7 +86,12 @@ def filter_binaries(mac_apps: List[Union[str, Path]]) -> None:


def get_app_binaries() -> List[Union[str, Path]]:
"""Get list of installed macOS applications."""
"""
Get a list of installed macOS applications.
Returns:
List[Union[str, Path]]: List of paths to macOS app binaries.
"""
apps = os.listdir("/Applications")
apps.sort()
binaries = []
Expand Down

0 comments on commit afa263b

Please sign in to comment.