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

Fixing deprecation warnings with argh #242

Merged
merged 1 commit into from
Jul 2, 2014
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
11 changes: 8 additions & 3 deletions src/watchdog/watchmedo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
except ImportError:
from io import StringIO

from argh import arg, alias, ArghParser
from argh import arg, aliases, ArghParser, expects_obj
from watchdog.version import VERSION_STRING
from watchdog.utils import load_class
from pathtools.path import absolute_path, parent_dir_path
Expand Down Expand Up @@ -152,7 +152,7 @@ def schedule_tricks(observer, tricks, pathname, recursive):
observer.schedule(handler, trick_pathname, recursive)


@alias('tricks')
@aliases('tricks')
@arg('files',
nargs='*',
help='perform tricks from given file')
Expand All @@ -167,6 +167,7 @@ def schedule_tricks(observer, tricks, pathname, recursive):
@arg('--recursive',
default=True,
help='recursively monitor paths')
@expects_obj
def tricks_from(args):
"""
Subcommand to execute tricks from a tricks configuration file.
Expand Down Expand Up @@ -211,7 +212,7 @@ def tricks_from(args):
o.join()


@alias('generate-tricks-yaml')
@aliases('generate-tricks-yaml')
@arg('trick_paths',
nargs='*',
help='Dotted paths for all the tricks you want to generate')
Expand All @@ -228,6 +229,7 @@ def tricks_from(args):
default=False,
help='if --append-to-file is not specified, produces output for \
appending instead of a complete tricks yaml file.')
@expects_obj
def tricks_generate_yaml(args):
"""
Subcommand to generate Yaml configuration for tricks named on the command
Expand Down Expand Up @@ -314,6 +316,7 @@ def tricks_generate_yaml(args):
@arg('--debug-force-inotify',
default=False,
help='[debug] forces Linux inotify(7)')
@expects_obj
def log(args):
"""
Subcommand to log file system events to the console.
Expand Down Expand Up @@ -418,6 +421,7 @@ def log(args):
default=False,
help="Ignore events that occur while command is still being executed " \
"to avoid multiple simultaneous instances")
@expects_obj
def shell_command(args):
"""
Subcommand to execute shell commands in response to file system events.
Expand Down Expand Up @@ -497,6 +501,7 @@ def shell_command(args):
default=10.0,
help='when stopping, kill the subprocess after the specified timeout '
'(default 10)')
@expects_obj
def auto_restart(args):
"""
Subcommand to start a long-running subprocess and restart it
Expand Down