Python 3 updates

This commit is contained in:
Elite-IGAU 2020-02-09 11:44:48 -07:00
parent d8c9ff0c81
commit 70e28aa9a7
6 changed files with 50 additions and 16 deletions

View File

@ -1,14 +1,27 @@
#!/usr/bin/env python2
import threading
import Queue
import json
import os
import requests
import traceback
from Tkinter import *
from time import sleep
from PlaceHolder import PlaceHolder
import sys
try:
# Python 2
from Tkinter import *
import ttk
except ModuleNotFoundError:
# Python 3
import tkinter as tk
from tkinter import *
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
class AutoCompleter(Entry, PlaceHolder):
def __init__(self, parent, placeholder, **kw):

View File

@ -1,5 +1,11 @@
from config import config
from Tkinter import END
try:
# Python 2
from Tkinter import END
except ModuleNotFoundError:
# Python 3
import tkinter as tk
from tkinter import *
class PlaceHolder():
def __init__(self, placeholder, **kw):

View File

@ -1,8 +1,13 @@
#!/usr/bin/env python2
from Tkinter import *
from PlaceHolder import PlaceHolder
try:
# Python 2
from Tkinter import *
except ModuleNotFoundError:
# Python 3
import tkinter as tk
from tkinter import *
class PlaceHolderEntry(Entry, PlaceHolder):
def __init__(self, parent, placeholder, **kw):
Entry.__init__(self, parent, **kw)

View File

@ -1,5 +1,3 @@
#! /usr/bin/env python2
import os
import sys
import traceback
@ -9,15 +7,25 @@ import webbrowser
import json
import re
import requests
import Tkinter as tk
import tkFileDialog as filedialog
import tkMessageBox as confirmDialog
from time import sleep
from monitor import monitor
from . import AutoCompleter
from . import PlaceHolderEntry
from .updater import SpanshUpdater
try:
# Python 2
from Tkinter import *
import tkFileDialog as filedialog
import tkMessageBox as confirmDialog
import ttk
except ModuleNotFoundError:
# Python 3
import tkinter as tk
from tkinter import *
import tkinter.filedialog as filedialog
import tkinter.messagebox as confirmDialog
class SpanshRouter():
def __init__(self, plugin_dir):
version_file = os.path.join(plugin_dir, "version.json")

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python2
import os
import requests
import zipfile

View File

@ -2,12 +2,16 @@ from SpanshRouter import SpanshRouter
spansh_router = None
def plugin_start(plugin_dir):
def plugin_start3(plugin_dir):
return plugin_start()
def plugin_start():
# Check for newer versions
global spansh_router
spansh_router = SpanshRouter(plugin_dir)
spansh_router.check_for_update()
spansh_router.open_last_route()
return 'spansh_router'
def plugin_stop():
global spansh_router