Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
638d2b6a3d | ||
|
|
1d41e206c0 | ||
|
|
a0377e1f80 | ||
|
|
f4296d8410 | ||
|
|
f28fad2edb | ||
|
|
5cf5c5a597 |
@@ -29,6 +29,7 @@ import hashlib
|
||||
import json
|
||||
|
||||
import pywikibot
|
||||
import pywikibot.specialbots
|
||||
|
||||
import jogobot
|
||||
|
||||
@@ -60,7 +61,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
||||
data_source = "http://www.ecb.int/stats/eurofxref/eurofxref-hist.zip"
|
||||
zip_file = "eurofxref-hist.zip"
|
||||
csv_file = "eurofxref-hist.csv"
|
||||
upload_comment = "Bot: ([[User:Jogobot/Euroexange|euroexange]]) update chart"
|
||||
upload_comment = "Bot: ([[User:JogoBot/Euroexange|euroexange]]) update chart"
|
||||
|
||||
def __init__( self, genFactory, **kwargs ):
|
||||
|
||||
@@ -237,11 +238,13 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
||||
self.current_job.filepage = pywikibot.page.FilePage(
|
||||
pywikibot.Site(), job.image)
|
||||
|
||||
# Stop if file not jet exists
|
||||
# Skip if file not yet exists
|
||||
if not self.current_job.filepage.exists():
|
||||
jogobot.output( "Work on Job {}".format( self.current_job.image),
|
||||
"ERROR" )
|
||||
raise pywikibot.NoPage( filepage )
|
||||
jogobot.output( "Image {} does not exists on wiki, job skipped!".
|
||||
format( self.current_job.image), "WARNING" )
|
||||
|
||||
return
|
||||
#~ raise pywikibot.NoPage( self.current_job.filepage )
|
||||
|
||||
# Check if update is necessary
|
||||
if self.image_update_needed():
|
||||
@@ -329,10 +332,10 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
||||
comment = type(self).upload_comment
|
||||
|
||||
filename = job.image
|
||||
filepath = os.path.join(self.wdir, job.image)
|
||||
filepath = [ os.path.join(self.wdir, job.image) ]
|
||||
keepFilename = True #set to True to skip double-checking/editing destination filename
|
||||
verifyDescription = True #set to False to skip double-checking/editing description => change to bot-mode
|
||||
ignoreWarning=False #set to True to skip warnings, Upload even if another file would be overwritten or another mistake would be risked
|
||||
ignoreWarning = [ "exists", "duplicate", ] #set to True to skip warnings, Upload even if another file would be overwritten or another mistake would be risked
|
||||
targetSite = pywikibot.Site()
|
||||
|
||||
bot = pywikibot.specialbots.UploadRobot(
|
||||
@@ -345,7 +348,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
||||
targetSite = targetSite
|
||||
)
|
||||
|
||||
bot.upload_image(debug=True)
|
||||
bot.run()
|
||||
|
||||
def main(*args):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user