Skip to content

Commit

Permalink
remove unnecessary system check for Unicode output
Browse files Browse the repository at this point in the history
  • Loading branch information
Brennen Raimer committed Mar 7, 2020
1 parent e773f3b commit 0d582d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
16 changes: 0 additions & 16 deletions halo/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
init(autoreset=True)


def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
boolean
Whether operating system supports main symbols or not
"""

os_arch = platform.system()

if os_arch != 'Windows':
return True

return False


def get_environment():
"""Get the environment in which halo is running
Expand Down
11 changes: 4 additions & 7 deletions halo/halo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from spinners.spinners import Spinners

from halo._utils import (colored_frame, decode_utf_8_text, get_environment,
get_terminal_columns, is_supported, is_text_type,
get_terminal_columns, is_text_type,
encode_utf_8_text)


Expand Down Expand Up @@ -308,13 +308,10 @@ def _get_spinner(self, spinner):
if spinner and type(spinner) == dict:
return spinner

if is_supported():
if all([is_text_type(spinner), spinner in Spinners.__members__]):
return Spinners[spinner].value
else:
return default_spinner
if all([is_text_type(spinner), spinner in Spinners.__members__]):
return Spinners[spinner].value
else:
return Spinners['line'].value
return default_spinner

def _get_text(self, text):
"""Creates frames based on the selected animation
Expand Down

0 comments on commit 0d582d7

Please sign in to comment.