github_menu_handler module

github_menu_handler.safe_html_escape(text)[מקור]

Escape text for Telegram HTML; preserves / / and keeps existing HTML entities.

github_menu_handler.format_bytes(num)[מקור]

פורמט נחמד לגודל קובץ

Return type:

str

פרמטרים:

num (int)

class github_menu_handler.GitHubMenuHandler[מקור]

Bases: object

__init__()[מקור]
get_user_session(user_id)[מקור]

מחזיר או יוצר סשן משתמש בזיכרון

Return type:

Dict[str, Any]

פרמטרים:

user_id (int)

async show_browse_ref_menu(update, context)[מקור]

תפריט בחירת ref (ענף/תג) עם עימוד וטאבים.

Return type:

None

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_browse_search_results(update, context)[מקור]

חיפוש לפי שם קובץ (prefix/contains) עם עימוד ותוצאות לפתיחה.

Return type:

None

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async check_rate_limit(github_client, update_or_query)[מקור]

בודק את מגבלת ה-API של GitHub

Return type:

bool

פרמטרים:

github_client (github.Github)

async apply_rate_limit_delay(user_id)[מקור]

מוסיף השהייה בין בקשות API

פרמטרים:

user_id (int)

get_user_token(user_id)[מקור]

מקבל טוקן של משתמש - מהסשן או מהמסד נתונים

Return type:

Optional[str]

פרמטרים:

user_id (int)

async show_import_branch_menu(update, context)[מקור]

מציג בחירת ענף לייבוא ריפו (עימוד).

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async import_repo_from_zip(update, context, repo_full, branch)[מקור]

מוריד ZIP רשמי של GitHub (zipball) לענף, מחלץ ל-tmp, ומקליט קבצים ל-DB עם תגיות repo/source.

שמירה: CodeSnippet לקבצים טקסטואליים קטנים (עד IMPORT_MAX_FILE_BYTES) עד סך IMPORT_MAX_TOTAL_BYTES ומקס« IMPORT_MAX_FILES. מדלג על בינאריים, קבצי ענק, ותיקיות מיותרות. מנקה tmp בסוף.

פרמטרים:
async github_menu_command(update, context)[מקור]

מציג תפריט GitHub

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async handle_menu_callback(update, context)[מקור]

Handle menu button clicks

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_repo_selection(query, context)[מקור]

Show repository selection menu

פרמטרים:

context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_repos(update, context, page=0, query=None)[מקור]

מציג רשימת ריפוזיטוריז עם pagination

פרמטרים:
async show_upload_other_files(update, context)[מקור]

מציג רק קבצים שאינם מתויגים repo: ואינם קבצים גדולים, עם עימוד ואימוג’י לפי שפה.

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_upload_repos(update, context)[מקור]

מציג תפריט ריפואים לבחירת קבצים שמורים עם תגית repo: להעלאה

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_upload_repo_files(update, context, _repo_tag)[מקור]

מציג קבצים שמורים תחת תגית ריפו שנבחרה ומאפשר להעלותם עם עימוד

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • _repo_tag (str)

async upload_large_files_menu(update, context)[מקור]

מציג רשימת קבצים גדולים להעלאה לריפו הנבחר

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async handle_large_file_upload(update, context, file_id)[מקור]

מעלה קובץ גדול שנבחר לגיטהאב (עם אותן בדיקות כמו קובץ שמור רגיל)

פרמטרים:
async handle_saved_file_upload(update, context, file_id)[מקור]

מטפל בהעלאת קובץ שמור ל-GitHub

פרמטרים:
async handle_file_upload(update, context)[מקור]

Handle file upload

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async handle_text_input(update, context)[מקור]

Handle text input for various states

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_analyze_repo_menu(update, context)[מקור]

מציג תפריט לניתוח ריפו

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async request_repo_url(update, context)[מקור]

מבקש URL של ריפו לניתוח

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async analyze_another_repo(update, context)[מקור]

מציג תפריט בחירה לניתוח ריפו אחר

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async analyze_repository(update, context, repo_url)[מקור]

מנתח ריפוזיטורי ומציג תוצאות

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • repo_url (str)

