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 ====