make flashtool.pyz run again
This commit is contained in:
parent
247f96e2ba
commit
9b955d135d
Binary file not shown.
|
@ -24,16 +24,17 @@ class MyFinder(importlib.abc.MetaPathFinder):
|
||||||
self.dir=basedir
|
self.dir=basedir
|
||||||
self.debug=debug
|
self.debug=debug
|
||||||
def find_spec(self,fullname, path, target=None):
|
def find_spec(self,fullname, path, target=None):
|
||||||
|
if self.debug:
|
||||||
|
print("F:fullname=%s"%fullname)
|
||||||
if fullname == self.pkg:
|
if fullname == self.pkg:
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print("F:matching %s"%fullname)
|
print("F:matching %s(%s)"%(fullname,self.dir))
|
||||||
spec=importlib.util.spec_from_file_location(fullname, self.dir,loader=MyLoader(), submodule_search_locations=[self.dir])
|
spec=importlib.util.spec_from_file_location(fullname, self.dir,loader=MyLoader(), submodule_search_locations=[self.dir])
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print("F:injecting:",spec)
|
print("F:injecting:",spec)
|
||||||
return spec
|
return spec
|
||||||
sys.meta_path.insert(0,MyFinder('flashtool'))
|
sys.meta_path.insert(0,MyFinder('flashtool'))
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import serial
|
import serial
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -48,7 +49,10 @@ import tkinter.font as tkFont
|
||||||
import os
|
import os
|
||||||
import serial.tools.list_ports
|
import serial.tools.list_ports
|
||||||
from tkinter import filedialog as FileDialog
|
from tkinter import filedialog as FileDialog
|
||||||
from flashtool.flasher import Flasher
|
try:
|
||||||
|
from flasher import Flasher
|
||||||
|
except:
|
||||||
|
from flashtool.flasher import Flasher
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in New Issue