Skip to content

Commit

Permalink
Merge pull request #145 from Tenzer/drop-python-2.7-support
Browse files Browse the repository at this point in the history
Drop Python 2.7 support
  • Loading branch information
klattimer authored Dec 10, 2023
2 parents e6a4d94 + be5c530 commit 90d1d14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
17 changes: 3 additions & 14 deletions LGTV/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import platform
isPython311AndAbove = (int(platform.python_version_tuple()[0]) == 3 and int(platform.python_version_tuple()[1]) >= 11) or int(platform.python_version_tuple()[0]) > 3
if isPython311AndAbove:
from inspect import getfullargspec
else:
from inspect import getargspec
from inspect import getfullargspec

import json
import os
Expand All @@ -29,10 +24,7 @@ def get_commands():
text = 'commands\n'
commands = LGTVRemote.getCommands()
for c in commands:
if isPython311AndAbove:
args = getfullargspec(LGTVRemote.__dict__[c])
else:
args = getargspec(LGTVRemote.__dict__[c])
args = getfullargspec(LGTVRemote.__dict__[c])
line = ' ' + c
if len(args.args) > 2:
a = ' <' + '> <'.join(args.args[1:-1]) + '>'
Expand All @@ -42,10 +34,7 @@ def get_commands():


def parseargs(command, argv):
if isPython311AndAbove:
args = getfullargspec(LGTVRemote.__dict__[command])
else:
args = getargspec(LGTVRemote.__dict__[command])
args = getfullargspec(LGTVRemote.__dict__[command])
args = args.args[1:-1]

if len(args) != len(argv):
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Command line webOS remote for LGTVs. This tool uses a connection via websockets
* UJ701V
* [please add more!]

Tested with python 2.7 on mac/linux and works fine, your mileage may vary with windows, patches welcome.
Tested with python 3.9 on Debian Unstable.
Tested with python 3.10 on Windows 10/11
Tested with 3.10 on WSL (Ubuntu 20.04)
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Natural Language :: English',
],
)

0 comments on commit 90d1d14

Please sign in to comment.