Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --debug-force-polling to shell-command #336

Merged
merged 1 commit into from
Oct 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/watchdog/watchmedo.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ def log(args):
default=False,
help="Ignore events that occur while command is still being executed " \
"to avoid multiple simultaneous instances")
@arg('--debug-force-polling',
default=False,
help='[debug] forces polling')
@expects_obj
def shell_command(args):
"""
Expand All @@ -426,12 +429,16 @@ def shell_command(args):
:param args:
Command line argument options.
"""
from watchdog.observers import Observer
from watchdog.tricks import ShellCommandTrick

if not args.command:
args.command = None

if args.debug_force_polling:
from watchdog.observers.polling import PollingObserver as Observer
else:
from watchdog.observers import Observer

patterns, ignore_patterns = parse_patterns(args.patterns,
args.ignore_patterns)
handler = ShellCommandTrick(shell_command=args.command,
Expand Down