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

Function set_user_security

Scripts/ButSystem.py:11054–11096  ·  view source on GitHub ↗

set_user_security. Internal helper function. This docstring was added automatically to improve maintainability. Args: username: Parameter. q1: Parameter. q2: Parameter. q3: Parameter. a1: Parameter. a2: Parameter. a3: Parameter. enabled: Parameter. Returns: Va

(username: str, q1: str, q2: str, q3: str, a1: str, a2: str, a3: str, enabled: bool)

Source from the content-addressed store, hash-verified

11052 ("telecom", {"en": "Telecom", "el": "Τηλεπικοινωνίες"},
11053 {"en": "telecommunications 5G mobile networks broadband", "el": "τηλεπικοινωνίες 5G δίκτυα κινητής ευρυζωνικότητα"}),
11054 ("transport", {"en": "Cars & Transport", "el": "Αυτοκίνητα & Μεταφορές"},
11055 {"en": "cars electric vehicles transport aviation", "el": "αυτοκίνητα ηλεκτρικά οχήματα μεταφορές αεροπορία"}),
11056 ("travel", {"en": "Travel", "el": "Ταξίδια"},
11057 {"en": "travel tourism destinations airlines", "el": "ταξίδια τουρισμός προορισμοί αεροπορικές"}),
11058 ("entertainment", {"en": "Entertainment", "el": "Ψυχαγωγία"},
11059 {"en": "movies television music entertainment", "el": "ταινίες τηλεόραση μουσική ψυχαγωγία"}),
11060 ("sports", {"en": "Sports", "el": "Αθλητισμός"},
11061 {"en": "sports football basketball Formula 1 tennis", "el": "αθλητισμός ποδόσφαιρο μπάσκετ Formula 1 τένις"}),
11062 ("education", {"en": "Education", "el": "Εκπαίδευση"},
11063 {"en": "education schools universities students", "el": "εκπαίδευση σχολεία πανεπιστήμια μαθητές φοιτητές"}),
11064]
11065
11066
11067def _google_news_rss(query: str, lang: str) -> str:
11068 """Build a Google News RSS search URL for the requested UI language."""
11069 lang = "el" if lang == "el" else "en"
11070 if lang == "el":
11071 hl, gl, ceid = "el", "GR", "GR:el"
11072 else:
11073 hl, gl, ceid = "en-US", "US", "US:en"
11074 q = urllib.parse.quote_plus(query)
11075 return f"https://news.google.com/rss/search?q={q}&hl={hl}&gl={gl}&ceid={ceid}"
11076
11077def _news_feeds_for_lang(lang: str) -> List[Tuple[str, str, str, str, bool]]:
11078 """Return a list of feeds: (source_label, url, topic_key, topic_label, is_google)."""
11079 lang = "el" if lang == "el" else "en"
11080 feeds: List[Tuple[str, str, str, str, bool]] = []
11081
11082 # Direct feeds for English (fast + high quality).
11083 if lang == "en":
11084 feeds.extend([
11085 ("The Hacker News", "https://feeds.feedburner.com/TheHackersNews?format=xml", "cybersecurity", "Cybersecurity", False),
11086 ("BleepingComputer", "https://www.bleepingcomputer.com/feed/", "cybersecurity", "Cybersecurity", False),
11087 ("KrebsOnSecurity", "https://krebsonsecurity.com/feed/", "cybersecurity", "Cybersecurity", False),
11088 ("CoinDesk", "https://www.coindesk.com/arc/outboundfeeds/rss/?outputType=xml", "crypto", "Crypto", False),
11089 ])
11090
11091 # Google News RSS searches for worldwide coverage + the specific topics.
11092 for key, labels, queries in NEWS_TOPICS:
11093 topic_label = labels.get(lang, labels["en"])
11094 q = queries.get(lang, queries["en"])
11095 feeds.append(("Google News", _google_news_rss(q, lang), key, topic_label, True))
11096
11097 return feeds
11098
11099def _norm_space(s: str) -> str:

Callers 1

Calls 3

_norm_answerFunction · 0.70
db_connectFunction · 0.70
now_zFunction · 0.70

Tested by

no test coverage detected