jenkins-bot has submitted this change and it was merged.
Change subject: Use pywikibot.daemonize instead of external package ......................................................................
Use pywikibot.daemonize instead of external package
Bug: T89581 Change-Id: I6ee5250edc852b04463994791f3d18404be7c62f --- M pywikibot/bot.py M requirements.txt M setup.py 3 files changed, 6 insertions(+), 12 deletions(-)
Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index de68ebd..b319e3c 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -39,6 +39,7 @@
from pywikibot import backports from pywikibot import config +from pywikibot import daemonize from pywikibot import version from pywikibot.tools import deprecated, deprecated_args
@@ -795,12 +796,9 @@ config.debug_log.append(component) elif arg in ('-verbose', '-v'): config.verbose_output += 1 - elif arg == '-daemonize': - import daemonize - daemonize.daemonize() - elif arg.startswith('-daemonize:'): - import daemonize - daemonize.daemonize(redirect_std=arg[len('-daemonize:'):]) + elif arg.startswith('-daemonize'): + redirect_std = arg[len('-daemonize:'):] if ':' in arg else None + daemonize.daemonize(redirect_std=redirect_std) else: # the argument depends on numerical config settings # e.g. -maxlag: @@ -878,8 +876,8 @@ -user:xyz Log in as user 'xyz' instead of the default username.
-daemonize:xyz Immediately return control to the terminal and redirect - stdout and stderr to xyz (only use for bots that require - no input from stdin). + stdout and stderr to file xyz. + (only use for bots that require no input from stdin).
-help Show this help text.
diff --git a/requirements.txt b/requirements.txt index e0f5680..47b8316 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,9 +21,6 @@ # mandatory; see README.conversion.txt httplib2>=0.9.0
-# core option 'daemonize': -daemonize - # core interwiki_graph.py: pydot
diff --git a/setup.py b/setup.py index 72e128d..fb92b4c 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ extra_deps = { # Core library dependencies 'isbn': ['python-stdnum'], - 'daemonize': ['daemonize'], 'Graphviz': ['pydot'], 'MySQL': ['oursql'], 'Yahoo': ['pYsearch'],
pywikibot-commits@lists.wikimedia.org