Package: python-pyo / 0.7-2.1

wxpython3.0.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Description: Update for wxPython 3.0
 These changes should remain compatible with wxPython 2.8.
Forwarded: no
Last-Update: 2014-09-12

Index: python-pyo-0.7/pyolib/_widgets.py
===================================================================
--- python-pyo-0.7.orig/pyolib/_widgets.py
+++ python-pyo-0.7/pyolib/_widgets.py
@@ -29,10 +29,11 @@ except:
     WITH_PIL = False
 
 try:
-    import wxversion
-    if (wxversion.checkInstalled("2.8")):
+    if 'wx' not in sys.modules:
+        # Don't try to load if already loaded.
+        import wxversion
         wxversion.ensureMinimal("2.8")
-    import wx
+        import wx
     from _wxwidgets import *
     PYO_USE_WX = True
 except:
Index: python-pyo-0.7/pyolib/_wxwidgets.py
===================================================================
--- python-pyo-0.7.orig/pyolib/_wxwidgets.py
+++ python-pyo-0.7/pyolib/_wxwidgets.py
@@ -143,8 +143,8 @@ def powOfTwoToInt(x):
     return POWOFTWO[x]
         
 def GetRoundBitmap( w, h, r ):
-    maskColor = wx.Color(0,0,0)
-    shownColor = wx.Color(5,5,5)
+    maskColor = wx.Colour(0,0,0)
+    shownColor = wx.Colour(5,5,5)
     b = wx.EmptyBitmap(w,h)
     dc = wx.MemoryDC(b)
     dc.SetBrush(wx.Brush(maskColor))
Index: python-pyo-0.7/utils/E-Pyo.py
===================================================================
--- python-pyo-0.7.orig/utils/E-Pyo.py
+++ python-pyo-0.7/utils/E-Pyo.py
@@ -2250,7 +2250,7 @@ class MainFrame(wx.Frame):
     def saveListPaste(self, evt):
         if self.pastingList != []:
             dlg = wx.FileDialog(self, message="Save file as ...", 
-                defaultDir=os.path.expanduser('~'), style=wx.SAVE)
+                defaultDir=os.path.expanduser('~'), style=wx.FD_SAVE)
             if dlg.ShowModal() == wx.ID_OK:
                 path = ensureNFD(dlg.GetPath())
                 with open(path, "w") as f:
@@ -2258,7 +2258,7 @@ class MainFrame(wx.Frame):
 
     def loadListPaste(self, evt):
         dlg = wx.FileDialog(self, message="Choose a file", 
-            defaultDir=os.path.expanduser("~"), style=wx.OPEN)
+            defaultDir=os.path.expanduser("~"), style=wx.FD_OPEN)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             self.pastingList = []
@@ -2520,7 +2520,7 @@ class MainFrame(wx.Frame):
     def insertPath(self, evt):
         dlg = wx.FileDialog(self, message="Choose a file", 
                             defaultDir=PREFERENCES.get("insert_path", os.path.expanduser("~")),
-                            defaultFile="", style=wx.OPEN | wx.MULTIPLE)
+                            defaultFile="", style=wx.FD_OPEN | wx.FD_MULTIPLE)
         if dlg.ShowModal() == wx.ID_OK:
             paths = dlg.GetPaths()
             if len(paths) == 1:
@@ -2710,7 +2710,7 @@ class MainFrame(wx.Frame):
     def open(self, event, encoding=None):
         dlg = wx.FileDialog(self, message="Choose a file", 
             defaultDir=PREFERENCES.get("open_file_path", os.path.expanduser("~")),
-            defaultFile="", style=wx.OPEN | wx.MULTIPLE)
+            defaultFile="", style=wx.FD_OPEN | wx.FD_MULTIPLE)
         if dlg.ShowModal() == wx.ID_OK:
             paths = dlg.GetPaths()
             for path in paths:
@@ -2775,7 +2775,7 @@ class MainFrame(wx.Frame):
         deffile = os.path.split(self.panel.editor.path)[1]
         dlg = wx.FileDialog(self, message="Save file as ...", 
             defaultDir=PREFERENCES.get("save_file_path", os.path.expanduser("~")),
-            defaultFile=deffile, style=wx.SAVE)
+            defaultFile=deffile, style=wx.FD_SAVE)
         dlg.SetFilterIndex(0)
         if dlg.ShowModal() == wx.ID_OK:
             path = ensureNFD(dlg.GetPath())
@@ -3594,7 +3594,7 @@ class Editor(stc.StyledTextCtrl):
                 dlg.Destroy()
                 if not self.path or "Untitled-" in self.path:
                     dlg2 = wx.FileDialog(None, message="Save file as ... (the file will be closed even if you pressed Cancel!)", defaultDir=os.getcwd(), 
-                                         defaultFile="", style=wx.SAVE|wx.FD_OVERWRITE_PROMPT)
+                                         defaultFile="", style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
                     dlg2.SetFilterIndex(0)
                     if dlg2.ShowModal() == wx.ID_OK:
                         path = dlg2.GetPath()
@@ -3618,7 +3618,7 @@ class Editor(stc.StyledTextCtrl):
                 dlg.Destroy()
                 if not self.path or "Untitled-" in self.path:
                     dlg2 = wx.FileDialog(None, message="Save file as ...", defaultDir=os.getcwd(), 
-                                         defaultFile="", style=wx.SAVE|wx.FD_OVERWRITE_PROMPT)
+                                         defaultFile="", style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
                     dlg2.SetFilterIndex(0)
                     if dlg2.ShowModal() == wx.ID_OK:
                         path = dlg2.GetPath()
@@ -3649,7 +3649,7 @@ class Editor(stc.StyledTextCtrl):
                 dlg.Destroy()
                 if not self.path or "Untitled-" in self.path:
                     dlg2 = wx.FileDialog(None, message="Save file as ...", defaultDir=os.getcwd(),
-                                         defaultFile="", style=wx.SAVE|wx.FD_OVERWRITE_PROMPT)
+                                         defaultFile="", style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
                     dlg2.SetFilterIndex(0)
 
                     if dlg2.ShowModal() == wx.ID_OK:
Index: python-pyo-0.7/utils/PyoDoc.py
===================================================================
--- python-pyo-0.7.orig/utils/PyoDoc.py
+++ python-pyo-0.7/utils/PyoDoc.py
@@ -1121,7 +1121,7 @@ def toSysEncoding(unistr):
 
 if __name__ == "__main__":
     DOC_AS_SINGLE_APP = True
-    app = wx.PySimpleApp()
+    app = wx.App(False)
     doc_frame = ManualFrame()
     doc_frame.Show()
     app.MainLoop()