mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 01:14:11 +01:00
Fix some comments and use of [] as a default arg
Signed-off-by: Jack Andersen <johnandersen185@gmail.com>
This commit is contained in:
parent
ad3f427f9f
commit
a586b9b05d
@ -83,7 +83,7 @@ def send(colors, cache_dir=CACHE_DIR, to_send=True,
|
|||||||
|
|
||||||
# Writing to "/dev/pts/[0-9] lets you send data to open terminals.
|
# Writing to "/dev/pts/[0-9] lets you send data to open terminals.
|
||||||
if to_send:
|
if to_send:
|
||||||
ttys = []
|
ttys = None
|
||||||
if only_active:
|
if only_active:
|
||||||
ttys = util.fetch_active_ttys()
|
ttys = util.fetch_active_ttys()
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
|
||||||
__version__ = "3.3.1"
|
__version__ = "3.3.2"
|
||||||
__cache_version__ = "1.1.0"
|
__cache_version__ = "1.1.0"
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ def save_file(data, export_file):
|
|||||||
logging.warning("Couldn't write to %s.", export_file)
|
logging.warning("Couldn't write to %s.", export_file)
|
||||||
|
|
||||||
|
|
||||||
def save_to_tty(data, tty_name, active_ttys=[]):
|
def save_to_tty(data, tty_name, active_ttys=None):
|
||||||
"""Write data to a tty."""
|
"""Write data to a tty."""
|
||||||
if active_ttys:
|
if active_ttys:
|
||||||
if os.path.basename(tty_name) not in active_ttys:
|
if os.path.basename(tty_name) not in active_ttys:
|
||||||
@ -144,6 +144,8 @@ def save_to_tty(data, tty_name, active_ttys=[]):
|
|||||||
|
|
||||||
|
|
||||||
def fetch_active_ttys():
|
def fetch_active_ttys():
|
||||||
|
"""Fetches the active ttys as determined
|
||||||
|
by the `who` utility. On failure, we return None."""
|
||||||
try:
|
try:
|
||||||
out, err = subprocess.Popen(
|
out, err = subprocess.Popen(
|
||||||
["who"], stdout=subprocess.PIPE).communicate()
|
["who"], stdout=subprocess.PIPE).communicate()
|
||||||
|
Loading…
Reference in New Issue
Block a user