MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / github_account_menu

Function github_account_menu

Scripts/Settings.py:1436–1464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1434 try:
1435 response = requests.get(
1436 f"https://api.github.com/users/{quote(owner, safe='')}/repos",
1437 params={"per_page": 100, "page": page, "type": "public", "sort": "full_name", "direction": "asc"},
1438 headers=headers,
1439 timeout=30,
1440 )
1441 response.raise_for_status()
1442 payload = response.json()
1443 if not isinstance(payload, list):
1444 break
1445 for item in payload:
1446 name = str(item.get("name") or "")
1447 key = name.casefold()
1448 if key in remaining:
1449 try:
1450 size_map[(owner.casefold(), key)] = max(0, int(item.get("size") or 0))
1451 except Exception:
1452 pass
1453 remaining.discard(key)
1454 if not remaining or len(payload) < 100:
1455 break
1456 except Exception as exc:
1457 pipboy_log_error(f"backup repository size lookup for {owner}", exc)
1458 break
1459
1460 return size_map
1461
1462
1463def _ordered_project_save_repositories():
1464 """Return backup repositories ordered by current GitHub size, smallest first."""
1465 repo_sources = list(PROJECT_SAVE_REPOSITORIES)
1466 size_map = _project_save_repository_size_map(repo_sources)
1467

Callers 1

mainFunction · 0.70

Calls 9

printFunction · 0.85
inputFunction · 0.85
github_current_usernameFunction · 0.70
github_auth_statusFunction · 0.70
_Function · 0.70
connect_github_accountFunction · 0.70
show_github_statsFunction · 0.70

Tested by

no test coverage detected