Aram added a comment.
@Xqt, Thank you! Much closer to perfect this time. The bot has made some good edits and this is the log revision <https://ckb.wikipedia.org/w/index.php?title=%D8%A8%DB%95%DA%A9%D8%A7%D8%B1%DA%BE%DB%8E%D9%86%DB%95%D8%B1:AramBot/category_redirect_log&diff=prev&oldid=1140470>, but in the code/log we have symbol `→`, but this is for LTR languages and it is better if we print `←` for RTL languages (if applicable). The script is now working, but if we want to make it more better and dig more this ticket, I have noticed two more things. As you can see in below and if we press `Ctrl+C` after both questions (specifically the second question), we get these lines. Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit): User quit CategoryRedirectBot bot run... Continue with soft category redirects ([y]es, [n]o): Traceback (most recent call last): File "C:\Pywikibot master\pywikibot\userinterfaces\terminal_interface_base.py", line 411, in _input_reraise_cntl_c text = self._raw_input() File "C:\Pywikibot master\pywikibot\userinterfaces\terminal_interface_win32.py", line 68, in _raw_input data = self.stdin.readline() KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Pywikibot master\pwb.py", line 39, in <module> sys.exit(main()) File "C:\Pywikibot master\pwb.py", line 35, in main runpy.run_path(str(path), run_name='__main__') File "C:\Users\Aram\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "C:\Users\Aram\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\Aram\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Pywikibot master\pywikibot\scripts\wrapper.py", line 515, in <module> main() File "C:\Pywikibot master\pywikibot\scripts\wrapper.py", line 499, in main if not execute(): File "C:\Pywikibot master\pywikibot\scripts\wrapper.py", line 486, in execute run_python_file(filename, script_args, module) File "C:\Pywikibot master\pywikibot\scripts\wrapper.py", line 147, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "C:\Pywikibot master\scripts\category_redirect.py", line 490, in <module> main() File "C:\Pywikibot master\scripts\category_redirect.py", line 488, in main bot.run() File "C:\Pywikibot master\scripts\category_redirect.py", line 432, in run or not pywikibot.input_yn( File "C:\Pywikibot master\pywikibot\bot.py", line 614, in input_yn return input_choice(question, [('Yes', 'y'), ('No', 'n')], File "C:\Pywikibot master\pywikibot\bot.py", line 536, in wrapper return function(*args, **kwargs) File "C:\Pywikibot master\pywikibot\bot.py", line 584, in input_choice return ui.input_choice(question, answers, default, return_shortcut, File "C:\Pywikibot master\pywikibot\userinterfaces\terminal_interface_base.py", line 489, in input_choice answer = self.input(output) or default File "C:\Pywikibot master\pywikibot\userinterfaces\terminal_interface_base.py", line 391, in input text = self._input_reraise_cntl_c(password) File "C:\Pywikibot master\pywikibot\userinterfaces\terminal_interface_base.py", line 413, in _input_reraise_cntl_c raise QuitKeyboardInterrupt() pywikibot.bot_choice.QuitKeyboardInterrupt CRITICAL: Exiting due to uncaught exception QuitKeyboardInterrupt: And if press `q` for the first question and `n` for the second one, (while the bot has no made any changes), it is still add an empty log as you can see here <https://ckb.wikipedia.org/w/index.php?title=%D8%A8%DB%95%DA%A9%D8%A7%D8%B1%DA%BE%DB%8E%D9%86%DB%95%D8%B1:AramBot/category_redirect_log&diff=prev&oldid=1140481>, but I'm not sure if this action is necessary. I have three more questions: 1. Why the bot moves old categories to new ones in multiple edits? Can't we moving all categories in a specific page using one edit only? For example, here <https://ckb.wikipedia.org/wiki/%D8%AA%DB%8E%D8%B1%DB%8E%D8%B3%D8%A7_%D9%BE%D8%A7%DA%B5%D9%85%DB%95%D8%B1?diff=cur&oldid=969496>, the bot fixed two categories in two edits. 2. If we run the bot on Toolforge and used `-always` parameter, what happens in the second question `Continue with soft category redirects ([y]es, [n]o):` 3. Why page generators <https://www.mediawiki.org/wiki/Manual:Pywikibot/Page_Generators> are not allowed in this script? Sometimes, the operator may need to run the script just for one page or category. I haven't faced double redirects yet. TASK DETAIL https://phabricator.wikimedia.org/T351951 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt, Aram Cc: Xqt, Aklapper, pywikibot-bugs-list, Aram, mevo, Isabelladantes1983, Themindcoder, Adamm71, Jersione, Hellket777, LisafBia6531, 786, Biggs657, PotsdamLamb, Jyoo1011, JohnsonLee01, Juan90264, SHEKH, Dijkstra, Alter-paule, Beast1978, Un1tY, Khutuck, Zkhalido, Hook696, Kent7301, joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, Giuliamocci, Cpaulf30, Af420, Bsandipan, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Dvorapa, Altostratus, Neuronton, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
_______________________________________________ pywikibot-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
