mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
fix(generator): fix import paths + add service config constants
This commit is contained in:
@@ -103,3 +103,15 @@ TAG_TOPIC_MAP = {
|
|||||||
"gcp": "Cloud",
|
"gcp": "Cloud",
|
||||||
}
|
}
|
||||||
"""Map repository topics to developer role categories."""
|
"""Map repository topics to developer role categories."""
|
||||||
|
|
||||||
|
# --- Service-specific additions (v2 of config) ---
|
||||||
|
|
||||||
|
PORT = int(os.getenv("GENERATOR_PORT", "5002"))
|
||||||
|
SETTINGS_DB_PATH = os.getenv("GENERATOR_SETTINGS_DB_PATH", "./data/settings.db")
|
||||||
|
WIDGETS_DB_PATH = os.getenv("GENERATOR_WIDGETS_DB_PATH", "./data/widgets.db")
|
||||||
|
FETCHER_URL = os.getenv("FETCHER_URL", "http://localhost:5001")
|
||||||
|
FETCHER_INTERNAL_TOKEN = os.getenv("FETCHER_INTERNAL_TOKEN", "")
|
||||||
|
REDIS_URL = os.getenv("REDIS_URL", "")
|
||||||
|
ENROLLMENT_DAILY_CAP = int(os.getenv("ENROLLMENT_DAILY_CAP", "50"))
|
||||||
|
WIDGET_LRU_PER_USER = int(os.getenv("WIDGET_LRU_PER_USER", "10"))
|
||||||
|
POLL_INTERVAL_MINUTES = int(os.getenv("GENERATOR_POLL_INTERVAL_MINUTES", "15"))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from ..models import (
|
from .models import (
|
||||||
GradeData,
|
GradeData,
|
||||||
TagData,
|
TagData,
|
||||||
ImpactWeek,
|
ImpactWeek,
|
||||||
@@ -11,7 +11,7 @@ from ..models import (
|
|||||||
FocusCategory,
|
FocusCategory,
|
||||||
LanguageData,
|
LanguageData,
|
||||||
)
|
)
|
||||||
from ..widgets import (
|
from .widgets import (
|
||||||
render_grade_widget,
|
render_grade_widget,
|
||||||
render_impact_widget,
|
render_impact_widget,
|
||||||
render_collaborators_widget,
|
render_collaborators_widget,
|
||||||
@@ -150,7 +150,7 @@ def _compute_tags(github_data: dict, max_tags: int = None, custom_tags: list[str
|
|||||||
Returns:
|
Returns:
|
||||||
List of TagData objects with inferred developer roles
|
List of TagData objects with inferred developer roles
|
||||||
"""
|
"""
|
||||||
from ..config import TAG_MAX_COUNT, TAG_LANGUAGE_MAP, TAG_TOPIC_MAP, HIDDEN_LANGUAGES
|
from .config import TAG_MAX_COUNT, TAG_LANGUAGE_MAP, TAG_TOPIC_MAP, HIDDEN_LANGUAGES
|
||||||
|
|
||||||
if max_tags is None:
|
if max_tags is None:
|
||||||
max_tags = TAG_MAX_COUNT
|
max_tags = TAG_MAX_COUNT
|
||||||
@@ -372,7 +372,7 @@ def compute_focus(github_data: dict, hidden_languages: list[str] = None) -> list
|
|||||||
github_data: GitHub profile data
|
github_data: GitHub profile data
|
||||||
hidden_languages: Optional list of languages to exclude
|
hidden_languages: Optional list of languages to exclude
|
||||||
"""
|
"""
|
||||||
from ..config import HIDDEN_LANGUAGES
|
from .config import HIDDEN_LANGUAGES
|
||||||
|
|
||||||
if hidden_languages is None:
|
if hidden_languages is None:
|
||||||
hidden_languages = HIDDEN_LANGUAGES
|
hidden_languages = HIDDEN_LANGUAGES
|
||||||
@@ -465,7 +465,7 @@ def compute_languages(github_data: dict, hidden_languages: list[str] = None) ->
|
|||||||
github_data: GitHub profile data
|
github_data: GitHub profile data
|
||||||
hidden_languages: Optional list of languages to exclude (e.g., ["HTML", "CSS"])
|
hidden_languages: Optional list of languages to exclude (e.g., ["HTML", "CSS"])
|
||||||
"""
|
"""
|
||||||
from ..config import HIDDEN_LANGUAGES
|
from .config import HIDDEN_LANGUAGES
|
||||||
|
|
||||||
if hidden_languages is None:
|
if hidden_languages is None:
|
||||||
hidden_languages = HIDDEN_LANGUAGES
|
hidden_languages = HIDDEN_LANGUAGES
|
||||||
@@ -510,7 +510,7 @@ def generate_widgets_from_github(
|
|||||||
widget_settings: Optional per-widget settings dict, keyed by widget name.
|
widget_settings: Optional per-widget settings dict, keyed by widget name.
|
||||||
Each value is a dict of settings for that widget's renderer.
|
Each value is a dict of settings for that widget's renderer.
|
||||||
"""
|
"""
|
||||||
from ..config import ENABLED_WIDGETS
|
from .config import ENABLED_WIDGETS
|
||||||
|
|
||||||
if enabled is None:
|
if enabled is None:
|
||||||
enabled = ENABLED_WIDGETS
|
enabled = ENABLED_WIDGETS
|
||||||
|
|||||||
Reference in New Issue
Block a user