Skip to content

Commit

Permalink
Add util function to open generated images
Browse files Browse the repository at this point in the history
  • Loading branch information
plant99 committed Jul 24, 2020
1 parent a2a9d00 commit 67777ad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions felicette/utils/sys_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import sys
import os
from rich import print as rprint


def exit_cli(message):
rprint("%s" % message)
sys.exit(0)

def display_file(file_name):
"""
Open given file with default user program.
"""
if sys.platform.startswith('linux'):
os.system('xdg-open %s' % file_name)

elif sys.platform.startswith('darwin'):
os.system('open %s' % file_name)

0 comments on commit 67777ad

Please sign in to comment.