Add @staticmethod to improve performance.
This commit is contained in:
@@ -29,7 +29,8 @@ class PageFetcher:
|
|||||||
"""Initialize the page fetcher and Reticulum connection."""
|
"""Initialize the page fetcher and Reticulum connection."""
|
||||||
# RNS should already be initialized by main app
|
# RNS should already be initialized by main app
|
||||||
|
|
||||||
def fetch_page(self, req: PageRequest) -> str:
|
@staticmethod
|
||||||
|
def fetch_page(req: PageRequest) -> str:
|
||||||
"""Download page content for the given PageRequest.
|
"""Download page content for the given PageRequest.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class StorageManager:
|
|||||||
"""Get the path to the main configuration file."""
|
"""Get the path to the main configuration file."""
|
||||||
return self._storage_dir / "config"
|
return self._storage_dir / "config"
|
||||||
|
|
||||||
def get_reticulum_config_path(self) -> pathlib.Path:
|
@staticmethod
|
||||||
|
def get_reticulum_config_path() -> pathlib.Path:
|
||||||
"""Get the path to the Reticulum configuration directory."""
|
"""Get the path to the Reticulum configuration directory."""
|
||||||
# Check for global override from app
|
# Check for global override from app
|
||||||
try:
|
try:
|
||||||
@@ -229,7 +230,8 @@ class StorageManager:
|
|||||||
"has_client_storage": self.page and hasattr(self.page, "client_storage"),
|
"has_client_storage": self.page and hasattr(self.page, "client_storage"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _is_writable(self, path: pathlib.Path) -> bool:
|
@staticmethod
|
||||||
|
def _is_writable(path: pathlib.Path) -> bool:
|
||||||
"""Check if a directory is writable."""
|
"""Check if a directory is writable."""
|
||||||
try:
|
try:
|
||||||
test_file = path / ".write_test"
|
test_file = path / ".write_test"
|
||||||
|
|||||||
Reference in New Issue
Block a user