Make it possible to run Bot with -always
To be able to run script unattended
This commit is contained in:
@@ -68,7 +68,7 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
# Init working directory
|
# Init working directory
|
||||||
self.init_wdir()
|
self.init_wdir()
|
||||||
|
|
||||||
super().__init__(*kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
def run(self):
|
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
|
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
|
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()
|
||||||
|
always = self.getOption("always")
|
||||||
|
aborts = True if self.getOption("always") else list()
|
||||||
|
|
||||||
bot = pywikibot.specialbots.UploadRobot(
|
bot = pywikibot.specialbots.UploadRobot(
|
||||||
filepath,
|
filepath,
|
||||||
@@ -345,7 +347,9 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
|
|||||||
keepFilename=keepFilename,
|
keepFilename=keepFilename,
|
||||||
verifyDescription=verifyDescription,
|
verifyDescription=verifyDescription,
|
||||||
ignoreWarning=ignoreWarning,
|
ignoreWarning=ignoreWarning,
|
||||||
targetSite = targetSite
|
targetSite = targetSite,
|
||||||
|
always=always,
|
||||||
|
aborts=aborts,
|
||||||
)
|
)
|
||||||
|
|
||||||
bot.run()
|
bot.run()
|
||||||
@@ -380,7 +384,7 @@ def main(*args):
|
|||||||
local_args, None )
|
local_args, None )
|
||||||
|
|
||||||
# Init Bot
|
# 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
|
# Run bot
|
||||||
jogobot.bot.run_bot( task_slug, None, bot )
|
jogobot.bot.run_bot( task_slug, None, bot )
|
||||||
|
|||||||
Reference in New Issue
Block a user