Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
pygobject
Commits
0c85656f
Commit
0c85656f
authored
Mar 22, 2012
by
Johan Dahlin
Committed by
Johan Dahlin
Mar 22, 2012
Browse files
PEP8: Remove trailing ;
https://bugzilla.gnome.org/show_bug.cgi?id=672627
parent
32cc594a
Changes
9
Hide whitespace changes
Inline
Side-by-side
demos/gtk-demo/demos/appwindow.py
View file @
0c85656f
...
...
@@ -353,7 +353,7 @@ def main(demoapp=None):
0
,
0
,
0
)
infobar
=
Gtk
.
InfoBar
()
;
infobar
=
Gtk
.
InfoBar
()
infobar
.
set_no_show_all
(
True
)
messagelabel
=
Gtk
.
Label
()
messagelabel
.
show
()
...
...
@@ -388,7 +388,7 @@ def main(demoapp=None):
buffer
.
connect
(
'changed'
,
update_statusbar
,
statusbar
)
buffer
.
connect
(
'mark_set'
,
mark_set_callback
,
statusbar
)
update_statusbar
(
buffer
,
statusbar
)
;
update_statusbar
(
buffer
,
statusbar
)
window
.
set_default_size
(
200
,
200
)
window
.
show_all
()
...
...
demos/gtk-demo/demos/dialogs.py
View file @
0c85656f
...
...
@@ -42,22 +42,22 @@ class DialogsApp:
frame
.
add
(
vbox
)
# Standard message dialog
hbox
=
Gtk
.
HBox
(
spacing
=
8
)
;
hbox
=
Gtk
.
HBox
(
spacing
=
8
)
vbox
.
pack_start
(
hbox
,
False
,
False
,
0
)
button
=
Gtk
.
Button
.
new_with_mnemonic
(
"_Message Dialog"
)
;
button
=
Gtk
.
Button
.
new_with_mnemonic
(
"_Message Dialog"
)
button
.
connect
(
'clicked'
,
self
.
_message_dialog_clicked
)
hbox
.
pack_start
(
button
,
False
,
False
,
0
)
vbox
.
pack_start
(
Gtk
.
HSeparator
(),
False
,
False
,
0
)
;
False
,
False
,
0
)
# Interactive dialog
hbox
=
Gtk
.
HBox
(
spacing
=
8
)
;
hbox
=
Gtk
.
HBox
(
spacing
=
8
)
vbox
.
pack_start
(
hbox
,
False
,
False
,
0
)
vbox2
=
Gtk
.
VBox
(
spacing
=
0
)
;
button
=
Gtk
.
Button
.
new_with_mnemonic
(
"_Interactive Dialog"
)
;
vbox2
=
Gtk
.
VBox
(
spacing
=
0
)
button
=
Gtk
.
Button
.
new_with_mnemonic
(
"_Interactive Dialog"
)
button
.
connect
(
'clicked'
,
self
.
_interactive_dialog_clicked
)
...
...
@@ -67,7 +67,7 @@ class DialogsApp:
table
=
Gtk
.
Table
(
n_rows
=
2
,
n_columns
=
2
,
homogeneous
=
False
)
table
.
set_row_spacings
(
4
)
table
.
set_col_spacings
(
4
)
hbox
.
pack_start
(
table
,
False
,
False
,
0
)
;
hbox
.
pack_start
(
table
,
False
,
False
,
0
)
label
=
Gtk
.
Label
.
new_with_mnemonic
(
"_Entry 1"
)
table
.
attach_defaults
(
label
,
0
,
1
,
0
,
1
)
...
...
@@ -76,9 +76,9 @@ class DialogsApp:
table
.
attach_defaults
(
self
.
entry1
,
1
,
2
,
0
,
1
)
label
.
set_mnemonic_widget
(
self
.
entry1
)
label
=
Gtk
.
Label
.
new_with_mnemonic
(
"E_ntry 2"
)
;
label
=
Gtk
.
Label
.
new_with_mnemonic
(
"E_ntry 2"
)
table
.
attach_defaults
(
label
,
0
,
1
,
1
,
2
)
;
table
.
attach_defaults
(
label
,
0
,
1
,
1
,
2
)
self
.
entry2
=
Gtk
.
Entry
()
table
.
attach_defaults
(
self
.
entry2
,
1
,
2
,
1
,
2
)
...
...
@@ -109,8 +109,8 @@ class DialogsApp:
table
.
set_col_spacings
(
4
)
hbox
.
pack_start
(
table
,
True
,
True
,
0
)
label
=
Gtk
.
Label
.
new_with_mnemonic
(
"_Entry 1"
)
table
.
attach_defaults
(
label
,
0
,
1
,
0
,
1
)
;
local_entry1
=
Gtk
.
Entry
()
;
table
.
attach_defaults
(
label
,
0
,
1
,
0
,
1
)
local_entry1
=
Gtk
.
Entry
()
local_entry1
.
set_text
(
self
.
entry1
.
get_text
())
table
.
attach_defaults
(
local_entry1
,
1
,
2
,
0
,
1
)
label
.
set_mnemonic_widget
(
local_entry1
)
...
...
@@ -121,14 +121,14 @@ class DialogsApp:
local_entry2
=
Gtk
.
Entry
()
local_entry2
.
set_text
(
self
.
entry2
.
get_text
())
table
.
attach_defaults
(
local_entry2
,
1
,
2
,
1
,
2
)
label
.
set_mnemonic_widget
(
local_entry2
)
;
label
.
set_mnemonic_widget
(
local_entry2
)
hbox
.
show_all
()
;
hbox
.
show_all
()
response
=
dialog
.
run
()
if
response
==
Gtk
.
ResponseType
.
OK
:
self
.
entry1
.
set_text
(
local_entry1
.
get_text
())
;
self
.
entry2
.
set_text
(
local_entry2
.
get_text
())
;
self
.
entry1
.
set_text
(
local_entry1
.
get_text
())
self
.
entry2
.
set_text
(
local_entry2
.
get_text
())
dialog
.
destroy
()
...
...
demos/gtk-demo/demos/links.py
View file @
0c85656f
...
...
@@ -41,7 +41,7 @@ or activated via <a href="keynav">keynav</a>""")
label
.
set_use_markup
(
True
)
label
.
connect
(
"activate-link"
,
self
.
activate_link
)
self
.
window
.
add
(
label
)
;
self
.
window
.
add
(
label
)
label
.
show
()
self
.
window
.
show
()
...
...
demos/gtk-demo/demos/pixbuf.py
View file @
0c85656f
...
...
@@ -124,7 +124,7 @@ class PixbufApp:
iw
=
pb
.
get_width
()
ih
=
pb
.
get_height
()
r
=
radius
+
(
radius
/
3.0
)
*
math
.
sin
(
f
*
2.0
*
math
.
pi
)
;
r
=
radius
+
(
radius
/
3.0
)
*
math
.
sin
(
f
*
2.0
*
math
.
pi
)
xpos
=
math
.
floor
(
xmid
+
r
*
math
.
cos
(
ang
)
-
iw
/
2.0
+
0.5
)
ypos
=
math
.
floor
(
ymid
+
r
*
math
.
sin
(
ang
)
-
ih
/
2.0
+
0.5
)
...
...
demos/gtk-demo/demos/printing.py
View file @
0c85656f
...
...
@@ -63,7 +63,7 @@ class PrintingApp:
else
:
ext
=
'.pdf'
uri
=
"file://%s/gtk-demo%s"
%
(
dir
,
ext
)
;
uri
=
"file://%s/gtk-demo%s"
%
(
dir
,
ext
)
settings
.
set
(
Gtk
.
PRINT_SETTINGS_OUTPUT_URI
,
uri
)
self
.
operation
.
set_print_settings
(
settings
)
...
...
@@ -128,7 +128,7 @@ class PrintingApp:
if
text_width
>
width
:
layout
.
set_width
(
width
)
layout
.
set_ellipsize
(
Pango
.
EllipsizeMode
.
START
)
;
layout
.
set_ellipsize
(
Pango
.
EllipsizeMode
.
START
)
(
text_width
,
text_height
)
=
layout
.
get_pixel_size
()
cr
.
move_to
((
width
-
text_width
)
/
2
,
...
...
@@ -142,7 +142,7 @@ class PrintingApp:
(
text_width
,
text_height
)
=
layout
.
get_pixel_size
()
cr
.
move_to
(
width
-
text_width
-
4
,
(
self
.
HEADER_HEIGHT
-
text_height
)
/
2
)
PangoCairo
.
show_layout
(
cr
,
layout
)
;
PangoCairo
.
show_layout
(
cr
,
layout
)
layout
=
print_ctx
.
create_pango_layout
()
...
...
@@ -159,7 +159,7 @@ class PrintingApp:
for
i
in
range
(
lines_pp
):
if
line
>=
num_lines
:
break
;
break
layout
.
set_text
(
data_lines
[
line
],
-
1
)
PangoCairo
.
show_layout
(
cr
,
layout
)
...
...
gi/overrides/Gtk.py
View file @
0c85656f
...
...
@@ -1014,7 +1014,7 @@ class ListStore(Gtk.ListStore, TreeModel, TreeSortable):
_set_lists
(
columns
,
values
)
elif
isinstance
(
args
[
0
],
(
tuple
,
list
)):
if
len
(
args
)
!=
2
:
raise
TypeError
(
'Too many arguments'
)
;
raise
TypeError
(
'Too many arguments'
)
_set_lists
(
args
[
0
],
args
[
1
])
elif
isinstance
(
args
[
0
],
dict
):
columns
=
args
[
0
].
keys
()
...
...
@@ -1238,7 +1238,7 @@ class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable):
_set_lists
(
columns
,
values
)
elif
isinstance
(
args
[
0
],
(
tuple
,
list
)):
if
len
(
args
)
!=
2
:
raise
TypeError
(
'Too many arguments'
)
;
raise
TypeError
(
'Too many arguments'
)
_set_lists
(
args
[
0
],
args
[
1
])
elif
isinstance
(
args
[
0
],
dict
):
columns
=
args
[
0
].
keys
()
...
...
tests/test_everything.py
View file @
0c85656f
...
...
@@ -287,9 +287,9 @@ class TestCallbacks(unittest.TestCase):
TestCallbacks
.
called
=
True
return
foo
Everything
.
test_callback_async
(
callback
,
44
)
;
i
=
Everything
.
test_callback_thaw_async
()
;
self
.
assertEquals
(
44
,
i
)
;
Everything
.
test_callback_async
(
callback
,
44
)
i
=
Everything
.
test_callback_thaw_async
()
self
.
assertEquals
(
44
,
i
)
self
.
assertTrue
(
TestCallbacks
.
called
)
def
test_callback_scope_call
(
self
):
...
...
@@ -576,15 +576,15 @@ class TestAdvancedInterfaces(unittest.TestCase):
self
.
assertNotEqual
(
obj1
,
obj2
)
def
test_obj_skip_return_val
(
self
):
obj
=
Everything
.
TestObj
()
;
ret
=
obj
.
skip_return_val
(
50
,
42.0
,
60
,
2
,
3
)
;
self
.
assertEquals
(
len
(
ret
),
3
)
;
self
.
assertEquals
(
ret
[
0
],
51
)
;
self
.
assertEquals
(
ret
[
1
],
61
)
;
self
.
assertEquals
(
ret
[
2
],
32
)
;
obj
=
Everything
.
TestObj
()
ret
=
obj
.
skip_return_val
(
50
,
42.0
,
60
,
2
,
3
)
self
.
assertEquals
(
len
(
ret
),
3
)
self
.
assertEquals
(
ret
[
0
],
51
)
self
.
assertEquals
(
ret
[
1
],
61
)
self
.
assertEquals
(
ret
[
2
],
32
)
def
test_obj_skip_return_val_no_out
(
self
):
obj
=
Everything
.
TestObj
()
;
obj
=
Everything
.
TestObj
()
# raises an error for 0, succeeds for any other value
self
.
assertRaises
(
GLib
.
GError
,
obj
.
skip_return_val_no_out
,
0
)
...
...
@@ -593,7 +593,7 @@ class TestAdvancedInterfaces(unittest.TestCase):
class
TestSignals
(
unittest
.
TestCase
):
def
test_object_param_signal
(
self
):
obj
=
Everything
.
TestObj
()
;
obj
=
Everything
.
TestObj
()
def
callback
(
obj
,
obj_param
):
self
.
assertEquals
(
obj_param
.
props
.
int
,
3
)
...
...
tests/test_gi.py
View file @
0c85656f
...
...
@@ -1073,7 +1073,7 @@ class TestEnum(unittest.TestCase):
def
setUpClass
(
cls
):
'''Run tests under a test locale.
Upper case conversion of member names should not be locale specific
;
Upper case conversion of member names should not be locale specific
e. g. in Turkish, "i".upper() == "i", which gives results like "iNVALiD"
Run test under a locale which defines toupper('a') == 'a'
...
...
tests/test_overrides.py
View file @
0c85656f
...
...
@@ -602,10 +602,10 @@ class TestGtk(unittest.TestCase):
callback_data
=
"callback data"
def
test_action_callback_data
(
action
,
user_data
):
self
.
assertEquals
(
user_data
,
callback_data
)
;
self
.
assertEquals
(
user_data
,
callback_data
)
def
test_radio_action_callback_data
(
action
,
current
,
user_data
):
self
.
assertEquals
(
user_data
,
callback_data
)
;
self
.
assertEquals
(
user_data
,
callback_data
)
action_group
.
add_actions
([
(
'test-action1'
,
None
,
'Test Action 1'
,
...
...
@@ -672,7 +672,7 @@ class TestGtk(unittest.TestCase):
class
SignalCheck
:
def
__init__
(
self
):
self
.
sentinel
=
0
self
.
after_sentinel
=
0
;
self
.
after_sentinel
=
0
def
on_signal_1
(
self
,
*
args
):
self
.
sentinel
+=
1
...
...
@@ -969,7 +969,7 @@ class TestGtk(unittest.TestCase):
obj
=
tree_store
.
get_value
(
treeiter
,
2
)
obj
.
check
(
i
,
s
)
obj2
=
tree_store
.
get_value
(
treeiter
,
3
)
self
.
assertEquals
(
obj
,
obj2
)
;
self
.
assertEquals
(
obj
,
obj2
)
pyobj
=
tree_store
.
get_value
(
treeiter
,
4
)
self
.
assertEquals
(
pyobj
,
test_pyobj
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment