Skip to content

Commit

Permalink
WIP: preliminary Haiku port
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuman committed Feb 13, 2020
1 parent cdb2018 commit 8361e40
Show file tree
Hide file tree
Showing 6 changed files with 1,311 additions and 3 deletions.
5 changes: 5 additions & 0 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- NetBSD
- Sun Solaris
- AIX
- Haiku
Works with Python versions from 2.6 to 3.4+.
"""
Expand Down Expand Up @@ -84,6 +85,7 @@
from ._common import AIX
from ._common import BSD
from ._common import FREEBSD # NOQA
from ._common import HAIKU
from ._common import LINUX
from ._common import MACOS
from ._common import NETBSD # NOQA
Expand Down Expand Up @@ -179,6 +181,9 @@
# via sys.modules.
PROCFS_PATH = "/proc"

elif HAIKU:
from . import _pshaiku as _psplatform

else: # pragma: no cover
raise NotImplementedError('platform %s is not supported' % sys.platform)

Expand Down
5 changes: 3 additions & 2 deletions psutil/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

__all__ = [
# constants
'FREEBSD', 'BSD', 'LINUX', 'NETBSD', 'OPENBSD', 'MACOS', 'OSX', 'POSIX',
'SUNOS', 'WINDOWS',
'FREEBSD', 'BSD', 'HAIKU', 'LINUX', 'NETBSD', 'OPENBSD', 'MACOS', 'OSX',
'POSIX', 'SUNOS', 'WINDOWS',
'ENCODING', 'ENCODING_ERRS', 'AF_INET6',
# connection constants
'CONN_CLOSE', 'CONN_CLOSE_WAIT', 'CONN_CLOSING', 'CONN_ESTABLISHED',
Expand Down Expand Up @@ -86,6 +86,7 @@
BSD = FREEBSD or OPENBSD or NETBSD
SUNOS = sys.platform.startswith(("sunos", "solaris"))
AIX = sys.platform.startswith("aix")
HAIKU = sys.platform.startswith("haiku")


# ===================================================================
Expand Down
Loading

0 comments on commit 8361e40

Please sign in to comment.