Closed vidyarani-dg closed 6 years ago
@vidyarani-dg We do have an option for enabling and disabling the spinner. I believe you can disable it in your test environment using this.
I see , thanks! It's clearly in the initialization. Sorry, I missed it.
Will close this issue.
@vidyarani-dg Did it work as per your requirement?
@ManrajGrover : Apologies for the tardiness in getting back to you, I did try
Halo(text='Loading files', enabled=False)
It did disable the info messages, however the errors are still outputting to the terminal.
Is this how it is supposed to work ?
@vidyarani-dg Which errors are being outputted? I would need more information in order to assist.
@ManrajGrover : Sorry, the failure messages . For instance, this is how I am using the spinner.
With enabled=False, I do not see any of the success / text messages on the terminal, however I do see the failure messages.
spinner = Halo(text='Loading files', spinner='dots', enabled=False)
spinner.start()
for row in rows:
spinner.text = 'Processing line {}'.format(row.rownum)
try:
load(row)
except Exception:
spinner.fail("Error loading row {}".format(message)) # -> This is outputted to the terminal.
spinner.start()
spinner.succeed('Load successful, time taken in seconds: {}'.format((end - start).seconds))
spinner.stop()
@vidyarani-dg Got it. Thanks for reporting this. I'll fix this and notify you with the release.
Thank you.
@vidyarani-dg Made a release with fix in v0.0.11. Please upgrade and check if it works as expected.
I am using halo for the spinners and it works absolutely fine while running the management command from the command line, however I do not want the spinners while running my test suite. This is cluttering my tests and I want to disable it. I don't see an option to disable it. The only other option is to write the output to a file.
Is it possible to disable the spinners when not outputting to a TTY ?
Description
System settings