Talk:PAWS

About this board

For general discussion about PAWS

Doesn't run on ruwikimedia

2
1234qwer1234qwer4 (talkcontribs)

I tried running a script on wmru:, but whenever it reaches the saving method, it spits out the error: "NoUsername: No username has been defined in your user-config.py: you have to add in this file the following line: usernames['wikimediachapter']['ru'] = '1234qwer1234qwer4'". I've created user-config.py then, which has not been needed on testwiki, commonswiki, and wikidatawiki (the projects at which I used PAWS before), but the issue persists. What am I doing wrong?

1234qwer1234qwer4 (talkcontribs)

Never mind, it worked today.

Reply to "Doesn't run on ruwikimedia"
Edoderoo (talkcontribs)

For some reason, the mwviews library for MediaWiki-statistics are missing. I use them on my own Linux environment, and would be pleased if it would be accessible from PAWS as well. I know that some other users will have the same request.

Info-farmer (talkcontribs)

I agree with him and expecting the same.

Chicocvenancio (talkcontribs)

There are a few issues with the current PAWS images that we must fix before adding new packages. A workaround to get new packages into your server is to install it with pip. The best alternative we have at the moment is a cell at the top of the notebook with !pip install mwviews.

Edoderoo (talkcontribs)
Chicocvenancio (talkcontribs)
Abbe98 (talkcontribs)

What's the best way to use secrets (API keys, etc) in PAWS? Are .env files published in the public space? Is terminal input logged?

Chicocvenancio (talkcontribs)

Best way is to not do it.

PAWS admins, Toolforge roots and Cloud Service roots will have access to everything in PAWS if they try.

You can use unix file permissions to deny read from other toolforge users and the paws-public endpoint. Just make the file readable only to the user and it will be "private" to a dozen or so people.

Reply to "Secrets mangement"

Problems with character encoding on paws-public

7
Mfchris84 (talkcontribs)

Having utf8 encoded special characters in the result of my python scripts, there results some problems with character encoding displaying the script (or any other file) via the paws-public url. e.g. paws-public.wmflabs.org/paws-public/User:Mfchris84/hov_id.tsv

Does anyone know this problem? Thanks in advance!

Info-farmer (talkcontribs)

if you show the script, that will be quit good to analyze the issue.

Mfchris84 (talkcontribs)

you find the script under paws-public.wmflabs.org/paws-public/User:Mfchris84/hov_id.py but the prevent misunderstanding: if i open hov_id.tsv under normal user paws-url (paws.wmflabs.org/paws/hub/user/Mfchris84/hov_id.tsv) or or download it there are no problems with character encoding. this occurs only via the paws-public URL.

Chicocvenancio (talkcontribs)

This is the browser wrongly guessing the encoding for the file. Getting the file via curl, in a utf8 encoded terminal, works. I want to setup a better viewing system for paws-public, so I'm not sure if it is worth it to do much here, but I'll check if I can get an easy fix with nginx.

Chicocvenancio (talkcontribs)
Mfchris84 (talkcontribs)
Chicocvenancio (talkcontribs)

You're welcome.

How can i change the default edit summary

6
Summary by Chicocvenancio

Question resolved.

Info-farmer (talkcontribs)

I am from ta.wiki and using PAWS for categorization, replace text,.. An example There the default edit summary is (Pywikibot v.2) (அடையாளம்: PAWS [1.2]). But i want to put my edit summary to ease the patrol of a sysop at the recent changes. Where i can do the edit summary customization?

Ivanhercaz (talkcontribs)

Hi @Info-farmer! There are several ways to change the summary if you use Pywikibot.

You can use -summary: in your PAWS shell with the script that you want. Another way is set a message in your user-fixes.py, very useful if you use a fix to replace; you can read about it.

Good luck with your tasks!

Regards, Ivanhercaz (talk) 21:07, 26 December 2016 (UTC)

Info-farmer (talkcontribs)

still i am unable to use the -summary:

i created 2 files to add a category. One is list of wiki pages(category-list.csv) to add a category. Another is a python script page namely add-category.py in which the script is as follows:-

import csv 
import pywikibot

with open('category-list.csv', 'r') as csvfile:
    reader = csv.reader(csvfile,delimiter="~")
    for row in reader:
        booktitle=row[0]
        print (row[0]) 
        site = pywikibot.Site('ta', 'wikipedia')
        page = pywikibot.Page(site, booktitle)
        page.text = page.text+'\n[[category:தனியுடைமை மென்பொருட்கள்]]'
        page.save()

