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

Function enforce_language_folder_visibility

Scripts/Settings.py:222–242  ·  view source on GitHub ↗

Checks the saved language preference and ensures the Greek folder is hidden or visible accordingly before the menu starts.

()

Source from the content-addressed store, hash-verified

220SPONSORS_GREEK_FOLDER_NAME = "Ελληνική Έκδοση"
221
222def get_existing_sponsors_paths():
223 """Return installed sponsor roots for all runtime code paths.
224
225 This compatibility helper is intentionally defined at module scope. Earlier
226 builds only defined a same-named helper inside the generated DedSec OS server
227 source string, which made Ded-Guy raise NameError in the main Settings process.
228 """
229 paths = []
230 for tier_key in SPONSORS_TIER_ORDER:
231 config = SPONSORS_TIERS.get(str(tier_key), {})
232 root_name = config.get("root_name")
233 if not root_name:
234 continue
235 candidate = os.path.realpath(os.path.join(HOME_DIR, root_name))
236 if os.path.isdir(candidate) and candidate not in paths:
237 paths.append(candidate)
238 return paths
239
240# Define hidden folder name/path for Greek (Necessary for language toggle)
241HIDDEN_GREEK_FOLDER = "." + GREEK_FOLDER_NAME
242HIDDEN_GREEK_PATH = os.path.join(ENGLISH_BASE_PATH, HIDDEN_GREEK_FOLDER)
243
244# --- Markers for Auto-Cleanup (Handles aliases and startup) ---
245BASHRC_START_MARKER = "# --- DedSec Menu Startup (Set by Settings.py) ---"

Callers 1

Settings.pyFile · 0.70

Calls 1

load_language_preferenceFunction · 0.70

Tested by

no test coverage detected