Replaced platform.system() with PLATFORM var
* Better?
This commit is contained in:
parent
bc2c3a2c80
commit
c72372d55c
7 changed files with 50 additions and 46 deletions
|
|
@ -6,7 +6,6 @@ import atexit
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import plistlib
|
import plistlib
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -46,6 +45,7 @@ PANE_RATIOS = (
|
||||||
22, # ddrescue progress
|
22, # ddrescue progress
|
||||||
4, # Journal (kernel messages)
|
4, # Journal (kernel messages)
|
||||||
)
|
)
|
||||||
|
PLATFORM = std.PLATFORM
|
||||||
SETTING_PRESETS = (
|
SETTING_PRESETS = (
|
||||||
'Default',
|
'Default',
|
||||||
'Fast',
|
'Fast',
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import atexit
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
@ -75,6 +74,7 @@ MENU_SETS = {
|
||||||
MENU_TOGGLES = (
|
MENU_TOGGLES = (
|
||||||
'Skip USB Benchmarks',
|
'Skip USB Benchmarks',
|
||||||
)
|
)
|
||||||
|
PLATFORM = std.PLATFORM
|
||||||
STATUS_COLORS = {
|
STATUS_COLORS = {
|
||||||
'Passed': 'GREEN',
|
'Passed': 'GREEN',
|
||||||
'Aborted': 'YELLOW',
|
'Aborted': 'YELLOW',
|
||||||
|
|
@ -374,7 +374,7 @@ class State():
|
||||||
# Functions
|
# Functions
|
||||||
def audio_test():
|
def audio_test():
|
||||||
"""Run an OS-specific audio test."""
|
"""Run an OS-specific audio test."""
|
||||||
if platform.system() == 'Linux':
|
if PLATFORM == 'Linux':
|
||||||
audio_test_linux()
|
audio_test_linux()
|
||||||
# TODO: Add tests for other OS
|
# TODO: Add tests for other OS
|
||||||
|
|
||||||
|
|
@ -423,10 +423,10 @@ def build_menu(cli_mode=False, quick_mode=False):
|
||||||
menu.add_action('Power Off')
|
menu.add_action('Power Off')
|
||||||
|
|
||||||
# Compatibility checks
|
# Compatibility checks
|
||||||
if platform.system() != 'Linux':
|
if PLATFORM != 'Linux':
|
||||||
for name in ('Audio Test', 'Keyboard Test', 'Network Test'):
|
for name in ('Audio Test', 'Keyboard Test', 'Network Test'):
|
||||||
menu.actions[name]['Disabled'] = True
|
menu.actions[name]['Disabled'] = True
|
||||||
if platform.system() not in ('Darwin', 'Linux'):
|
if PLATFORM not in ('Darwin', 'Linux'):
|
||||||
for name in ('Matrix', 'Tubes'):
|
for name in ('Matrix', 'Tubes'):
|
||||||
menu.actions[name]['Disabled'] = True
|
menu.actions[name]['Disabled'] = True
|
||||||
|
|
||||||
|
|
@ -661,10 +661,10 @@ def cpu_mprime_test(state, test_objects):
|
||||||
state.update_progress_pane()
|
state.update_progress_pane()
|
||||||
state.panes['Prime95'] = tmux.split_window(
|
state.panes['Prime95'] = tmux.split_window(
|
||||||
lines=10, vertical=True, watch_file=prime_log)
|
lines=10, vertical=True, watch_file=prime_log)
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
state.panes['Temps'] = tmux.split_window(
|
state.panes['Temps'] = tmux.split_window(
|
||||||
behind=True, percent=80, vertical=True, cmd='./hw-sensors')
|
behind=True, percent=80, vertical=True, cmd='./hw-sensors')
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
state.panes['Temps'] = tmux.split_window(
|
state.panes['Temps'] = tmux.split_window(
|
||||||
behind=True, percent=80, vertical=True, watch_file=sensors_out)
|
behind=True, percent=80, vertical=True, watch_file=sensors_out)
|
||||||
tmux.resize_pane(height=3)
|
tmux.resize_pane(height=3)
|
||||||
|
|
@ -750,7 +750,7 @@ def disk_io_benchmark(state, test_objects, skip_usb=True):
|
||||||
def _run_io_benchmark(test_obj, log_path):
|
def _run_io_benchmark(test_obj, log_path):
|
||||||
"""Run I/O benchmark and handle exceptions."""
|
"""Run I/O benchmark and handle exceptions."""
|
||||||
dev_path = test_obj.dev.path
|
dev_path = test_obj.dev.path
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
# Use "RAW" disks under macOS
|
# Use "RAW" disks under macOS
|
||||||
dev_path = dev_path.with_name(f'r{dev_path.name}')
|
dev_path = dev_path.with_name(f'r{dev_path.name}')
|
||||||
offset = 0
|
offset = 0
|
||||||
|
|
@ -783,7 +783,7 @@ def disk_io_benchmark(state, test_objects, skip_usb=True):
|
||||||
f'if={dev_path}',
|
f'if={dev_path}',
|
||||||
'of=/dev/null',
|
'of=/dev/null',
|
||||||
]
|
]
|
||||||
if platform.system() == 'Linux':
|
if PLATFORM == 'Linux':
|
||||||
cmd.append('iflag=direct')
|
cmd.append('iflag=direct')
|
||||||
|
|
||||||
# Run and get read rate
|
# Run and get read rate
|
||||||
|
|
@ -1270,7 +1270,7 @@ def screensaver(name):
|
||||||
cmd = ['cmatrix', '-abs']
|
cmd = ['cmatrix', '-abs']
|
||||||
elif name == 'pipes':
|
elif name == 'pipes':
|
||||||
cmd = [
|
cmd = [
|
||||||
'pipes' if platform.system() == 'Linux' else 'pipes.sh',
|
'pipes' if PLATFORM == 'Linux' else 'pipes.sh',
|
||||||
'-t', '0',
|
'-t', '0',
|
||||||
'-t', '1',
|
'-t', '1',
|
||||||
'-t', '2',
|
'-t', '2',
|
||||||
|
|
@ -1294,7 +1294,7 @@ def set_apple_fan_speed(speed):
|
||||||
raise RuntimeError(f'Invalid speed {speed}')
|
raise RuntimeError(f'Invalid speed {speed}')
|
||||||
|
|
||||||
# Set cmd
|
# Set cmd
|
||||||
if platform.system() == 'Linux':
|
if PLATFORM == 'Linux':
|
||||||
cmd = ['apple-fans', speed]
|
cmd = ['apple-fans', speed]
|
||||||
#TODO: Add method for use under macOS
|
#TODO: Add method for use under macOS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import plistlib
|
import plistlib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
@ -20,7 +19,13 @@ from wk.cfg.hw import (
|
||||||
)
|
)
|
||||||
from wk.cfg.main import KIT_NAME_SHORT
|
from wk.cfg.main import KIT_NAME_SHORT
|
||||||
from wk.exe import get_json_from_command, run_program
|
from wk.exe import get_json_from_command, run_program
|
||||||
from wk.std import bytes_to_string, color_string, sleep, string_to_bytes
|
from wk.std import (
|
||||||
|
PLATFORM,
|
||||||
|
bytes_to_string,
|
||||||
|
color_string,
|
||||||
|
sleep,
|
||||||
|
string_to_bytes,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# STATIC VARIABLES
|
# STATIC VARIABLES
|
||||||
|
|
@ -94,11 +99,11 @@ class CpuRam(BaseObj):
|
||||||
|
|
||||||
def get_cpu_details(self):
|
def get_cpu_details(self):
|
||||||
"""Get CPU details using OS specific methods."""
|
"""Get CPU details using OS specific methods."""
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
cmd = 'sysctl -n machdep.cpu.brand_string'.split()
|
cmd = 'sysctl -n machdep.cpu.brand_string'.split()
|
||||||
proc = run_program(cmd, check=False)
|
proc = run_program(cmd, check=False)
|
||||||
self.description = re.sub(r'\s+', ' ', proc.stdout.strip())
|
self.description = re.sub(r'\s+', ' ', proc.stdout.strip())
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
cmd = ['lscpu', '--json']
|
cmd = ['lscpu', '--json']
|
||||||
json_data = get_json_from_command(cmd)
|
json_data = get_json_from_command(cmd)
|
||||||
for line in json_data.get('lscpu', [{}]):
|
for line in json_data.get('lscpu', [{}]):
|
||||||
|
|
@ -117,9 +122,9 @@ class CpuRam(BaseObj):
|
||||||
|
|
||||||
def get_ram_details(self):
|
def get_ram_details(self):
|
||||||
"""Get RAM details using OS specific methods."""
|
"""Get RAM details using OS specific methods."""
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
dimm_list = get_ram_list_macos()
|
dimm_list = get_ram_list_macos()
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
dimm_list = get_ram_list_linux()
|
dimm_list = get_ram_list_linux()
|
||||||
|
|
||||||
details = {'Total': 0}
|
details = {'Total': 0}
|
||||||
|
|
@ -299,9 +304,9 @@ class Disk(BaseObj):
|
||||||
Required details default to generic descriptions
|
Required details default to generic descriptions
|
||||||
and are converted to the correct type.
|
and are converted to the correct type.
|
||||||
"""
|
"""
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
self.details = get_disk_details_macos(self.path)
|
self.details = get_disk_details_macos(self.path)
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
self.details = get_disk_details_linux(self.path)
|
self.details = get_disk_details_linux(self.path)
|
||||||
|
|
||||||
# Set necessary details
|
# Set necessary details
|
||||||
|
|
@ -362,9 +367,9 @@ class Disk(BaseObj):
|
||||||
def is_4k_aligned(self):
|
def is_4k_aligned(self):
|
||||||
"""Check that all disk partitions are aligned, returns bool."""
|
"""Check that all disk partitions are aligned, returns bool."""
|
||||||
aligned = True
|
aligned = True
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
aligned = is_4k_aligned_macos(self.details)
|
aligned = is_4k_aligned_macos(self.details)
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
aligned = is_4k_aligned_linux(self.path, self.details['phy-sec'])
|
aligned = is_4k_aligned_linux(self.path, self.details['phy-sec'])
|
||||||
#TODO: Add checks for other OS
|
#TODO: Add checks for other OS
|
||||||
|
|
||||||
|
|
@ -640,9 +645,9 @@ def get_disk_serial_macos(path):
|
||||||
def get_disks(skip_kits=False):
|
def get_disks(skip_kits=False):
|
||||||
"""Get disks using OS-specific methods, returns list."""
|
"""Get disks using OS-specific methods, returns list."""
|
||||||
disks = []
|
disks = []
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
disks = get_disks_macos()
|
disks = get_disks_macos()
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
disks = get_disks_linux()
|
disks = get_disks_linux()
|
||||||
|
|
||||||
# Skip WK disks
|
# Skip WK disks
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
|
|
||||||
from wk.cfg.hw import CPU_CRITICAL_TEMP, SMC_IDS, TEMP_COLORS
|
from wk.cfg.hw import CPU_CRITICAL_TEMP, SMC_IDS, TEMP_COLORS
|
||||||
from wk.exe import run_program, start_thread
|
from wk.exe import run_program, start_thread
|
||||||
from wk.std import color_string, sleep
|
from wk.std import PLATFORM, color_string, sleep
|
||||||
|
|
||||||
|
|
||||||
# STATIC VARIABLES
|
# STATIC VARIABLES
|
||||||
|
|
@ -23,7 +22,7 @@ SMC_REGEX = re.compile(
|
||||||
r'\s+(?P<Value>.*?)'
|
r'\s+(?P<Value>.*?)'
|
||||||
r'\s*\(bytes (?P<Bytes>.*)\)$'
|
r'\s*\(bytes (?P<Bytes>.*)\)$'
|
||||||
)
|
)
|
||||||
SENSOR_SOURCE_WIDTH = 25 if platform.system() == 'Darwin' else 20
|
SENSOR_SOURCE_WIDTH = 25 if PLATFORM == 'Darwin' else 20
|
||||||
|
|
||||||
|
|
||||||
# Error Classes
|
# Error Classes
|
||||||
|
|
@ -188,9 +187,9 @@ class Sensors():
|
||||||
|
|
||||||
def update_sensor_data(self, exit_on_thermal_limit=True):
|
def update_sensor_data(self, exit_on_thermal_limit=True):
|
||||||
"""Update sensor data via OS-specific means."""
|
"""Update sensor data via OS-specific means."""
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
self.update_sensor_data_macos(exit_on_thermal_limit)
|
self.update_sensor_data_macos(exit_on_thermal_limit)
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
self.update_sensor_data_linux(exit_on_thermal_limit)
|
self.update_sensor_data_linux(exit_on_thermal_limit)
|
||||||
|
|
||||||
def update_sensor_data_linux(self, exit_on_thermal_limit=True):
|
def update_sensor_data_linux(self, exit_on_thermal_limit=True):
|
||||||
|
|
@ -262,9 +261,9 @@ def fix_sensor_name(name):
|
||||||
def get_sensor_data():
|
def get_sensor_data():
|
||||||
"""Get sensor data via OS-specific means, returns dict."""
|
"""Get sensor data via OS-specific means, returns dict."""
|
||||||
sensor_data = {}
|
sensor_data = {}
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
sensor_data = get_sensor_data_macos()
|
sensor_data = get_sensor_data_macos()
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
sensor_data = get_sensor_data_linux()
|
sensor_data = get_sensor_data_linux()
|
||||||
|
|
||||||
return sensor_data
|
return sensor_data
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,12 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
|
|
||||||
from wk.exe import get_json_from_command, run_program
|
from wk.exe import get_json_from_command, run_program
|
||||||
from wk.std import GenericError, show_data
|
from wk.std import PLATFORM, GenericError, show_data
|
||||||
|
|
||||||
from wk.cfg.net import BACKUP_SERVERS
|
from wk.cfg.net import BACKUP_SERVERS
|
||||||
|
|
||||||
|
|
@ -62,7 +61,7 @@ def mount_backup_shares(read_write=False):
|
||||||
mount_str = f'{name} (//{details["Address"]}/{details["Share"]})'
|
mount_str = f'{name} (//{details["Address"]}/{details["Share"]})'
|
||||||
|
|
||||||
# Prep mount point
|
# Prep mount point
|
||||||
if platform.system() in ('Darwin', 'Linux'):
|
if PLATFORM in ('Darwin', 'Linux'):
|
||||||
mount_point = pathlib.Path(f'/Backups/{name}')
|
mount_point = pathlib.Path(f'/Backups/{name}')
|
||||||
try:
|
try:
|
||||||
if not mount_point.exists():
|
if not mount_point.exists():
|
||||||
|
|
@ -107,7 +106,7 @@ def mount_network_share(details, mount_point=None, read_write=False):
|
||||||
raise RuntimeError('Not connected to a network')
|
raise RuntimeError('Not connected to a network')
|
||||||
|
|
||||||
# Build OS-specific command
|
# Build OS-specific command
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
'mount',
|
'mount',
|
||||||
|
|
@ -116,7 +115,7 @@ def mount_network_share(details, mount_point=None, read_write=False):
|
||||||
f'//{username}:{password}@{address}/{share}',
|
f'//{username}:{password}@{address}/{share}',
|
||||||
mount_point,
|
mount_point,
|
||||||
]
|
]
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
'mount',
|
'mount',
|
||||||
|
|
@ -131,7 +130,7 @@ def mount_network_share(details, mount_point=None, read_write=False):
|
||||||
f'//{address}/{share}',
|
f'//{address}/{share}',
|
||||||
mount_point
|
mount_point
|
||||||
]
|
]
|
||||||
elif platform.system() == 'Windows':
|
elif PLATFORM == 'Windows':
|
||||||
cmd = ['net', 'use']
|
cmd = ['net', 'use']
|
||||||
if mount_point:
|
if mount_point:
|
||||||
cmd.append(f'{mount_point}:')
|
cmd.append(f'{mount_point}:')
|
||||||
|
|
@ -158,14 +157,14 @@ def share_is_mounted(details):
|
||||||
"""Check if dev/share/etc is mounted, returns bool."""
|
"""Check if dev/share/etc is mounted, returns bool."""
|
||||||
mounted = False
|
mounted = False
|
||||||
|
|
||||||
if platform.system() == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
# Weak and naive text search
|
# Weak and naive text search
|
||||||
proc = run_program(['mount'], check=False)
|
proc = run_program(['mount'], check=False)
|
||||||
for line in proc.stdout.splitlines():
|
for line in proc.stdout.splitlines():
|
||||||
if f'{details["Address"]}/{details["Share"]}' in line:
|
if f'{details["Address"]}/{details["Share"]}' in line:
|
||||||
mounted = True
|
mounted = True
|
||||||
break
|
break
|
||||||
elif platform.system() == 'Linux':
|
elif PLATFORM == 'Linux':
|
||||||
cmd = [
|
cmd = [
|
||||||
'findmnt',
|
'findmnt',
|
||||||
'--list',
|
'--list',
|
||||||
|
|
@ -183,7 +182,7 @@ def share_is_mounted(details):
|
||||||
mounted = True
|
mounted = True
|
||||||
break
|
break
|
||||||
#TODO: Check mount status under Windows
|
#TODO: Check mount status under Windows
|
||||||
#elif platform.system() == 'Windows':
|
#elif PLATFORM == 'Windows':
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
return mounted
|
return mounted
|
||||||
|
|
@ -222,9 +221,9 @@ def unmount_backup_shares():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Build OS specific kwargs
|
# Build OS specific kwargs
|
||||||
if platform.system() in ('Darwin', 'Linux'):
|
if PLATFORM in ('Darwin', 'Linux'):
|
||||||
kwargs['mount_point'] = f'/Backups/{name}'
|
kwargs['mount_point'] = f'/Backups/{name}'
|
||||||
elif platform.system() == 'Windows':
|
elif PLATFORM == 'Windows':
|
||||||
kwargs['details'] = details
|
kwargs['details'] = details
|
||||||
|
|
||||||
# Unmount and add to report
|
# Unmount and add to report
|
||||||
|
|
@ -243,9 +242,9 @@ def unmount_network_share(details=None, mount_point=None):
|
||||||
cmd = []
|
cmd = []
|
||||||
|
|
||||||
# Build OS specific command
|
# Build OS specific command
|
||||||
if platform.system() in ('Darwin', 'Linux'):
|
if PLATFORM in ('Darwin', 'Linux'):
|
||||||
cmd = ['sudo', 'umount', mount_point]
|
cmd = ['sudo', 'umount', mount_point]
|
||||||
elif platform.system() == 'Windows':
|
elif PLATFORM == 'Windows':
|
||||||
cmd = ['net', 'use']
|
cmd = ['net', 'use']
|
||||||
if mount_point:
|
if mount_point:
|
||||||
cmd.append(f'{mount_point}:')
|
cmd.append(f'{mount_point}:')
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ COLORS = {
|
||||||
'CYAN': '\033[36m',
|
'CYAN': '\033[36m',
|
||||||
}
|
}
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
PLATFORM = platform.system()
|
||||||
REGEX_SIZE_STRING = re.compile(
|
REGEX_SIZE_STRING = re.compile(
|
||||||
r'(?P<size>\-?\d+\.?\d*)\s*(?P<units>[PTGMKB])(?P<binary>I?)B?'
|
r'(?P<size>\-?\d+\.?\d*)\s*(?P<units>[PTGMKB])(?P<binary>I?)B?'
|
||||||
)
|
)
|
||||||
|
|
@ -138,7 +139,7 @@ class Menu():
|
||||||
# Display item in YELLOW
|
# Display item in YELLOW
|
||||||
disabled = True
|
disabled = True
|
||||||
checkmark = '*'
|
checkmark = '*'
|
||||||
if 'DISPLAY' in os.environ or platform.system() == 'Darwin':
|
if 'DISPLAY' in os.environ or PLATFORM == 'Darwin':
|
||||||
checkmark = '✓'
|
checkmark = '✓'
|
||||||
display_name = f'{index if index else name[:1].upper()}: '
|
display_name = f'{index if index else name[:1].upper()}: '
|
||||||
if not (index and index >= 10):
|
if not (index and index >= 10):
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
import platform
|
|
||||||
|
|
||||||
from wk.exe import run_program
|
from wk.exe import run_program
|
||||||
|
from wk.std import PLATFORM
|
||||||
|
|
||||||
|
|
||||||
# STATIC_VARIABLES
|
# STATIC_VARIABLES
|
||||||
|
|
@ -149,7 +149,7 @@ def prep_action(
|
||||||
elif text:
|
elif text:
|
||||||
# Display text
|
# Display text
|
||||||
echo_cmd = ['echo']
|
echo_cmd = ['echo']
|
||||||
if platform.system() == 'Linux':
|
if PLATFORM == 'Linux':
|
||||||
echo_cmd.append('-e')
|
echo_cmd.append('-e')
|
||||||
action_cmd.extend([
|
action_cmd.extend([
|
||||||
'watch',
|
'watch',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue