Skip to content

Commit

Permalink
make key.py reflect key from __init__
Browse files Browse the repository at this point in the history
Fixes #107
  • Loading branch information
Cube707 committed Mar 15, 2024
1 parent 6ae17c2 commit 38ec8f4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions readchar/key.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# flake8: noqa E401,E403
# this file exists only for backwards compatibility
# it allows the use of `import readchar.key`
import sys

from . import platform
from . import key as __key


if platform.startswith(("linux", "darwin", "freebsd")):
from ._posix_key import *
elif platform in ("win32", "cygwin"):
from ._win_key import *
else:
raise NotImplementedError(f"The platform {platform} is not supported yet")
for __k, __v in vars(__key).items():
if not __k.startswith("__"):
setattr(sys.modules[__name__], __k, __v)

0 comments on commit 38ec8f4

Please sign in to comment.