Permalink
Browse files

Allow quickstart code to run without arguments.

  • Loading branch information...
1 parent 937d16b commit fa7b6df99352b439f840bee8c19ec2a0e6d1776d @joeyespo joeyespo committed Mar 25, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 README
  2. +1 −1 docs/source/quickstart.rst
View
3 README
@@ -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:
@@ -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)

0 comments on commit fa7b6df

Please sign in to comment.