Browse Source

Make it possible to run Bot with -always

To be able to run script unattended
develop
Jonathan Golder 4 years ago
parent
commit
f9a39a6f49
  1. 10
      euroexange/euroexange.py

10
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 )

Loading…
Cancel
Save