Skip to content

Commit

Permalink
Removed duration option
Browse files Browse the repository at this point in the history
Bug where after killing main process the recording still continue.
Removed option inside script. Use 'timeout 8h script.py' instead
to set duration.
  • Loading branch information
Moski authored and Moski committed Jan 19, 2019
1 parent 28bea29 commit dac811a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ Omitting `-n` or `-w` option defaults to using Selenium to parse the above
mentioned website and gets the most accurate time automaticly. You will need
Selenium and a Firefox driver available in your Path. (google how to setup or
make sure to use either of these 2 arguments)

`-d` amount of seconds to record. Infinite by default.
12 changes: 1 addition & 11 deletions record.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
from contextlib import contextmanager
from threading import Thread
from pathlib import Path
import datetime as dt
import argparse
Expand Down Expand Up @@ -54,9 +53,6 @@ def parse_args():
parser.add_argument(
'-n', '--now', dest='now', action="store_true",
help='start recording right now')
parser.add_argument(
'-d', '--duration', dest='record_duration', type=int,
help='duration of recording (in seconds)')
return parser.parse_args()


Expand Down Expand Up @@ -95,14 +91,8 @@ def main(args):
print(f'Sleep for {sleep_duration} seconds!')
time.sleep(sleep_duration)
with working_directory(Path(args.out_dir)):
t = Thread(target=record_worker, args=(token, args.url))
print('Start recording')
t.setDaemon(True)
t.start()
if args.record_duration is None:
t.join()
else:
t.join(args.record_duration)
record_worker(token, args.url)


if __name__ == '__main__':
Expand Down

0 comments on commit dac811a

Please sign in to comment.