Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #231: USE_AUTOCONNECT set to True in WSL due to string comparison error #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions rshell/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
#
# When running under WSL, sys.platform returns 'linux' so we do a further check
# on 'Microsoft' in platform.uname().release to detect if we're running under WSL.
# Currently, there is no serial port enumeration availbale under WSL.
# Currently, there is no serial port enumeration available under WSL.
import platform
USE_AUTOCONNECT = sys.platform == 'linux' and 'Microsoft' not in platform.uname().release
USE_AUTOCONNECT = sys.platform == 'linux' and 'microsoft' not in platform.uname().release.lower()

SIX_MONTHS = 183 * 24 * 60 * 60

Expand Down Expand Up @@ -348,7 +348,7 @@ def autoscan():


def extra_info(port):
"""Collects the serial nunber and manufacturer into a string, if
"""Collects the serial number and manufacturer into a string, if
the fields are available."""
extra_items = []
if port.manufacturer:
Expand Down Expand Up @@ -847,7 +847,7 @@ def add_suffix_if_dir(filename):
if (os.stat(filename)[0] & 0x4000) != 0:
return filename + '/'
except FileNotFoundError:
# This can happen when a symlink points to a non-existant file.
# This can happen when a symlink points to a non-existent file.
pass
return filename
if not os.path.isdir(dirname):
Expand Down Expand Up @@ -1418,7 +1418,7 @@ def add_arg(*args, **kwargs):


def connect(port, baud=115200, user='micro', password='python', wait=0):
"""Tries to connect automagically via network or serial."""
"""Tries to connect automatically via network or serial."""
if '/' in port:
connect_serial(port, baud=baud, wait=wait)
else:
Expand Down Expand Up @@ -2683,7 +2683,7 @@ def do_mkdir(self, line):
print_err('Unable to create %s' % filename)

def repl_serial_to_stdout(self, dev):
"""Runs as a thread which has a sole purpose of readding bytes from
"""Runs as a thread which has a sole purpose of reading bytes from
the serial port and writing them to stdout. Used by do_repl.
"""
with self.serial_reader_running:
Expand Down