Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def mkdir(self, dir_name: str) -> Union[None, Dict[str, str]]:

def touch(self, file_name: str) -> Union[None, Dict[str, str]]:
"""
Create a new file in the current directory.
Create a new file of any extension in the current directory.

Args:
file_name (str): The name of the new file in the current directory. file_name is local to the current directory and does not allow path.
Expand Down Expand Up @@ -372,7 +372,7 @@ def echo(

def cat(self, file_name: str) -> Dict[str, str]:
"""
Display the contents of a file from currrent directory.
Display the contents of a file of any extension from currrent directory.

Args:
file_name (str): The name of the file from current directory to display. No path is allowed.
Expand All @@ -396,7 +396,7 @@ def find(self, path: str = ".", name: Optional[str] = None) -> Dict[str, List[st
"""
Find any file or directories under specific path that contain name in its file name.

This method searches for files and directories within a specified path that match
This method searches for files of any extension and directories within a specified path that match
the given name. If no name is provided, it returns all files and directories
in the specified path and its subdirectories.
Note: This method performs a recursive search through all subdirectories of the given path.
Expand Down Expand Up @@ -425,7 +425,7 @@ def recursive_search(directory: Directory, base_path: str) -> None:

def wc(self, file_name: str, mode: str = "l") -> Dict[str, Union[int, str]]:
"""
Count the number of lines, words, and characters in a file from current directory.
Count the number of lines, words, and characters in a file of any extension from current directory.

Args:
file_name (str): Name of the file of current directory to perform wc operation on.
Expand Down Expand Up @@ -480,7 +480,7 @@ def sort(self, file_name: str) -> Dict[str, str]:

def grep(self, file_name: str, pattern: str) -> Dict[str, List[str]]:
"""
Search for lines in a file at current directory that contain the specified pattern.
Search for lines in a file of any extension at current directory that contain the specified pattern.

Args:
file_name (str): The name of the file to search. No path is allowed and you can only perform on file at local directory.
Expand Down Expand Up @@ -539,7 +539,7 @@ def get_size(item: Union[File, Directory]) -> int:

def tail(self, file_name: str, lines: int = 10) -> Dict[str, str]:
"""
Display the last part of a file.
Display the last part of a file of any extension.

Args:
file_name (str): The name of the file to display. No path is allowed and you can only perform on file at local directory.
Expand All @@ -563,7 +563,7 @@ def tail(self, file_name: str, lines: int = 10) -> Dict[str, str]:

def diff(self, file_name1: str, file_name2: str) -> Dict[str, str]:
"""
Compare two files line by line at the current directory.
Compare two files of any extension line by line at the current directory.

Args:
file_name1 (str): The name of the first file in current directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_ticket(self, ticket_id: int) -> Dict[str, Union[int, str]]:
priority (int): Priority level of the ticket.
created_by (str): Username of the ticket creator.
"""
ticket = self.find_ticket(ticket_id)
ticket = self._find_ticket(ticket_id)
if not ticket:
return {"error": f"Ticket with ID {ticket_id} not found."}
return ticket
Expand All @@ -110,7 +110,7 @@ def close_ticket(self, ticket_id: int) -> Dict[str, str]:
Returns:
status (str): Status of the close operation.
"""
ticket = self.find_ticket(ticket_id)
ticket = self._find_ticket(ticket_id)
if not ticket:
return {"error": f"Ticket with ID {ticket_id} not found."}
if ticket["status"] == "Closed":
Expand All @@ -129,7 +129,7 @@ def resolve_ticket(self, ticket_id: int, resolution: str) -> Dict[str, str]:
Returns:
status (str): Status of the resolve operation.
"""
ticket = self.find_ticket(ticket_id)
ticket = self._find_ticket(ticket_id)
if not ticket:
return {"error": f"Ticket with ID {ticket_id} not found."}
if ticket["status"] == "Resolved":
Expand All @@ -155,7 +155,7 @@ def edit_ticket(
Returns:
status (str): Status of the update operation.
"""
ticket = self.find_ticket(ticket_id)
ticket = self._find_ticket(ticket_id)
if not ticket:
return {"error": f"Ticket with ID {ticket_id} not found."}

Expand All @@ -170,7 +170,7 @@ def edit_ticket(

return {"status": f"Ticket {ticket_id} has been updated successfully."}

def find_ticket(self, ticket_id: int) -> Optional[Dict[str, Union[int, str]]]:
def _find_ticket(self, ticket_id: int) -> Optional[Dict[str, Union[int, str]]]:
"""
Find a ticket by its ID.

Expand Down
Loading