Skip to content

Add mwclient wrapper methods for MediaWiki API operations#7

Closed
Copilot wants to merge 1 commit intoupdatefrom
copilot/fix-177789851-1142115024-caa4d46e-ff02-4736-9cbb-07c41bceab3f
Closed

Add mwclient wrapper methods for MediaWiki API operations#7
Copilot wants to merge 1 commit intoupdatefrom
copilot/fix-177789851-1142115024-caa4d46e-ff02-4736-9cbb-07c41bceab3f

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Analyzed codebase to identify functions replaceable by mwclient library methods. Added wrapper methods with automatic fallback to raw API when mwclient unavailable.

Changes

MainPage (super_page.py)

  • get_text_mwclient(), save_mwclient(), purge_mwclient(), exists_mwclient()
  • get_categories_mwclient(), get_langlinks_mwclient(), get_templates_mwclient()
  • get_extlinks_mwclient(), get_backlinks_mwclient(), get_revisions_mwclient()

NEW_API (bot_api.py)

  • Search_mwclient(), Get_All_pages_mwclient(), Get_Newpages_mwclient()
  • UserContribs_mwclient(), get_logs_mwclient(), expandtemplates_mwclient()

BOTS_APIS (S_API/bot.py)

  • append_mwclient(), prepend_mwclient(), move_mwclient()

Documentation

  • Added MWCLIENT_REFACTOR_REPORT.md with full analysis of replaceable functions

Usage

page = api.MainPage("Article Title")

# Use mwclient directly (falls back to raw API if unavailable)
text = page.get_text_mwclient()
page.save_mwclient(new_text, summary="Edit via mwclient")

# Original methods unchanged
text = page.get_text()  # Still works as before

All methods use _mwclient suffix. Backwards compatibility preserved.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ar.wikipedia.org
    • Triggering command: /usr/bin/python python -m pytest tests/test_MainPage.py -v --no-header (dns block)
    • Triggering command: /usr/bin/python python -m pytest -v --no-header --ignore=tests/unit/api_utils/bot_edit/bot_edit_by_time/ (dns block)
    • Triggering command: /usr/bin/python python -m pytest tests/test_MainPage.py tests/test_ALL_APIS.py -v --no-header (dns block)
  • mdwiki.org
    • Triggering command: /usr/bin/python python -m pytest -v --no-header --ignore=tests/unit/api_utils/bot_edit/bot_edit_by_time/ (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Copilot Request Add mwclient wrapper methods for MediaWiki API operations Mar 1, 2026
@MrIbrahem MrIbrahem closed this Mar 2, 2026
@MrIbrahem MrIbrahem deleted the copilot/fix-177789851-1142115024-caa4d46e-ff02-4736-9cbb-07c41bceab3f branch March 2, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants