Spaces:
Runtime error
Runtime error
refactor
Browse files
py_code_analyzer/code_fetcher.py
CHANGED
|
@@ -12,8 +12,9 @@ PERSONAL_ACCESS_TOKEN = os.environ.get("PERSONAL_ACCESS_TOKEN", "")
|
|
| 12 |
|
| 13 |
|
| 14 |
class CodeFetcher:
|
|
|
|
| 15 |
def get_python_files(
|
| 16 |
-
|
| 17 |
owner: str,
|
| 18 |
repo: str,
|
| 19 |
path: str = "",
|
|
@@ -41,7 +42,7 @@ class CodeFetcher:
|
|
| 41 |
and result["type"] == "dir"
|
| 42 |
and not result["name"].startswith(".")
|
| 43 |
):
|
| 44 |
-
python_files +=
|
| 45 |
owner, repo, path=result["path"], recursive=recursive
|
| 46 |
)
|
| 47 |
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
class CodeFetcher:
|
| 15 |
+
@classmethod
|
| 16 |
def get_python_files(
|
| 17 |
+
cls,
|
| 18 |
owner: str,
|
| 19 |
repo: str,
|
| 20 |
path: str = "",
|
|
|
|
| 42 |
and result["type"] == "dir"
|
| 43 |
and not result["name"].startswith(".")
|
| 44 |
):
|
| 45 |
+
python_files += cls.get_python_files(
|
| 46 |
owner, repo, path=result["path"], recursive=recursive
|
| 47 |
)
|
| 48 |
|