Purple exclamation mark.svg Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.

Red exclamation mark.svg UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.

User talk:Bryan

From Botwiki
Jump to: navigation, search

English (preferred) or Dutch. You can write in French or German, but I will respond in English.

Contents

Delinker livetest

Bryan, kan je me via IRC laten weten welke versies van hier op de wiki ik kan gebruiken om een livetest mee te draaien? Als de bot een paar dagen draait, zal ik de bestanden toevoegen aan het pywikipediabot framework. Als je denkt dat er nog een paar dingen beter kunnen, neem dan alsjeblieft een kopje 'FIXME' in de header op, dan hebben we een TODO-lijst waar in ieder geval iedereen kennis van kan nemen.

Rest me nog mijn zeer grote dank uit te spreken voor je hulp. Groet, Siebrand 22:18, 27 May 2007 (UTC)

De versie hier op Python:CommonsDelinker is de meest up to date versie. Ik heb hem op dit moment aan het test draaien. Bryan 10:38, 28 May 2007 (UTC)
De meest recente versie werkt is getest en werkt tot aan put(). Even de return een regel omlaag verplaatsen, en hij zou het moeten doen :) Bryan 18:47, 28 May 2007 (UTC)
Oke. Dat ga ik dan morgenavond testen. Heb ik goed gezien dat je een alternatief voor pywikipediabot wilt gaan schrijven van scratch? Siebrand 22:08, 28 May 2007 (UTC)
Ik heb de huidige versie de hele nacht test laten draaien, het ziet er naar uit dat alles draait zoals het moet. Ik heb ook een script gedraait dat de beschikbaarheid van alle threads monitort, en het ziet er naar uit dat met instellingen voor CheckUsage/Delinker/Logger 9/5/2 alles vlekkeloos draait: dwz. Alles is binnen een halve minuut gedelinkt.
En over dat framework; dat heb je fout gezien, ik heb het namelijk al voor een groot deel geschreven ;) Ik heb er al twee bots op draaien. Bryan 07:20, 29 May 2007 (UTC)
OK. dat klinkt fantastisch. Is het nu makkelijk om ook de replacer met deze code te laten werken, en hoe moeten we dan met de threads omgaan? Siebrand 14:08, 29 May 2007 (UTC)
Yeps, replacer is hier ook makkelijk mee te gebruiken. Wat in feite alleen maar gedaan hoeft te worden, is dat er ipv een read_deletion_log() methode een methode moet zijn de die replacer opdrachten leest, zoals read_replacement_commands() en de Delinker objecten moeten vervangen worden door een Replacer object. Als blijkt dat de Delinker goed werkt, zal ik eind van deze week wel even naar de Replacer kijken.
Wat ook nog een todo is, is het afhandelen van dode MySQL connecties. Ik heb vandaag de hele dag de bot droog laten draaien, en drie MySQL connecties, en daarmee ook 3 CheckUsage threads zijn gestorven. Er waren dus maar 2 threads over voor de CheckUsage. Zo te zien redt die dat net, maar ideaal is het uiteraard niet. Ik moet dus even kijken naar een error handler voor MySQL. Indien je geinteresseerd bent in de logs, kun je ze zien op /home/bryan/projects/delinker/error_log.txt. Bryan 16:41, 29 May 2007 (UTC)

Resultaat livetest

Ik heb de drie bestanden threadpool.py, checkusage.py en delinker.py naar de toolserver gezet. Daar "python delinker.py" gedraaid.

user-config.py aangevuld:

# Defining a new configuration variable for delinker.py and replace.py
CommonsDelinker = {}
# Gives admins the chance to manually delink the image. Default: 10 minutes.
CommonsDelinker['delink_wait'] = 600
# Images with this exclusion string in the deletion comment will not be delinked.
CommonsDelinker['exclude_string'] = 'no-orgullobot'
# General timeout, used for fetching the deletion log and other timeouts.
CommonsDelinker['timeout'] = 30
# Default delink summary.
CommonsDelinker['summary_default'] = "The file [[:$1]] has been removed, as it has been deleted by [[User:$2]]: ''$3''."
# Time before a new summary is fetched.
CommonsDelinker['summary_cache'] = 3600
 
# Number of threads to spawn. checkusage_instances + logger_instances may never
# exceed the number of allowed MySQL connections
CommonsDelinker['checkusage_instances'] = 5
CommonsDelinker['delinker_instances'] = 9
CommonsDelinker['logger_instances'] = 2
 
# MySQL connection information
CommonsDelinker['sql_host'] = 'sql'
CommonsDelinker['sql_user'] = 'orgullo'
CommonsDelinker['sql_password'] = "############" # Wachtwoord bevat onderkasten, kapitalen, cijfers, een ''-''-teken en een ''#''
# database.table to use for logging
CommonsDelinker['log_table'] = 'u_orgullo_logs.delinker' # gewijzigd (was _test)

Console output (ligt het aan het wachtwoord voor mysql?)

siebrand@hemlock:~/pywikipedia$ python delinker.py
WARNING: Configuration variable CommonsDelinker not known. Misspelled?
Checked for running processes. 6 processes currently running, including the current process.
Running CommonsDelinker
Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "delinker.py", line 282, in run
    sql_pass = config['sql_password'])
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in __init__
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in <generator expression>
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "encodings/utf_8.py", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
 
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "delinker.py", line 282, in run
    sql_pass = config['sql_password'])
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in __init__
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in <generator expression>
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "encodings/utf_8.py", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
 
Exception in thread Thread-3:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "delinker.py", line 282, in run
    sql_pass = config['sql_password'])
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in __init__
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in <generator expression>
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "encodings/utf_8.py", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
 
Exception in thread Thread-4:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "delinker.py", line 282, in run
    sql_pass = config['sql_password'])
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in __init__
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in <generator expression>
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "encodings/utf_8.py", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
 
Exception in thread Thread-5:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "delinker.py", line 282, in run
    sql_pass = config['sql_password'])
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in __init__
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "/home/siebrand/pywikipedia/checkusage.py", line 127, in <generator expression>
    self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor))
  File "encodings/utf_8.py", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
 
siebrand@hemlock:~/pywikipedia$

Was een bug in MySQLdb 1.2.1_p. Zie diff voor wijzigingen en uitleg. Bryan 18:01, 30 May 2007 (UTC)

Great job ^__^

Hi Bryan, i've seen this (fantastic) page and i want to ask/suggest you:

  • If you need, you can upload a .zip file (like an image) (or .rar, .tar.gz, what is allowed and you want :-) ) of your set, but if you don't want i don't oblige you ;-)
  • If you need an help (please see that i'm not a python guru :D i'm still learning ;-) ) i am always available ^__^

Bye, --Filnik 13:10, 31 May 2007 (UTC)

It here: Image:mwclient-0.4.0.zip. I currently don't have time to work on it, but I'll see in a few weeks what I can do with it. Bryan 14:09, 31 May 2007 (UTC)

Python: subpages

Sorry for the unacceptable delay in answering you, but as you may or may not have noticed, the damn hosting is doing everything except working correctly in these days :-(

However, subpage should be already enabled... I've done a test at Python:Sandbox/test. What was the problem? Snowolf how can I help? 23:45, 7 June 2007 (UTC)

Personal tools
Share