Merge lp:~muktupavels/compiz/pygobject-warnings into lp:compiz/0.9.13
- pygobject-warnings
- Merge into 0.9.13
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Dmitry Shachnev |
Approved revision: | 4203 |
Merged at revision: | 4204 |
Proposed branch: | lp:~muktupavels/compiz/pygobject-warnings |
Merge into: | lp:compiz/0.9.13 |
Diff against target: |
525 lines (+68/-71) 4 files modified
compizconfig/ccsm/ccm/Pages.py (+35/-38) compizconfig/ccsm/ccm/Settings.py (+15/-15) compizconfig/ccsm/ccm/Utils.py (+1/-1) compizconfig/ccsm/ccm/Widgets.py (+17/-17) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/pygobject-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dmitry Shachnev | Approve | ||
Review via email: mp+362818@code.launchpad.net |
Commit message
Fix many PyGTKDeprecatio
Description of the change
To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote : | # |
Updated.
- 4203. By Alberts Muktupāvels
-
Fix many PyGTKDeprecatio
nWarning warnings.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'compizconfig/ccsm/ccm/Pages.py' |
2 | --- compizconfig/ccsm/ccm/Pages.py 2019-02-05 20:07:10 +0000 |
3 | +++ compizconfig/ccsm/ccm/Pages.py 2019-02-07 14:21:30 +0000 |
4 | @@ -69,7 +69,7 @@ |
5 | def __init__(self, plugin): |
6 | GenericPage.__init__(self) |
7 | self.Plugin = plugin |
8 | - self.LeftWidget = Gtk.VBox(False, 10) |
9 | + self.LeftWidget = Gtk.VBox(homogeneous=False, spacing=10) |
10 | self.LeftWidget.set_border_width(10) |
11 | |
12 | pluginLabel = Label() |
13 | @@ -113,7 +113,7 @@ |
14 | else: |
15 | self.FilterEntry.set_tooltip_text(_("Search Compiz Core Options")) |
16 | |
17 | - backButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
18 | + backButton = Gtk.Button(label=Gtk.STOCK_GO_BACK) |
19 | backButton.set_use_stock(True) |
20 | self.LeftWidget.pack_end(backButton, False, False, 0) |
21 | backButton.connect('clicked', self.GoBack) |
22 | @@ -127,7 +127,7 @@ |
23 | groupPage = GroupPage(name, group) |
24 | groupPage.Wrap() |
25 | if not groupPage.Empty: |
26 | - self.RightWidget.append_page(groupPage.Scroll, Gtk.Label(name)) |
27 | + self.RightWidget.append_page(groupPage.Scroll, Gtk.Label(label=name)) |
28 | self.Pages.append(groupPage) |
29 | |
30 | self.RightWidget.connect('size-allocate', self.ResetFocus) |
31 | @@ -164,7 +164,7 @@ |
32 | |
33 | if self.NotFoundBox is None: |
34 | self.NotFoundBox = NotFoundBox(text) |
35 | - self.RightWidget.append_page(self.NotFoundBox, Gtk.Label(_("Error"))) |
36 | + self.RightWidget.append_page(self.NotFoundBox, Gtk.Label(label=_("Error"))) |
37 | else: |
38 | self.NotFoundBox.update(text) |
39 | |
40 | @@ -190,7 +190,7 @@ |
41 | if page.Filter(text): |
42 | empty = False |
43 | if num < 0: |
44 | - self.RightWidget.insert_page(page.Scroll, Gtk.Label(page.Name), self.GetPageSpot(page)) |
45 | + self.RightWidget.insert_page(page.Scroll, Gtk.Label(label=page.Name), self.GetPageSpot(page)) |
46 | else: |
47 | if num >= 0: |
48 | self.RightWidget.remove_page(num) |
49 | @@ -247,7 +247,7 @@ |
50 | def __init__(self, context): |
51 | GenericPage.__init__(self) |
52 | self.Context = context |
53 | - self.LeftWidget = Gtk.VBox(False, 10) |
54 | + self.LeftWidget = Gtk.VBox(homogeneous=False, spacing=10) |
55 | self.LeftWidget.set_border_width(10) |
56 | self.RightWidget = Gtk.Notebook() |
57 | self.RightChild = Gtk.VBox() |
58 | @@ -277,23 +277,23 @@ |
59 | self.LeftWidget.pack_start(filterSearchLabel, False, False, 0) |
60 | |
61 | # Options |
62 | - self.FilterNameCheck = check = Gtk.CheckButton(_("Short description and name")) |
63 | + self.FilterNameCheck = check = Gtk.CheckButton(label=_("Short description and name")) |
64 | check.set_active(True) |
65 | check.connect("toggled", self.LevelChanged, FilterName) |
66 | self.LeftWidget.pack_start(check, False, False, 0) |
67 | |
68 | - self.FilterLongDescCheck = check = Gtk.CheckButton(_("Long description")) |
69 | + self.FilterLongDescCheck = check = Gtk.CheckButton(label=_("Long description")) |
70 | check.set_active(True) |
71 | check.connect("toggled", self.LevelChanged, FilterLongDesc) |
72 | self.LeftWidget.pack_start(check, False, False, 0) |
73 | |
74 | - self.FilterValueCheck = check = Gtk.CheckButton(_("Settings value")) |
75 | + self.FilterValueCheck = check = Gtk.CheckButton(label=_("Settings value")) |
76 | check.set_active(False) |
77 | check.connect("toggled", self.LevelChanged, FilterValue) |
78 | self.LeftWidget.pack_start(check, False, False, 0) |
79 | |
80 | # Back Button |
81 | - self.BackButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
82 | + self.BackButton = Gtk.Button(label=Gtk.STOCK_GO_BACK) |
83 | self.BackButton.set_use_stock(True) |
84 | self.BackButton.connect('clicked', self.GoBack) |
85 | self.LeftWidget.pack_end(self.BackButton, False, False, 0) |
86 | @@ -370,7 +370,7 @@ |
87 | GlobalUpdater.Block += 1 |
88 | |
89 | # Notebook |
90 | - self.NotebookLabel = Gtk.Label(_("Settings")) |
91 | + self.NotebookLabel = Gtk.Label(label=_("Settings")) |
92 | self.NotebookChild = Gtk.EventBox() |
93 | self.NotebookChild.add(self.RightChild) |
94 | self.RightWidget.append_page(self.NotebookChild, self.NotebookLabel) |
95 | @@ -714,13 +714,13 @@ |
96 | profileLabel.connect("style-set", self.HeaderStyleSet) |
97 | self.ProfileImportExportBox = Gtk.HBox() |
98 | self.ProfileImportExportBox.set_spacing(5) |
99 | - profileImportButton = Gtk.Button(_("Import")) |
100 | + profileImportButton = Gtk.Button(label=_("Import")) |
101 | profileImportButton.set_tooltip_text(_("Import a CompizConfig Profile")) |
102 | - profileImportAsButton = Gtk.Button(_("Import as...")) |
103 | + profileImportAsButton = Gtk.Button(label=_("Import as...")) |
104 | profileImportAsButton.set_tooltip_text(_("Import a CompizConfig Profile as a new profile")) |
105 | - profileExportButton = Gtk.Button(_("Export")) |
106 | + profileExportButton = Gtk.Button(label=_("Export")) |
107 | profileExportButton.set_tooltip_text(_("Export your CompizConfig Profile")) |
108 | - profileResetButton = Gtk.Button(_("Reset to defaults")) |
109 | + profileResetButton = Gtk.Button(label=_("Reset to defaults")) |
110 | profileResetButton.set_tooltip_text(_("Reset your CompizConfig Profile to the global defaults")) |
111 | profileResetButton.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_CLEAR, Gtk.IconSize.BUTTON)) |
112 | profileImportButton.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_OPEN, Gtk.IconSize.BUTTON)) |
113 | @@ -758,7 +758,7 @@ |
114 | integrationLabel = Label() |
115 | integrationLabel.set_markup(HeaderMarkup % (_("Integration"))) |
116 | integrationLabel.connect("style-set", self.HeaderStyleSet) |
117 | - self.IntegrationButton = Gtk.CheckButton(_("Enable integration into the desktop environment")) |
118 | + self.IntegrationButton = Gtk.CheckButton(label=_("Enable integration into the desktop environment")) |
119 | self.IntegrationButton.set_active(self.Context.Integration) |
120 | self.IntegrationButton.set_sensitive(self.Context.CurrentBackend.IntegrationSupport) |
121 | self.IntegrationButton.connect("toggled", self.IntegrationChanged) |
122 | @@ -848,8 +848,8 @@ |
123 | |
124 | def ExportProfile(self, widget): |
125 | main = widget.get_toplevel() |
126 | - b = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.OK) |
127 | - chooser = Gtk.FileChooserDialog(title=_("Save file.."), parent=main, buttons=b, action=Gtk.FileChooserAction.SAVE) |
128 | + chooser = Gtk.FileChooserDialog(title=_("Save file.."), transient_for=main, action=Gtk.FileChooserAction.SAVE) |
129 | + chooser.add_buttons(_("Cancel"), Gtk.ResponseType.CANCEL, _("Save"), Gtk.ResponseType.OK) |
130 | chooser.set_current_folder(os.environ.get("HOME")) |
131 | self.CreateFilter(chooser) |
132 | ret = chooser.run() |
133 | @@ -866,10 +866,8 @@ |
134 | self.Context.Export(path, ret == Gtk.ResponseType.YES) |
135 | |
136 | def ImportProfileDialog (self, main): |
137 | - b = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, |
138 | - Gtk.STOCK_OPEN, Gtk.ResponseType.OK) |
139 | - chooser = Gtk.FileChooserDialog (title = _("Open file.."), |
140 | - parent = main, buttons = b) |
141 | + chooser = Gtk.FileChooserDialog(title=_("Open file.."), transient_for=main) |
142 | + chooser.add_buttons(_("Cancel"), Gtk.ResponseType.CANCEL, _("Open"), Gtk.ResponseType.OK) |
143 | chooser.set_current_folder (os.environ.get ("HOME")) |
144 | self.CreateFilter (chooser) |
145 | ret = chooser.run () |
146 | @@ -881,13 +879,12 @@ |
147 | return None |
148 | |
149 | def ProfileNameDialog (self, main): |
150 | - dlg = Gtk.Dialog (_("Enter a profile name"), main, |
151 | - Gtk.DialogFlags.MODAL) |
152 | + dlg = Gtk.Dialog(title=_("Enter a profile name"), transient_for=main, modal=True) |
153 | dlg.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) |
154 | dlg.add_button (Gtk.STOCK_ADD, Gtk.ResponseType.OK) |
155 | |
156 | entry = Gtk.Entry () |
157 | - label = Gtk.Label (_("Please enter a name for the new profile:")) |
158 | + label = Gtk.Label(label=_("Please enter a name for the new profile:")) |
159 | dlg.vbox.pack_start (label, False, False, 5) |
160 | dlg.vbox.pack_start (entry, False, False, 5) |
161 | |
162 | @@ -966,7 +963,7 @@ |
163 | rightChild.set_border_width(10) |
164 | |
165 | # Auto sort |
166 | - autoSort = Gtk.CheckButton(_("Automatic plugin sorting")) |
167 | + autoSort = Gtk.CheckButton(label=_("Automatic plugin sorting")) |
168 | rightChild.pack_start(autoSort, False, False, 10) |
169 | |
170 | # Lists |
171 | @@ -1004,15 +1001,15 @@ |
172 | enabledButtonBox.set_spacing(5) |
173 | enabledAlignment.add(enabledButtonBox) |
174 | |
175 | - upButton = Gtk.Button(Gtk.STOCK_GO_UP) |
176 | - downButton = Gtk.Button(Gtk.STOCK_GO_DOWN) |
177 | + upButton = Gtk.Button(label=Gtk.STOCK_GO_UP) |
178 | + downButton = Gtk.Button(label=Gtk.STOCK_GO_DOWN) |
179 | upButton.set_use_stock(True) |
180 | downButton.set_use_stock(True) |
181 | upButton.connect('clicked', self.EnabledPluginsList.move_up) |
182 | downButton.connect('clicked', self.EnabledPluginsList.move_down) |
183 | |
184 | # Add buttons |
185 | - addButton = Gtk.Button(Gtk.STOCK_ADD) |
186 | + addButton = Gtk.Button(label=Gtk.STOCK_ADD) |
187 | addButton.set_use_stock(True) |
188 | addButton.connect('clicked', self.AddPlugin) |
189 | |
190 | @@ -1049,7 +1046,7 @@ |
191 | |
192 | autoSort = widget.get_active() |
193 | if not autoSort: |
194 | - dlg = Gtk.MessageDialog(type=Gtk.MessageType.WARNING, buttons=Gtk.ButtonsType.YES_NO) |
195 | + dlg = Gtk.MessageDialog(message_type=Gtk.MessageType.WARNING, buttons=Gtk.ButtonsType.YES_NO) |
196 | dlg.set_markup(_("Do you really want to disable automatic plugin sorting? This will also disable conflict handling. You should only do this if you know what you are doing.")) |
197 | response = dlg.run() |
198 | dlg.destroy() |
199 | @@ -1090,7 +1087,7 @@ |
200 | dlg.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK).grab_default() |
201 | dlg.set_default_response(Gtk.ResponseType.OK) |
202 | |
203 | - label = Gtk.Label(_("Plugin name:")) |
204 | + label = Gtk.Label(label=_("Plugin name:")) |
205 | label.set_tooltip_text(_("Insert plugin name")) |
206 | dlg.vbox.pack_start(label, True, True, 0) |
207 | |
208 | @@ -1132,7 +1129,7 @@ |
209 | def __init__(self, context): |
210 | GenericPage.__init__(self) |
211 | self.Context = context |
212 | - self.LeftWidget = Gtk.VBox(False, 10) |
213 | + self.LeftWidget = Gtk.VBox(homogeneous=False, spacing=10) |
214 | self.LeftWidget.set_border_width(10) |
215 | self.RightWidget = Gtk.Notebook() |
216 | |
217 | @@ -1170,18 +1167,18 @@ |
218 | self.LeftWidget.pack_start(aboutBin, False, False, 0) |
219 | |
220 | # Back Button |
221 | - backButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
222 | + backButton = Gtk.Button(label=Gtk.STOCK_GO_BACK) |
223 | backButton.set_use_stock(True) |
224 | backButton.connect('clicked', self.GoBack) |
225 | self.LeftWidget.pack_end(backButton, False, False, 0) |
226 | |
227 | # Profile & Backend Page |
228 | self.ProfileBackendPage = ProfileBackendPage(context) |
229 | - self.RightWidget.append_page(self.ProfileBackendPage.Widget, Gtk.Label(_("Profile & Backend"))) |
230 | + self.RightWidget.append_page(self.ProfileBackendPage.Widget, Gtk.Label(label=_("Profile & Backend"))) |
231 | |
232 | # Plugin List |
233 | self.PluginListPage = PluginListPage(context) |
234 | - self.RightWidget.append_page(self.PluginListPage.Widget, Gtk.Label(_("Plugin List"))) |
235 | + self.RightWidget.append_page(self.PluginListPage.Widget, Gtk.Label(label=_("Plugin List"))) |
236 | |
237 | StyleBlock = 0 |
238 | |
239 | @@ -1207,7 +1204,7 @@ |
240 | def __init__(self, main, context): |
241 | self.Context = context |
242 | self.Main = main |
243 | - sidebar = Gtk.VBox(False, 10) |
244 | + sidebar = Gtk.VBox(homogeneous=False, spacing=10) |
245 | sidebar.set_border_width(10) |
246 | pluginWindow = PluginWindow(self.Context) |
247 | pluginWindow.connect('show-plugin', self.ShowPlugin) |
248 | @@ -1266,7 +1263,7 @@ |
249 | categoryLabel.connect("style-set", self.HeaderStyleSet) |
250 | |
251 | # Exit Button |
252 | - exitButton = Gtk.Button(Gtk.STOCK_CLOSE) |
253 | + exitButton = Gtk.Button(label=Gtk.STOCK_CLOSE) |
254 | exitButton.set_use_stock(True) |
255 | exitButton.connect('clicked', self.Main.Quit) |
256 | |
257 | @@ -1386,7 +1383,7 @@ |
258 | self.VisibleAreas = self.subGroupAreas = [] |
259 | self.Label = Gtk.Alignment(xalign=0.0, yalign=0.5) |
260 | self.Label.set_padding(4, 4, 4, 4) |
261 | - label = Gtk.Label("<b>%s</b>" %(protect_pango_markup(name or _('General')))) |
262 | + label = Gtk.Label(label="<b>%s</b>" % (protect_pango_markup(name or _('General')))) |
263 | label.set_use_markup(True) |
264 | label.set_xalign(0.0) |
265 | self.Label.add(label) |
266 | |
267 | === modified file 'compizconfig/ccsm/ccm/Settings.py' |
268 | --- compizconfig/ccsm/ccm/Settings.py 2019-02-04 18:40:52 +0000 |
269 | +++ compizconfig/ccsm/ccm/Settings.py 2019-02-07 14:21:30 +0000 |
270 | @@ -439,7 +439,7 @@ |
271 | self.Inc = info[2] |
272 | inc = self.Inc |
273 | self.NoneValue = info[0] |
274 | - self.Adj = Gtk.Adjustment(0, info[0], info[1], inc, inc*10) |
275 | + self.Adj = Gtk.Adjustment(value=0, lower=info[0], upper=info[1], step_increment=inc, page_increment=inc*10) |
276 | self.Spin = Gtk.SpinButton(adjustment=self.Adj) |
277 | self.Spin.set_value(self.Get()) |
278 | self.Spin.connect("value-changed", self.Changed) |
279 | @@ -517,7 +517,7 @@ |
280 | types, cols = self.ListInfo() |
281 | self.Types = types |
282 | self.Store = Gtk.ListStore(*types) |
283 | - self.View = Gtk.TreeView(self.Store) |
284 | + self.View = Gtk.TreeView(model=self.Store) |
285 | self.View.set_headers_visible(True) |
286 | |
287 | for widget in self.Widgets: |
288 | @@ -540,7 +540,7 @@ |
289 | self.Scroll.add(self.View) |
290 | self.Widget.pack_start(self.Scroll, True, True, 0) |
291 | self.Widget.set_child_packing(self.Scroll, True, True, 0, Gtk.PackType.START) |
292 | - buttonBox = Gtk.HBox(False) |
293 | + buttonBox = Gtk.HBox(homogeneous=False) |
294 | buttonBox.set_spacing(5) |
295 | buttonBox.set_border_width(5) |
296 | self.Widget.pack_start(buttonBox, False, False, 0) |
297 | @@ -551,7 +551,7 @@ |
298 | (Gtk.STOCK_GO_DOWN, self.Move, 'down', False),) |
299 | self.Buttons = {} |
300 | for stock, callback, data, sensitive in buttonTypes: |
301 | - b = Gtk.Button(stock) |
302 | + b = Gtk.Button(label=stock) |
303 | b.set_use_stock(True) |
304 | buttonBox.pack_start(b, False, False, 0) |
305 | if data is not None: |
306 | @@ -627,7 +627,7 @@ |
307 | self._Delete(row) |
308 | |
309 | def _MakeEditDialog(self): |
310 | - dlg = Gtk.Dialog(_("Edit")) |
311 | + dlg = Gtk.Dialog(title=_("Edit")) |
312 | vbox = Gtk.VBox(spacing=TableX) |
313 | vbox.props.border_width = 6 |
314 | dlg.vbox.pack_start(vbox, True, True, 0) |
315 | @@ -635,7 +635,7 @@ |
316 | dlg.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) |
317 | dlg.set_default_response(Gtk.ResponseType.CLOSE) |
318 | |
319 | - group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL) |
320 | + group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL) |
321 | for widget in self.Widgets: |
322 | vbox.pack_start(widget.EBox, False, False, 0) |
323 | group.add_widget(widget.Label) |
324 | @@ -791,7 +791,7 @@ |
325 | sortedItems = sorted(self.Setting.Info[1][2].items(), key=EnumSettingKeyFunc) |
326 | self.minVal = sortedItems[0][1] |
327 | for key, value in sortedItems: |
328 | - box = Gtk.CheckButton(key) |
329 | + box = Gtk.CheckButton(label=key) |
330 | self.Checks.append((key, box)) |
331 | table.attach(box, col, col+1, row, row+1, TableDef, TableDef, TableX, TableX) |
332 | box.connect('toggled', self.Changed) |
333 | @@ -842,7 +842,7 @@ |
334 | self.ItemsByValue = info[1] |
335 | sortedItems = info[2] |
336 | for key, value in sortedItems: |
337 | - box = Gtk.CheckButton(key) |
338 | + box = Gtk.CheckButton(label=key) |
339 | self.Checks.append((key, box)) |
340 | table.attach(box, col, col+1, row, row+1, TableDef, TableDef, TableX, TableX) |
341 | box.connect('toggled', self.Changed) |
342 | @@ -905,7 +905,7 @@ |
343 | |
344 | |
345 | def RunEditDialog (self, widget): |
346 | - dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
347 | + dlg = Gtk.Dialog(title=_("Edit %s") % self.Setting.ShortDesc) |
348 | dlg.set_position (Gtk.WindowPosition.CENTER_ON_PARENT) |
349 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
350 | dlg.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) |
351 | @@ -1021,7 +1021,7 @@ |
352 | new = current.replace ("%s_R" % modifier, "") |
353 | label.set_text (self.GetLabelText (new)) |
354 | |
355 | - dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
356 | + dlg = Gtk.Dialog(title=_("Edit %s") % self.Setting.ShortDesc) |
357 | dlg.set_position (Gtk.WindowPosition.CENTER_ALWAYS) |
358 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
359 | dlg.set_icon (self.Widget.get_toplevel ().get_icon ()) |
360 | @@ -1036,7 +1036,7 @@ |
361 | alignment.add (mainBox) |
362 | dlg.vbox.pack_start (alignment, True, True, 0) |
363 | |
364 | - checkButton = Gtk.CheckButton (_("Enabled")) |
365 | + checkButton = Gtk.CheckButton(label=_("Enabled")) |
366 | active = len (self.current) \ |
367 | and self.current.lower () not in ("disabled", "none") |
368 | checkButton.set_active (active) |
369 | @@ -1064,7 +1064,7 @@ |
370 | grabber.set_tooltip_text (self.Setting.LongDesc) |
371 | box.pack_start (grabber, True, True, 0) |
372 | |
373 | - label = Gtk.Label (self.current) |
374 | + label = Gtk.Label(label=self.current) |
375 | label.set_tooltip_text (self.Setting.LongDesc) |
376 | alignment = Gtk.Alignment (xalign=0.5, yalign=0.5) |
377 | alignment.set_padding (15, 0, 0, 0) |
378 | @@ -1174,7 +1174,7 @@ |
379 | else: |
380 | box.hide () |
381 | dialog.resize (1, 1) |
382 | - dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
383 | + dlg = Gtk.Dialog(title=_("Edit %s") % self.Setting.ShortDesc) |
384 | dlg.set_position (Gtk.WindowPosition.CENTER_ALWAYS) |
385 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
386 | dlg.set_modal (True) |
387 | @@ -1188,7 +1188,7 @@ |
388 | alignment.add (mainBox) |
389 | dlg.vbox.pack_start (alignment, True, True, 0) |
390 | |
391 | - checkButton = Gtk.CheckButton (_("Enabled")) |
392 | + checkButton = Gtk.CheckButton(label=_("Enabled")) |
393 | active = len (self.current) \ |
394 | and self.current.lower () not in ("disabled", "none") |
395 | checkButton.set_active (active) |
396 | @@ -1347,7 +1347,7 @@ |
397 | self.Button.set_label (label) |
398 | |
399 | def RunEdgeSelector (self, widget): |
400 | - dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
401 | + dlg = Gtk.Dialog(title=_("Edit %s") % self.Setting.ShortDesc) |
402 | dlg.set_position (Gtk.WindowPosition.CENTER_ON_PARENT) |
403 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
404 | dlg.set_modal (True) |
405 | |
406 | === modified file 'compizconfig/ccsm/ccm/Utils.py' |
407 | --- compizconfig/ccsm/ccm/Utils.py 2019-02-05 20:07:10 +0000 |
408 | +++ compizconfig/ccsm/ccm/Utils.py 2019-02-07 14:21:30 +0000 |
409 | @@ -173,7 +173,7 @@ |
410 | |
411 | class Label(Gtk.Label): |
412 | def __init__(self, value = "", wrap = 160): |
413 | - Gtk.Label.__init__(self, value) |
414 | + Gtk.Label.__init__(self, label=value) |
415 | self.props.xalign = 0 |
416 | self.props.wrap_mode = Gtk.WrapMode.WORD |
417 | self.props.max_width_chars = 20; |
418 | |
419 | === modified file 'compizconfig/ccsm/ccm/Widgets.py' |
420 | --- compizconfig/ccsm/ccm/Widgets.py 2019-02-05 20:07:10 +0000 |
421 | +++ compizconfig/ccsm/ccm/Widgets.py 2019-02-07 14:21:30 +0000 |
422 | @@ -149,7 +149,7 @@ |
423 | def __init__(self, plugins): |
424 | liststore = Gtk.ListStore(str, GdkPixbuf.Pixbuf, bool, object) |
425 | self.model = liststore.filter_new() |
426 | - Gtk.TreeView.__init__(self, self.model) |
427 | + Gtk.TreeView.__init__(self, model=self.model) |
428 | |
429 | self.SelectionHandler = None |
430 | |
431 | @@ -189,7 +189,7 @@ |
432 | class GroupView(Gtk.TreeView): |
433 | def __init__(self, name): |
434 | self.model = Gtk.ListStore(str, str) |
435 | - Gtk.TreeView.__init__(self, self.model) |
436 | + Gtk.TreeView.__init__(self, model=self.model) |
437 | |
438 | self.SelectionHandler = None |
439 | |
440 | @@ -248,8 +248,8 @@ |
441 | self.buttons = [] |
442 | |
443 | def add_button(self, label, callback): |
444 | - arrow = Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE) |
445 | - button = Gtk.Button(label) |
446 | + arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.RIGHT, shadow_type=Gtk.ShadowType.NONE) |
447 | + button = Gtk.Button(label=label) |
448 | button.set_relief(Gtk.ReliefStyle.NONE) |
449 | button.connect('clicked', self.on_button_clicked, callback) |
450 | if self.get_children(): |
451 | @@ -336,7 +336,7 @@ |
452 | |
453 | self.store = Gtk.ListStore(GObject.TYPE_STRING) |
454 | |
455 | - self.view = Gtk.TreeView(self.store) |
456 | + self.view = Gtk.TreeView(model=self.store) |
457 | self.view.set_headers_visible(True) |
458 | self.view.insert_column_with_attributes(-1, name, Gtk.CellRendererText(), text=0) |
459 | |
460 | @@ -926,7 +926,7 @@ |
461 | class Popup (Gtk.Window): |
462 | |
463 | def __init__ (self, parent=None, text=None, child=None, decorated=True, mouse=False, modal=True): |
464 | - Gtk.Window.__init__ (self, Gtk.WindowType.TOPLEVEL) |
465 | + Gtk.Window.__init__(self, type=Gtk.WindowType.TOPLEVEL) |
466 | self.set_type_hint (Gdk.WindowTypeHint.UTILITY) |
467 | self.set_position (mouse and Gtk.WindowPosition.MOUSE or Gtk.WindowPosition.CENTER_ALWAYS) |
468 | if parent: |
469 | @@ -935,7 +935,7 @@ |
470 | self.set_decorated (decorated) |
471 | self.set_property("skip-taskbar-hint", True) |
472 | if text: |
473 | - label = Gtk.Label (text) |
474 | + label = Gtk.Label(label=text) |
475 | align = Gtk.Alignment () |
476 | align.set_padding (20, 20, 20, 20) |
477 | align.add (label) |
478 | @@ -1147,7 +1147,7 @@ |
479 | |
480 | self.match = self.entry.get_text () |
481 | |
482 | - dlg = Gtk.Dialog (_("Edit match")) |
483 | + dlg = Gtk.Dialog(title=_("Edit match")) |
484 | dlg.set_position (Gtk.WindowPosition.CENTER_ON_PARENT) |
485 | dlg.set_transient_for (self.get_parent ().get_toplevel ()) |
486 | dlg.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) |
487 | @@ -1173,7 +1173,7 @@ |
488 | box.set_spacing (5) |
489 | entry = Gtk.Entry () |
490 | entry.connect ('changed', self._check_entry_value, dlg) |
491 | - button = Gtk.Button (_("Grab")) |
492 | + button = Gtk.Button(label=_("Grab")) |
493 | button.connect ('clicked', self.grab_value, entry, type_chooser) |
494 | box.pack_start (entry, True, True, 0) |
495 | box.pack_start (button, False, False, 0) |
496 | @@ -1343,10 +1343,10 @@ |
497 | '''Display an error dialog''' |
498 | |
499 | def __init__ (self, parent, message): |
500 | - Gtk.MessageDialog.__init__ (self, parent, |
501 | - Gtk.DialogFlags.DESTROY_WITH_PARENT, |
502 | - Gtk.MessageType.ERROR, |
503 | - Gtk.ButtonsType.CLOSE) |
504 | + Gtk.MessageDialog.__init__(self, transient_for=parent, |
505 | + destroy_with_parent=True, |
506 | + message_type=Gtk.MessageType.ERROR, |
507 | + buttons=Gtk.ButtonsType.CLOSE) |
508 | self.set_position (Gtk.WindowPosition.CENTER) |
509 | self.set_markup (message) |
510 | self.set_title (_("An error has occured")) |
511 | @@ -1361,10 +1361,10 @@ |
512 | '''First run dialog providing a user warning.''' |
513 | |
514 | def __init__(self, parent): |
515 | - Gtk.MessageDialog.__init__ (self, parent, |
516 | - Gtk.DialogFlags.DESTROY_WITH_PARENT, |
517 | - Gtk.MessageType.WARNING, |
518 | - Gtk.ButtonsType.OK) |
519 | + Gtk.MessageDialog.__init__(self, transient_for=parent, |
520 | + destroy_with_parent=True, |
521 | + message_type=Gtk.MessageType.WARNING, |
522 | + buttons=Gtk.ButtonsType.OK) |
523 | self.set_position (Gtk.WindowPosition.CENTER) |
524 | title = _("CCSM is an advanced tool. Use with caution.") |
525 | self.set_markup("<b>%s</b>" % title) |
For future, it is better to remove whitespace when passing function arguments. /www.python. org/dev/ peps/pep- 0008/#other- recommendations:
Quoting from https:/
Yes:
def complex(real, imag=0.0):
return magic(r=real, i=imag)
No:
def complex(real, imag = 0.0):
return magic(r = real, i = imag)
Anyway approving because it is not related to your fixes.