Skip to content

Commit

Permalink
docs: add mnissing docstrings to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-RA-King committed Apr 6, 2023
1 parent a82cd0a commit d19176f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pynball/pynball.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@


def get_environ(env_name: str) -> Path:
"""Return the Path given the environment variable name"""
try:
env_value = Path(os.environ[env_name])
except KeyError:
Expand All @@ -59,6 +60,7 @@ def cli() -> None:


def del_rw(action, name, exc): # type: ignore
"""Change the access permissions for a file object to writeable and delete it"""
os.chmod(name, stat.S_IWRITE)
os.remove(name)

Expand Down Expand Up @@ -87,6 +89,7 @@ def _feedback(message: str, feedback_type: str) -> None:


def _file_word_replace(filepath: Path, old_word: str, new_word: str) -> Any:
"""Open the given file and replace old word with a new word"""
with open(filepath) as file:
file_data = file.read()
file_data = file_data.replace(old_word, new_word)
Expand Down Expand Up @@ -754,6 +757,7 @@ def mvproject(ctx: Any, old_name: str, new_name: str) -> None:
]

def glob_to_re(glob_list: list) -> str:
"""Given a glob file pattern return a regex pattern"""
re_list = [fnmatch.translate(x) for x in glob_list]
combined = "(" + ")|(".join(re_list) + ")"
return combined
Expand Down

0 comments on commit d19176f

Please sign in to comment.