When i run the command at PAWS's terminal as bellow,

python add-category.py -summary:+category:தனியுடைமை மென்பொருட்கள்

nothing happens in the edit summaty. What is the procedure, i have to follow. I am a newbie.Please,guide me.

Ivanhercaz (talkcontribs)

Don't worry @Info-farmer! I am not an expert but I can try to help you.

If you use python add-category.py -summary:+category:தனியுடைமை மென்பொருட்கள் you should try to write the summary between " ", in that way: python add-category.py -summary:"+category:தனியுடைமை மென்பொருட்கள்".

If it doesn't work for you, you can try to set summary text in your python script. To make that you have to add to page.save() something like page.save(summary="text"). You can read about in Pywikibot old docs.

I hope it could help you!

Regards, Ivanhercaz (talk) 10:32, 27 December 2016 (UTC)

Info-farmer (talkcontribs)

page.save(summary="text") method works fine. See the result The first terminal method is not working. Though English is not convenient language for me, i will read the refered old pywikibot page by you.. Thanks indeed brother !.

Ivanhercaz (talkcontribs)

Glad to know you got it! Don't worry, if you have something more only ask, we are here to help between us.

Your welcome and good luck with your task!

Regards, Ivanhercaz (talk) 18:53, 27 December 2016 (UTC)

Summary by Chicocvenancio

Now working.

IvanLanin (talkcontribs)

Hi, I've used PAWS successfully for some time. I just get 504 Gateway Time-out. Is there any problem? Thank you.

Quiddity (WMF) (talkcontribs)

Seems to be back now. Temporary hiccup?

IvanLanin (talkcontribs)

Yes. It's back now. Thank you.

IvanLanin (talkcontribs)

Hi, I got the 504 error again. Another hiccup? Thank you.

EpochFail (talkcontribs)

Where?

BDavis (WMF) (talkcontribs)
Discasto (talkcontribs)

No way to access PAWS. In Firefox I get a 503 Service Unavailable status code. Is it actually working? It worked two days ago, but not now...

MViswanathan (WMF) (talkcontribs)

Hi, Could you check now and let me know if it's still an issue? You are also welcome on #wikimedia-cloud where an admin is usually around to help with problems like these :)

Discasto (talkcontribs)

Thanks for the tip on the IRC channel. PAWS' currently working and I've been finally able to run my first notebook. Thank you very much :-)

Attribute error for talk page

4
Info-farmer (talkcontribs)

I am trying to post a message in the index_talk page to inform other contributors. But facing attribution error?

Terminal  : // AttributeError: module 'pywikibot' has no attribute 'talk'//

My attribute (page = pywikibot.Page(site, booktitle)) for a page works fine for a wiki page. Like, what is the attribute for talk page?

(talkpage = pywikibot.?????(site, booktitle))

Ivanhercaz (talkcontribs)

Hi Info-farmer, Have you tried to add the parameter ns = , I mean:

talkpage = pywikibot.Page(site, booktitle, ns = 1)

1 is for main namespace talk pages, in Manual:Namespace constants you can check all the namespaces. I don't know what key number is for the namespace talk page you want to use.

I hope this works for you!

Regards

Info-farmer (talkcontribs)

I tried as you instructed but failed. Afte sometime, i changed the input as a "talk page", it is now success. For example, earlier my input is "cat"; now input is "Talk:Cat". So there is no need to the change the attribution. I am still searching pywikibot's attribution list like below.

#pywikibot.Site = Select your language, project ('ta', 'wikisource')

#pywikibot.Page = site, pagename

#page.text

#page.save(summary='+ ')

Once again, thanks indeed for your earlier help "for the recent changes". Bye for now.

Ivanhercaz (talkcontribs)

I am happy to know you success with your idea. I think the Pywikibot has to be improved, because this documentation has nothing now :/

Regards

Reply to "Attribute error for talk page"

how to install pywikibot version 3.0.dev0 in my laptop as in Jupyter?

1
Info-farmer (talkcontribs)

I checked my laptop version pywikibot as 2.0rc4 and then i checked the pywikibot version in Jupyter as version 3.0. How can i install the 3.0 version in my PC?

Reply to "how to install pywikibot version 3.0.dev0 in my laptop as in Jupyter?"
There are no older topics