mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Python 2 compatible Windows imports
This commit is contained in:
parent
c3245c1f03
commit
3e10e0e511
1 changed files with 11 additions and 3 deletions
|
@ -16,10 +16,18 @@
|
||||||
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
|
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shlex
|
|
||||||
import sys
|
import sys
|
||||||
from systray import SysTrayIcon
|
from systray import SysTrayIcon
|
||||||
import winreg
|
|
||||||
|
try:
|
||||||
|
from shlex import quote as cmd_quote
|
||||||
|
except ImportError:
|
||||||
|
from pipes import quote as cmd_quote
|
||||||
|
|
||||||
|
try:
|
||||||
|
import winreg
|
||||||
|
except ImportError:
|
||||||
|
import _winreg as winreg
|
||||||
|
|
||||||
import plexpy
|
import plexpy
|
||||||
if plexpy.PYTHON2:
|
if plexpy.PYTHON2:
|
||||||
|
@ -127,7 +135,7 @@ def set_startup():
|
||||||
else:
|
else:
|
||||||
args = [exe, plexpy.FULL_PATH]
|
args = [exe, plexpy.FULL_PATH]
|
||||||
|
|
||||||
cmd = ' '.join(shlex.quote(arg) for arg in args).replace('python.exe', 'pythonw.exe').replace("'", '"')
|
cmd = ' '.join(cmd_quote(arg) for arg in args).replace('python.exe', 'pythonw.exe').replace("'", '"')
|
||||||
|
|
||||||
if plexpy.CONFIG.LAUNCH_STARTUP:
|
if plexpy.CONFIG.LAUNCH_STARTUP:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue