From f9a39a6f49ca4573f81871bd8e04dbdd0302f210 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Fri, 5 Oct 2018 14:43:43 +0200 Subject: [PATCH] Make it possible to run Bot with -always To be able to run script unattended --- euroexange/euroexange.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/euroexange/euroexange.py b/euroexange/euroexange.py index 9c54020..78f9a7a 100644 --- a/euroexange/euroexange.py +++ b/euroexange/euroexange.py @@ -68,7 +68,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ): # Init working directory self.init_wdir() - super().__init__(*kwargs) + super().__init__(**kwargs) def run(self): @@ -337,6 +337,8 @@ class EuroExangeBot( pywikibot.bot.BaseBot ): verifyDescription = True #set to False to skip double-checking/editing description => change to bot-mode 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() + always = self.getOption("always") + aborts = True if self.getOption("always") else list() bot = pywikibot.specialbots.UploadRobot( filepath, @@ -345,7 +347,9 @@ class EuroExangeBot( pywikibot.bot.BaseBot ): keepFilename=keepFilename, verifyDescription=verifyDescription, ignoreWarning=ignoreWarning, - targetSite = targetSite + targetSite = targetSite, + always=always, + aborts=aborts, ) bot.run() @@ -380,7 +384,7 @@ def main(*args): local_args, None ) # Init Bot - bot = jogobot.bot.init_bot( task_slug, None, EuroExangeBot, genFactory) + bot = jogobot.bot.init_bot( task_slug, None, EuroExangeBot, genFactory, **subtask_args) # Run bot jogobot.bot.run_bot( task_slug, None, bot )