File tree Expand file tree Collapse file tree 2 files changed +24
-22
lines changed Expand file tree Collapse file tree 2 files changed +24
-22
lines changed Original file line number Diff line number Diff line change 35
35
qt_version_info = (5 , 4 , 0 )
36
36
qt_version = "%s.%s.%s" % qt_version_info
37
37
__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():
46
46
return readme
47
47
48
48
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
+
49
70
classifiers = [
50
71
'Development Status :: 4 - Beta' ,
51
72
'Intended Audience :: Developers' ,
@@ -73,3 +94,6 @@ def get_readme():
73
94
package_data = get_package_data (),
74
95
data_files = get_data_files ()
75
96
)
97
+
98
+ # Attempt to automatically create a qt.conf
99
+ createqtconf ()
You can’t perform that action at this time.
0 commit comments