Compare commits
6
Commits
6c5eff65fb
...
638d2b6a3d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
638d2b6a3d | ||
|
|
1d41e206c0 | ||
|
|
a0377e1f80 | ||
|
|
f4296d8410 | ||
|
|
f28fad2edb | ||
|
|
5cf5c5a597 |
+13
-10
@@ -29,6 +29,7 @@ import hashlib
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import pywikibot
|
import pywikibot
|
||||||
|
import pywikibot.specialbots
|
||||||
|
|
||||||
import jogobot
|
import jogobot
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
data_source = "http://www.ecb.int/stats/eurofxref/eurofxref-hist.zip"
|
data_source = "http://www.ecb.int/stats/eurofxref/eurofxref-hist.zip"
|
||||||
zip_file = "eurofxref-hist.zip"
|
zip_file = "eurofxref-hist.zip"
|
||||||
csv_file = "eurofxref-hist.csv"
|
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 ):
|
def __init__( self, genFactory, **kwargs ):
|
||||||
|
|
||||||
@@ -237,11 +238,13 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
self.current_job.filepage = pywikibot.page.FilePage(
|
self.current_job.filepage = pywikibot.page.FilePage(
|
||||||
pywikibot.Site(), job.image)
|
pywikibot.Site(), job.image)
|
||||||
|
|
||||||
# Stop if file not jet exists
|
# Skip if file not yet exists
|
||||||
if not self.current_job.filepage.exists():
|
if not self.current_job.filepage.exists():
|
||||||
jogobot.output( "Work on Job {}".format( self.current_job.image),
|
jogobot.output( "Image {} does not exists on wiki, job skipped!".
|
||||||
"ERROR" )
|
format( self.current_job.image), "WARNING" )
|
||||||
raise pywikibot.NoPage( filepage )
|
|
||||||
|
return
|
||||||
|
#~ raise pywikibot.NoPage( self.current_job.filepage )
|
||||||
|
|
||||||
# Check if update is necessary
|
# Check if update is necessary
|
||||||
if self.image_update_needed():
|
if self.image_update_needed():
|
||||||
@@ -329,10 +332,10 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
comment = type(self).upload_comment
|
comment = type(self).upload_comment
|
||||||
|
|
||||||
filename = job.image
|
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
|
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
|
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()
|
targetSite = pywikibot.Site()
|
||||||
|
|
||||||
bot = pywikibot.specialbots.UploadRobot(
|
bot = pywikibot.specialbots.UploadRobot(
|
||||||
@@ -345,7 +348,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
targetSite = targetSite
|
targetSite = targetSite
|
||||||
)
|
)
|
||||||
|
|
||||||
bot.upload_image(debug=True)
|
bot.run()
|
||||||
|
|
||||||
def main(*args):
|
def main(*args):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user