Skip to content

Commit

Permalink
Allow quickstart code to run without arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyespo committed Mar 25, 2012
1 parent 937d16b commit fa7b6df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README
Expand Up @@ -18,9 +18,10 @@ as command-line arguments and logs events generated::
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
path = sys.argv[1] if len(sys.argv) > 1 else '.'
event_handler = LoggingEventHandler()
observer = Observer()
observer.schedule(event_handler, path=sys.argv[1], recursive=True)
observer.schedule(event_handler, path, recursive=True)
observer.start()
try:
while True:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Expand Up @@ -41,7 +41,7 @@ file system changes and simply log them to the console::
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
path = sys.argv[1]
path = sys.argv[1] if len(sys.argv) > 1 else '.'
event_handler = LoggingEventHandler()
observer = Observer()
observer.schedule(event_handler, path, recursive=True)
Expand Down

0 comments on commit fa7b6df

Please sign in to comment.