On Sun, Oct 4, 2009 at 4:40 PM, Nicolas Dumazet <[email protected]> wrote:
> Hello!
>
> 2009/10/4 Patrol110 <[email protected]>:
>> Example of use of a new repalce.py with this feature:
>> python replace.py -file:mylist -multipatt:2 "old text" "new one"
>> "another thing to change" "and the replacement"
>
>
> python replace.py -file:mylist "old text" "new one" "another thing to
> change" "and the replacement"
>
> Already works as expected.
>

In that case, it could be clarified in the documentation. Attaching a
posible patch, but maybe it could use better wording.

Best regards,
-- 
Santiago M. Mola
Jabber ID: [email protected]
diff --git a/replace.py b/replace.py
index bd38c63..df9ebb6 100644
--- a/replace.py
+++ b/replace.py
@@ -86,6 +86,8 @@ other:            First argument is the old text, second argument is the new
                   text. If the -regex argument is given, the first argument
                   will be regarded as a regular expression, and the second
                   argument might contain expressions like \\1 or \g<name>.
+                  It is possible to introduce more than one pair of old text
+                  and replacement.
 
 Examples:
 
@@ -100,6 +102,9 @@ Errror -> Error, use this:
 
     python replace.py -xml:foobar.xml "Errror" "Error" -namespace:0
 
+If you want to do more than one replacement at a time, use this:
+    python replace.py -xml:foobar.xml "Errror" "Error" "Faail" "Fail" -namespace:0
+
 If you have a page called 'John Doe' and want to fix the format of ISBNs, use:
 
     python replace.py -page:John_Doe -fix:isbn
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to