>> log: bugs and notes
>> done
Sarri.greekσυζήτηση - help:βοήθεια - εργασίες - Lua.wikitext - PAWS - ref@en.wikt - ετυμολογία - Μοντέλα σελίδων - Αρχείο πρωτολογισμών - Λέξεις που δεν υπάρχουν - είπαν - ja:Ιαπωνικά   |   lab:πρόχειρο - tAr - t4.t5 - mS.tS - menu

Simple, very simple tasks. E.g. replace a word...

Enter PAWSΕπεξεργασία

1) Go to https://paws.wmflabs.org/paws/hub/home

2) Log on: no problem, my username is already there

3) a card pops up. It looks like this: Click 'Allow'

Hi Sarri.greek,

In order to complete your request, PAWS needs permission to perform the following actions on your behalf on all projects of this site:

Perform high volume activity:
High-volume editing

Interact with pages:
Edit existing pages; Edit protected pages; Create, edit, and move pages; Patrol changes to pages

Interact with media:
Upload new files; Upload, replace, and move files

Perform administrative actions:
Rollback changes to pages

Interact with your watchlist:
View your watchlist

Miscellaneous activity:
Edit your watchlist

	Allow Cancel

Now, I am at https://paws.wmflabs.org/paws/user/Sarri.greek/tree

ReplaceΕπεξεργασία

The code for simple replacement of a letter or words in a specific phrase.


Go to https://paws.wmflabs.org/paws/hub/home

  • Click Allow at the card, get in your tree
  • 1) click 'New'. Choose > 'Terminal'
  • 2) the very black screen comes up as https://paws.wmflabs.org/paws/user/Sarri.greek/terminals/1 It says
Welcome to PAWS!
Please behave responsibly
Getting Started: https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS
Questions? Need help? Find us on #wikimedia-cloud on IRC on freenode!
File bugs at https://phabricator.wikimedia.org/maniphest/task/create/?projects=PAWS
@PAWS:~$

Example: change word in all wiktionary

pwb.py replace -lang:el -family:wiktionary -xml:/public/dumps/public/elwiktionary/latest/elwiktionary-latest-pages-articles-multistream.xml.bz2 "κλίσ-'πρόβατο" "κλίση-'βούτυρο" -summary:"pwb.py replace κλίση πρόβατο = βούτυρο"


Add -ns:0 to search only in main namespace of wiktionary. Then, find all the other pages (Talks, etc with Search insource:xxxx)


Example: change phrase in a category:

pwb.py replace -lang:el -family:wiktionary -cat:"Ανδρικά ονόματα (αρχαία ελληνικά)" "{{λείπει η ετυμολογία|grc}}" "{{λείπει η ετυμολογία|τύπος=όνομα|grc}}" -summary:"pwb.py +τύπος=όνομα"


Example: change symbols in one Category. I need to start from specific letter, because the category is too big. e.g. for letter Γ γ (capital or lowercase) I add -titleregex:'^γ.'

pwb.py replace -lang:el -family:wiktionary -cat:"Κατηγορία:Λήμματα με προφορά (νέα ελληνικά)" "ɛ" "e" "ɔ" "o" ".ˈ" "ˈ" ".'" "ˈ" -titleregex:'^γ.'   -summary:"pwb.py ενημέρωση [[ΔΦΑ]]"

My notebookΕπεξεργασία

I am at https://paws.wmflabs.org/paws/user/Sarri.greek/tree

  • 1) Choose 'New'. A list pops up. Choose 'Text file'
  • 2) now, I am at https://paws.wmflabs.org/paws/user/Sarri.greek/edit/untitled.txt
  • 3) I write codes here for specific tasks. For #Replaceing I do not need this.
  • 4) click 'File' > choose 'Rename'
    e.g. test01.txt https://paws.wmflabs.org/paws/user/Sarri.greek/edit/test01.txt
  • 5) click 'File' > choose 'Save'
    Now i can see it under 'Files' at my notebook

ExplanationsΕπεξεργασία

TerminalΕπεξεργασία

To perform a task

  • 1) click 'New', choose 'Terminal'
  • 2) !!! a black, very black screen comes up as https://paws.wmflabs.org/paws/user/Sarri.greek/terminals/1 It says
Welcome to PAWS!
Please behave responsibly
Getting Started: https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS
Questions? Need help? Find us on #wikimedia-cloud on IRC on freenode!
File bugs at https://phabricator.wikimedia.org/maniphest/task/create/?projects=PAWS
@PAWS:~$
  • 3) copy my code, and
  • 4) click Enter

IF i write nothing at the black screen, I just exit this window:

  • From central page, go to 'Running'. I see all my unused 'Terminal1', 'Terminal2' etc. Click the button 'Shutdown' to get rid of them.

Click lettersΕπεξεργασία

After clicking Enter at a code, you get each occurunce, with choices: [y]es [q]uit, etc: press the key in the bracket (e.g. y) + Enter, the key q + Enter... etc.

  • [q]uit, it quits (as though you have pressed CTRL+C, but in a more final way)
  • [N]no, it skips this occurance, and procedes to the next one
  • [e]dit, ...
  • [y]es, yes, do the changes and procede to the next one

Careful:

  • [a]ll, does them all! one after the other. We do not click it unless having tried yes, several times

Code commandsΕπεξεργασία

