Revision: 4179
Author: btongminh
Date: 2007-09-02 20:16:02 +0000 (Sun, 02 Sep 2007)
Log Message:
-----------
New config setting: enable_logging
Modified Paths:
--------------
trunk/pywikipedia/delinker.py
trunk/pywikipedia/delinker.txt
Modified: trunk/pywikipedia/delinker.py
===================================================================
--- trunk/pywikipedia/delinker.py 2007-09-02 15:10:35 UTC (rev 4178)
+++ trunk/pywikipedia/delinker.py 2007-09-02 20:16:02 UTC (rev 4179)
@@ -467,6 +467,7 @@
threadpool.Thread.__init__(self, pool)
self.CommonsDelinker = CommonsDelinker
self.sql_layout = self.CommonsDelinker.config.get('sql_layout', 'new')
+ self.enabled = self.CommonsDelinker.config.get('enable_logging', True)
def run(self):
self.connect()
@@ -518,6 +519,7 @@
self.database.commit()
def do(self, args):
+ if not self.enabled: return
try:
if len(args) == 3:
self.log_replacement(*args)
@@ -547,7 +549,10 @@
[self.Delinkers.add_thread(self) for i in xrange(self.config['delinker_instances'])]
self.Loggers = threadpool.ThreadPool(Logger)
- [self.Loggers.add_thread(self) for i in xrange(self.config['logger_instances'])]
+ if self.config.get('enable_logging', True):
+ [self.Loggers.add_thread(self) for i in xrange(self.config['logger_instances'])]
+ else:
+ self.Loggers.add_thread(self)
self.http = checkusage.HTTP(self.site.hostname())
Modified: trunk/pywikipedia/delinker.txt
===================================================================
--- trunk/pywikipedia/delinker.txt 2007-09-02 15:10:35 UTC (rev 4178)
+++ trunk/pywikipedia/delinker.txt 2007-09-02 20:16:02 UTC (rev 4179)
@@ -87,6 +87,7 @@
* ''global = False'': Set global or local delink. DO NOT RUN THIS BOT
GLOBALLY WITHOUT CONSULTING BRYAN AND SIEBRAND. Thank you.
* ''no_sysop = True'': Disable delinking as sysop.
+* ''enable_logging = True'': Enable logging actions to database.
=== Delinker settings ===
Those variables only need to be set if the delinker is enabled.
@@ -115,6 +116,7 @@
not_ok''.
=== SQL settings ===
+You do not need to set these if you have logging disabled.
* ''sql_engine = "mysql"'': Database engine to use. Currently supported:
MySQL. Support for sqlite3 is planned. The Global delinker requires MySQL.
* ''sql_config = {\
@@ -125,8 +127,8 @@
the database engine. Please refer to your database api manual for a full
overview of the options.
* ''sql_layout = "new"'': Set to "legacy" for the old table layout.
-* ''log_table = "database.delinker"'': The database.table to log to.
-* ''replacer_table = "database.replacer"'': The database.table for the
+* ''log_table = "database_name.delinker_table"'': The database.table to log to.
+* ''replacer_table = "database_name.replacer_table"'': The database.table for the
replacer. Only required if the replacer is activated.
==== SQL table layout ====
Bugs item #1786732, was opened at 2007-09-02 20:46
Message generated for change (Comment added) made by btongminh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1786732&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Some mistake in wikipedia.py
Initial Comment:
Bot crash in start. the same with interwiki.py
D:\pywikipedia>solve_disambiguation.py
Traceback (most recent call last):
File "D:\pywikipedia\solve_disambiguation.py", line 75, in <module>
import wikipedia, pagegenerators, editarticle
File "D:\pywikipedia\wikipedia.py", line 4340, in <module>
getSite()
File "D:\pywikipedia\wikipedia.py", line 4248, in getSite
_sites[key] = Site(code=code, fam=fam, user=user, persistent_http=persistent
_http)
File "D:\pywikipedia\wikipedia.py", line 3153, in __init__
if persistent_http is None: persistent_http = config.persistent_http
AttributeError: 'module' object has no attribute 'persistent_http'
----------------------------------------------------------------------
Comment By: Bryan (btongminh)
Date: 2007-09-02 21:04
Message:
Logged In: YES
user_id=1806226
Originator: NO
Are you using the most recent svn revision?
The persistent_http option was added to the config module in r4135:
http://svn.wikimedia.org/viewvc/pywikipedia/trunk/pywikipedia/config.py?r1=…
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1786732&group_…
Patches item #1786734, was opened at 2007-09-02 11:53
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1786734&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ignored for cs: solve_disambiguation.py
Initial Comment:
To section
ignore_title = {
'wikipedia': {
'cs': [
please add following:
u'Wikipedie:Seznam nejvíce odkazovaných rozcestníků',
u'Wikipedista:Zirland/okres',
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1786734&group_…
Bugs item #1786732, was opened at 2007-09-02 11:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1786732&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Some mistake in wikipedia.py
Initial Comment:
Bot crash in start. the same with interwiki.py
D:\pywikipedia>solve_disambiguation.py
Traceback (most recent call last):
File "D:\pywikipedia\solve_disambiguation.py", line 75, in <module>
import wikipedia, pagegenerators, editarticle
File "D:\pywikipedia\wikipedia.py", line 4340, in <module>
getSite()
File "D:\pywikipedia\wikipedia.py", line 4248, in getSite
_sites[key] = Site(code=code, fam=fam, user=user, persistent_http=persistent
_http)
File "D:\pywikipedia\wikipedia.py", line 3153, in __init__
if persistent_http is None: persistent_http = config.persistent_http
AttributeError: 'module' object has no attribute 'persistent_http'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1786732&group_…
Revision: 4175
Author: cosoleto
Date: 2007-09-02 09:58:11 +0000 (Sun, 02 Sep 2007)
Log Message:
-----------
yield ImagePage class, not Page
Modified Paths:
--------------
trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/catlib.py
===================================================================
--- trunk/pywikipedia/catlib.py 2007-09-02 09:43:45 UTC (rev 4174)
+++ trunk/pywikipedia/catlib.py 2007-09-02 09:58:11 UTC (rev 4175)
@@ -238,7 +238,7 @@
if Rimage:
# For MediaWiki versions where images work through galleries
for title in Rimage.findall(txt):
- yield ARTICLE, wikipedia.Page(self.site(), title)
+ yield ARTICLE, wikipedia.ImagePage(self.site(), title)
# try to find a link to the next list page
# If skippedCategoryDescription is False, then there are no pages
# or subcategories, so there cannot be a next list page
Revision: 4176
Author: cosoleto
Date: 2007-09-02 11:17:00 +0000 (Sun, 02 Sep 2007)
Log Message:
-----------
fix to my previous commit to avoid NoPage error when get() is called
Modified Paths:
--------------
trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/catlib.py
===================================================================
--- trunk/pywikipedia/catlib.py 2007-09-02 09:58:11 UTC (rev 4175)
+++ trunk/pywikipedia/catlib.py 2007-09-02 11:17:00 UTC (rev 4176)
@@ -238,7 +238,7 @@
if Rimage:
# For MediaWiki versions where images work through galleries
for title in Rimage.findall(txt):
- yield ARTICLE, wikipedia.ImagePage(self.site(), title)
+ yield ARTICLE, wikipedia.ImagePage(self.site(), "Image:%s" % title)
# try to find a link to the next list page
# If skippedCategoryDescription is False, then there are no pages
# or subcategories, so there cannot be a next list page
Hi everyone. Somewhere in the past two days there has been a change in the
bot framework or MediaWiki because of which pywikipediabot no longer
recognises images on category pages.
As Wikimedia Commons is a project about images and categories, very little
automated maintenance is possible. If you have made a change that may have
impacted this code, please double check. If you are willing and able to fix
it, please do so.
Previous problems with the recognition of images in categories was located
on lines 197-211 of catlib.py and possibly on line 177.
Thanks for any help.
Cheers!
Siebrand