File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535qt_version_info = (5 , 4 , 0 )
3636qt_version = "%s.%s.%s" % qt_version_info
3737__qt_version__ = qt_version
38-
39-
40- def __createqtconf ():
41- """Create a qt.conf file next to the current executable"""
42-
43- template = """[Paths]
44- Prefix = {path}
45- Binaries = {path}
46- """
47-
48- exedir = os .path .dirname (sys .executable )
49- qtpath = os .path .join (exedir , "qt.conf" )
50- binpath = os .path .dirname (__file__ ).replace ("\\ " , "/" )
51-
52- if not os .path .exists (qtpath ):
53- try :
54- with open (qtpath , "w" ) as f :
55- f .write (template .format (path = binpath ))
56- except Exception as e :
57- sys .stderr .write ("Could not write qt.conf: %s" % e )
58-
59- __createqtconf ()
Original file line number Diff line number Diff line change @@ -46,6 +46,27 @@ def get_readme():
4646 return readme
4747
4848
49+ def createqtconf ():
50+ """Create a qt.conf file next to the current executable"""
51+
52+ template = """[Paths]
53+ Prefix = {path}
54+ Binaries = {path}
55+ """
56+
57+ import PyQt5
58+
59+ exedir = os .path .dirname (sys .executable )
60+ qtpath = os .path .join (exedir , "qt.conf" )
61+ binpath = os .path .dirname (PyQt5 .__file__ ).replace ("\\ " , "/" )
62+
63+ try :
64+ with open (qtpath , "w" ) as f :
65+ f .write (template .format (path = binpath ))
66+ except :
67+ pass
68+
69+
4970classifiers = [
5071 'Development Status :: 4 - Beta' ,
5172 'Intended Audience :: Developers' ,
@@ -73,3 +94,6 @@ def get_readme():
7394 package_data = get_package_data (),
7495 data_files = get_data_files ()
7596)
97+
98+ # Attempt to automatically create a qt.conf
99+ createqtconf ()
You can’t perform that action at this time.
0 commit comments