Start the code at the black screen after @PAWS:~$ There is a blinking little square

  • pwb.py   = I start with this
  • what to do
    replace   = (our command: replace the first of the pairts I'm going to write)
  • -lang:el   = at the el(.wiktionary)
  • -family:wiktionary   = or wikipedia or wiki...
  • -ns:0 = only in namespace: main
  • -cat:"Κατηγορία:xxxxx" = only in this Category
  • -titleregex:'^γ.' = when the first letter (^) is γ, followed by any character (.)
  • (optional) -search:"xxxx"   = search for this sequence of characters
  • first pair, if I need to replace:
    "xxxx"   = the sequence to be replaced
    "zzzz"   = the sequence with which we want to replace it
  • I may add more pairs
  • -summary:"pwb.py ...."   = describe the task

CarefulΕπεξεργασία

  • -pt:1 does everything in ONE second -must make trials first, then use with caution-. If something goes wrong, press CTRL+C (says my teacher, FocalPoint)
  • summary: If by accident "zzzz"-summary are joined together, you will get a note about your summary
  • use english keyboard to click letters
  • PROBLEM with search and replace: if weird little diacritics are in the replace, things go wrong

Good ideas:

  • add -ns:0 (namespace: main) if you do not wish to interfere with other pages. May check them later, manually.
  • only in a specific category: instead of -xml:/public/dumps/...xml.bz2 I write: -cat:"Category in greek ωωω"

ExamplesΕπεξεργασία

See User:Sarri.greek/PAWS/done

  • NOTE: the 'search' command MAY NOT WORK. Try (Thank you Botaki for help!)
pwb.py replace -lang:el -family:wiktionary -xml:/public/dumps/public/elwiktionary/latest/elwiktionary-latest-pages-articles-multistream.xml.bz2 "κλίσ-'πρόβατο" "κλίση-'βούτυρο" -summary:"pwb.py replace κλίση πρόβατο = βούτυρο"
  • 3b) NOT BEST WAY Now, e.g. I write next to that @PAWS:~$
    @PAWS:~$ pwb.py replace -lang:el -family:wiktionary -search:"Β:Χρηστικό" "Β:Χρηστικό" "Π:Χρηστικό" -summary:"pwb.py replace αντικατάσταση"
    pwb.py   = ...
    replace   = (our command: replace the first of the pairts I'm going to write)
    -lang:el   = at the el(.wiktionary)
    -family:wiktionary   = or wikipedia or wiki...
    -search:"xxxx"   = search for this sequence of characters
    "xxxx"   = the sequence to be replaced
    "zzzz"   = the sequence with which we want to replace it
  • I may add more pairs
  • 4) Now, I click Enter and Here is what i get:
Welcome to PAWS!
Please behave responsibly
Getting Started: https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS
Questions? Need help? Find us on #wikimedia-cloud on IRC on freenode!
File bugs at https://phabricator.wikimedia.org/maniphest/task/create/?projects=PAWS
@PAWS:~$ pwb.py replace -lang:el -family:wiktionary -search:"Β:Χρηστικό" "Β:Χρηστικό" "Π:Χρηστικό" -summary:"pwb.py replace αντικατάσταση Β: σε Π:"
Retrieving 50 pages from wiktionary:el.
No changes were necessary in [[bonaccia]]
No changes were necessary in [[Σκοτία]]
No changes were necessary in [[Σκότος]]
No changes were necessary in [[Συντροφία]]
No changes were necessary in [[αίμα]]
No changes were necessary in [[ανοίγω]]
No changes were necessary in [[αντικατασκοπία]]

>>> αρόδο <<<
@@ -4 +4 @@
- : '''{{PAGENAME}}''' < {{δαν|vec|el}} [[a]] [[roda]]<ref>{{Β:Γεωργακάς}}</ref> <ref name=Babi>{{Β:Μπαμπινιώτης 2002}}</ref> ή [[arodo]]<ref>{{Β:Χρηστικό}}</ref> <ref>{{Β:ΛΚΝ}}</ref> <ref>ή {{ετυμ|oc|el|arròda}} < {{ετυμ|la|el|rota}}</ref>
+ : '''{{PAGENAME}}''' < {{δαν|vec|el}} [[a]] [[roda]]<ref>{{Β:Γεωργακάς}}</ref> <ref name=Babi>{{Β:Μπαμπινιώτης 2002}}</ref> ή [[arodo]]<ref>{{Π:Χρηστικό}}</ref> <ref>{{Β:ΛΚΝ}}</ref> <ref>ή {{ετυμ|oc|el|arròda}} < {{ετυμ|la|el|rota}}</ref>

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):
  • 5) I agree, i click y and Enter, to procede
    or, I do not agree and press N and Enter, to procede
    Do not go fast: WAIT for the change to be viewed at the 'Recent changes' and then, go on.
  • 6) see User:Sarri.greek/PAWS/log#bugs
  • 7) When finished: I go to 'Running' and delete (shutdown)
  • 8) go back to home and start again

Replace in one CategoryΕπεξεργασία

help: https://www.mediawiki.org/wiki/Manual:Pywikibot/replace.py

  • cat - work on all pages (not categories) which are in a specific category. Argument can also be given as "-cat:categoryname".
  • for beginners to limit the work to the main namespace with -ns:0
  • -titleregex:'^γ.' = when the first letter (^) is γ, followed by any character (.)

HelpΕπεξεργασία


These help pages have no simple examples:

Learn more

  • Search google for: regex pcre