dool icon indicating copy to clipboard operation
dool copied to clipboard

When specfying `--output `-dool still prints on stdout

Open mucholove opened this issue 4 years ago • 1 comments

When specfying --output -dool still prints on stdout.

I expected dool to exclusivley print to a file.

I fixed this on my local version by introducing an if statement inside the perform function. (~/2868)

if op.output and step == op.delay:
    outputfile.write(oline + '\n')
else:
    sys.stdout.write(line + theme['input'])
    if op.debug:
       /,,,,

PS - Something else that is pretty weird is that the output dosen't follow the delay. The csv file is HUGE and adds several thousand lines every few seconds when it flushes. Not sure why

mucholove avatar Jul 02 '21 15:07 mucholove

+1. I tried running this on a bash script to perform. Couldn't get it done due to this issue.

xlight05 avatar Dec 14 '21 05:12 xlight05

As another datapoint, I prefer the current behaviour, so that I can monitor the data as it's being recorded. You can always redirect the output to /dev/null in a script if you don't want it.

kmac avatar Jan 24 '23 16:01 kmac

The output file is not written until sending ctrl+c to "dool --output test.log" . i think it's not proper....

tomchon avatar Feb 08 '23 15:02 tomchon

I just landed some code that addresses all of these things:

  1. --output /tmp/foo.csv will output only to a file
  2. Output file respects the delay again
  3. Fixed the output going line by line to the file so you can run tail -f on it as it writes
  4. Added a --display option so you can write to a file and display on your screen

Example: dool --more --output /tmp/foo.csv --display 15

Please test and let me know.

scottchiefbaker avatar Jun 05 '23 17:06 scottchiefbaker

This code has landed and will be in the next release.

scottchiefbaker avatar Jun 09 '23 19:06 scottchiefbaker