Page MenuHomePhabricator

Replace.py: -addcat
Closed, InvalidPublic

Description

Hey there!
The code states that the parameter "-addcat", to add category when editing, is deprecated since 2016, but it's still working, and exists in the documentation in the head of the file (but not in MW). It's even don't show any warning.
Why it should be deprecated? I think this is a good feature and it's working after all.

Event Timeline

Shalomori123 renamed this task from -addcat to Replace.py: -addcat.Apr 28 2021, 11:55 AM

Don’t find it inside replace.py. Can you please file that warning and the command line starting the bot. This would help investigating this issue. Thanks.

The existence in the documentation in line 37.
On line 529:

@deprecated_args(acceptall='always', addedCat='addcat')

There is no warning, and that's what strange here.
The command line is:

python pwb.py replace '(שבי"ל)' '([[מחבר:שבי"ל|שבי"ל]])' -addcat:'ספר המילים של שבי"ל'

The existence in the documentation in line 37.
On line 529:

@deprecated_args(acceptall='always', addedCat='addcat')

There is no warning, and that's what strange here.
The command line is:

python pwb.py replace '(שבי"ל)' '([[מחבר:שבי"ל|שבי"ל]])' -addcat:'ספר המילים של שבי"ל'

neither acceptall not addedCat is used inside replace.py:

C:\pwb\GIT\core>pwb replace a b -page:user:xqt/Test -addcat:foo -simulate
The summary message for the command line replacements will be something like: Bot: Automatisierte Textersetzung  (-a +b)
Press Enter to use this automatic message, or enter a description of the
changes your bot will make:
Retrieving 1 pages from wikipedia:de.


>>> Benutzer:Xqt/Test <<<
@@ -1,2 +1,4 @@
- <code>&amp;</code>
+ <code>&bmp;</code>
- <ref>foo</ref>
+ <ref>foo</ref>
+
+ [[Kategorie:Foo]]

Do you want to accept these changes? ([y]es, [N]o, [e]dit original, edit
[l]atest, open in [b]rowser, [m]ore context, [a]ll, [q]uit): y
Edit summary: Bot: Automatisierte Textersetzung  (-a +b)
SIMULATION: edit action blocked.

1 pages read
1 pages written
0 pages skipped
Execution time: 19 seconds
Read operation time: 18.0 seconds
Write operation time: 19.0 seconds
Script terminated successfully.

Maybe you are missinterpreting this line:

@deprecated_args(acceptall='always', addedCat='addcat')

This only says that the parameter names has been changed. This is important if you derive this bot in your own script.

Yes, my bad.
But my mistake caused because it doesn't exists in the documentation in MW, so thought it's absolutely deprecated.