Hi,
We currently have the "MySQLPageGenerator" to do database queries. It uses site.dbName() to figure out the name of the site, but we don't seem to have any system to figure out what database server to connect to. For example: * Dutch Wikipedia on Toolserver: connect nlwiki_p nlwiki-p.db * English Wikipedia on Toolserver: connect enwiki_p enwiki-p.db * Dutch Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb * English Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
How to solve this? Possible solution is to make a function to detect what cluster we're on or a user variable to set it (config.cluster?) and than add a function site.dbServer() to return the right server?
Maarten
[1] https://git.wikimedia.org/blob/pywikibot%2Fcore.git/d2ea22661b967774048bc7c6...
Hi Maarten,
Do note that a valid use case is to run pywikibot with a local database dump (I haven't done this myself, but I know at least 1 person who does that), so the user needs to be able to configure this field. The user variable seems like the way to go for me.
As to the default value, I suggest using the values from toollabs (you know, with it being the future & all).
Strainu
2014-03-08 17:54 GMT+02:00 Maarten Dammers maarten@mdammers.nl:
Hi,
We currently have the "MySQLPageGenerator" to do database queries. It uses site.dbName() to figure out the name of the site, but we don't seem to have any system to figure out what database server to connect to. For example:
- Dutch Wikipedia on Toolserver: connect nlwiki_p nlwiki-p.db
- English Wikipedia on Toolserver: connect enwiki_p enwiki-p.db
- Dutch Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
- English Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
How to solve this? Possible solution is to make a function to detect what cluster we're on or a user variable to set it (config.cluster?) and than add a function site.dbServer() to return the right server?
Maarten
[1] https://git.wikimedia.org/blob/pywikibot%2Fcore.git/d2ea22661b967774048bc7c6...
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Running bot via reading dumps is implemented with xmlreader.py no need to do that, I have tons of code which used xmlreader. I can send it to you (to see how we can use xmlreader) or write a manual for it
Best
On Sat, Mar 8, 2014 at 9:16 PM, Strainu strainu10@gmail.com wrote:
Hi Maarten,
Do note that a valid use case is to run pywikibot with a local database dump (I haven't done this myself, but I know at least 1 person who does that), so the user needs to be able to configure this field. The user variable seems like the way to go for me.
As to the default value, I suggest using the values from toollabs (you know, with it being the future & all).
Strainu
2014-03-08 17:54 GMT+02:00 Maarten Dammers maarten@mdammers.nl:
Hi,
We currently have the "MySQLPageGenerator" to do database queries. It
uses
site.dbName() to figure out the name of the site, but we don't seem to
have
any system to figure out what database server to connect to. For example:
- Dutch Wikipedia on Toolserver: connect nlwiki_p nlwiki-p.db
- English Wikipedia on Toolserver: connect enwiki_p enwiki-p.db
- Dutch Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
- English Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
How to solve this? Possible solution is to make a function to detect what cluster we're on or a user variable to set it (config.cluster?) and than
add
a function site.dbServer() to return the right server?
Maarten
[1]
https://git.wikimedia.org/blob/pywikibot%2Fcore.git/d2ea22661b967774048bc7c6...
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
As I said, I'm not the one using it :) I strongly believe that anything else than live data is an error waiting to happen.
Strainu
2014-03-08 19:57 GMT+02:00 Amir Ladsgroup ladsgroup@gmail.com:
Running bot via reading dumps is implemented with xmlreader.py no need to do that, I have tons of code which used xmlreader. I can send it to you (to see how we can use xmlreader) or write a manual for it
Best
On Sat, Mar 8, 2014 at 9:16 PM, Strainu strainu10@gmail.com wrote:
Hi Maarten,
Do note that a valid use case is to run pywikibot with a local database dump (I haven't done this myself, but I know at least 1 person who does that), so the user needs to be able to configure this field. The user variable seems like the way to go for me.
As to the default value, I suggest using the values from toollabs (you know, with it being the future & all).
Strainu
2014-03-08 17:54 GMT+02:00 Maarten Dammers maarten@mdammers.nl:
Hi,
We currently have the "MySQLPageGenerator" to do database queries. It uses site.dbName() to figure out the name of the site, but we don't seem to have any system to figure out what database server to connect to. For example:
- Dutch Wikipedia on Toolserver: connect nlwiki_p nlwiki-p.db
- English Wikipedia on Toolserver: connect enwiki_p enwiki-p.db
- Dutch Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
- English Wikipedia on Toollabs: connect nlwiki_p nlwiki.labsdb
How to solve this? Possible solution is to make a function to detect what cluster we're on or a user variable to set it (config.cluster?) and than add a function site.dbServer() to return the right server?
Maarten
[1]
https://git.wikimedia.org/blob/pywikibot%2Fcore.git/d2ea22661b967774048bc7c6...
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Amir
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi Strainu,
Strainu schreef op 8-3-2014 18:46:
Hi Maarten,
Do note that a valid use case is to run pywikibot with a local database dump (I haven't done this myself, but I know at least 1 person who does that), so the user needs to be able to configure this field. The user variable seems like the way to go for me.
I agree. Similar use case: I run an internal company wiki. Every once in a while I run Pywikibot on it to clean up some things. Maybe I want to connect to the database directly in the future. Having something in the family file or in the user-config would be nice.
As to the default value, I suggest using the values from toollabs (you know, with it being the future & all).
I agree, that should be the default value in config2.py.
Maarten