async show_improvement_suggestions(update, context)[מקור]

מציג הצעות לשיפור

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_suggestion_details(update, context, suggestion_index)[מקור]

מציג פרטי הצעה ספציפית

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • suggestion_index (int)

async show_full_analysis(update, context)[מקור]

מציג ניתוח מלא

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async download_analysis_json(update, context)[מקור]

שולח קובץ JSON עם הניתוח המלא

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_analyze_results_menu(update, context)[מקור]

מציג מחדש את תפריט התוצאות

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async handle_repo_url_input(update, context)[מקור]

מטפל בקלט של URL לניתוח

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_delete_file_menu(update, context)[מקור]

מציג תפריט מחיקת קובץ מהריפו (דפדוף בכפתורים)

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_delete_repo_menu(update, context)[מקור]

מציג תפריט מחיקת ריפו שלם עם אזהרות

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_delete_file(update, context)[מקור]

מבצע מחיקת קובץ לאחר אישור

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_delete_repo_step1(update, context)[מקור]

מסך אישור סופי לפני מחיקת ריפו, מפנה ללחצן מחיקה סופי

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_delete_repo(update, context)[מקור]

מבצע מחיקת ריפו שלם לאחר אישור

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_danger_delete_menu(update, context)[מקור]

מציג תפריט מחיקות מסוכן

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_download_file_menu(update, context)[מקור]

מציג תפריט הורדת קובץ מהריפו (דפדוף בכפתורים)

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_repo_browser(update, context, only_keyboard=False)[מקור]

מציג דפדפן ריפו לפי נתיב ושימוש (view/download/delete), כולל breadcrumbs ועימוד.

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • only_keyboard (bool)

async handle_inline_query(update, context)[מקור]

Inline mode: חיפוש/ביצוע פעולות ישירות מכל צ’אט

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_notifications_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async toggle_notifications(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async toggle_notifications_pr(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async toggle_notifications_issues(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async set_notifications_interval(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async notifications_check_now(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_pr_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_create_pr_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_confirm_create_pr(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_create_pr(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_merge_pr_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_confirm_merge_pr(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_merge_pr(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async git_checkpoint(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_pre_upload_check(update, context)[מקור]

מציג בדיקות לפני העלאת קובץ שמור (הרשאות/קיום קובץ/ענף/תיקייה).

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async confirm_saved_upload(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async refresh_saved_checks(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_upload_branch_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_upload_folder_menu(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async ask_upload_folder(update, context)[מקור]
פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async create_checkpoint_doc(update, context, kind, name)[מקור]

יוצר קובץ הוראות שחזור לנקודת שמירה ושולח ל-flow של העלאה

פרמטרים:
async show_restore_checkpoint_menu(update, context)[מקור]

מציג רשימת תגיות נקודות שמירה לבחירה לשחזור

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async show_restore_tag_actions(update, context, tag_name)[מקור]

מציג פעולות אפשריות לשחזור מתגית נתונה

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • tag_name (str)

async create_branch_from_tag(update, context, tag_name)[מקור]

יוצר ענף חדש שמצביע ל-commit של התגית לשחזור נוח

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • tag_name (str)

async open_pr_from_branch(update, context, branch_name)[מקור]

פותח Pull Request מהענף שנוצר אל הענף הראשי של הריפו

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • branch_name (str)

async create_revert_pr_from_tag(update, context, tag_name)[מקור]

יוצר PR שמשחזר את מצב הריפו לתגית ע“י יצירת commit חדש עם עץ התגית על גבי base. כך תמיד יהיה diff וה-PR ייפתח בהצלחה.

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

  • tag_name (str)

async show_github_backup_menu(update, context)[מקור]

מציג תפריט גיבוי/שחזור עבור הריפו הנבחר

פרמטרים:
  • update (telegram.Update)

  • context (telegram.ext.ContextTypes.DEFAULT_TYPE)

async restore_zip_file_to_repo(update, context, zip_path, purge_first)[מקור]

שחזור קבצים מ-ZIP מקומי לריפו הנוכחי באמצעות Trees API (commit אחד)

Return type:

None

פרמטרים: