Skip to content

Commit

Permalink
removed add_to_path option, resolves NiklasRosenstein#23
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Jul 27, 2015
1 parent d8800d6 commit 20b9f71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion myo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

__author__ = 'Niklas Rosenstein <[email protected]>'
__version__ = '0.2.0'
__version__ = '0.2.1-dev'
__license__ = 'MIT'

from .lowlevel import enums
Expand Down
17 changes: 4 additions & 13 deletions myo/lowlevel/ctyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,21 @@ def __nonzero__(self):
__bool__ = __nonzero__ # Python 3
initialized = __nonzero__

def init(self, dist_path=None, add_to_path=True):
def init(self, dist_path=None):
"""
Initializes the :class:`MyoLibrary` by detecting the name
of the library to load with :mod:`ctypes` based on the
current platform.
:param dist_path: If specified, must point to the directory
where the Myo shared library is located.
:param add_to_path: If specified, the *dist_path* is
added to ``PATH`` instead of it being loaded with
an absolute filename.
:raise RuntimeError: If the library is already initialized.
:raise EnvironmentError: If the current platform is not
supported. Usually raised already by
:mod:`myo.utils.platform`.
:raise OSError: If the library could not be loaded.
*Changed in 0.2.1* - Removed ``add_to_path`` parameter.
"""

if self._lib is not None:
Expand Down Expand Up @@ -113,15 +112,7 @@ def init(self, dist_path=None, add_to_path=True):
# is specified.
if dist_path:
dist_path = os.path.normpath(os.path.abspath(dist_path))

# Extend the PATH variable if that is desired.
if add_to_path:
PATH = os.environ['PATH']
os.environ['PATH'] = os.pathsep.join([dist_path, PATH])

# Or create an absolute filename.
else:
lib_name = os.path.join(dist_path, lib_name)
lib_name = os.path.join(dist_path, lib_name)

# Load the library. Could raise OSError.
self._lib = ctypes.cdll.LoadLibrary(lib_name)
Expand Down

0 comments on commit 20b9f71

Please sign in to comment.