Code cleanup: Print statements => functions

This commit is contained in:
Kai Huuhko 2014-04-14 02:32:16 +03:00
parent ae64f89ab5
commit 6408f8d318
7 changed files with 46 additions and 69 deletions

View File

@ -40,101 +40,79 @@ cdef int cb_canvas_dispatcher2(Canvas self, int type) except 0:
cdef void cb_canvas_mouse_in(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_IN is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_IN is not supported by canvas.")
cdef void cb_canvas_mouse_out(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_OUT is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_OUT is not supported by canvas.")
cdef void cb_canvas_mouse_down(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_DOWN is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_DOWN is not supported by canvas.")
cdef void cb_canvas_mouse_up(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_UP is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_UP is not supported by canvas.")
cdef void cb_canvas_mouse_move(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_MOVE is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_MOVE is not supported by canvas.")
cdef void cb_canvas_multi_down(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MULTI_DOWN is not supported by canvas."
print("EVAS_CALLBACK_MULTI_DOWN is not supported by canvas.")
cdef void cb_canvas_multi_up(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MULTI_UP is not supported by canvas."
print("EVAS_CALLBACK_MULTI_UP is not supported by canvas.")
cdef void cb_canvas_multi_move(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MULTI_MOVE is not supported by canvas."
print("EVAS_CALLBACK_MULTI_MOVE is not supported by canvas.")
cdef void cb_canvas_mouse_wheel(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOUSE_WHEEL is not supported by canvas."
print("EVAS_CALLBACK_MOUSE_WHEEL is not supported by canvas.")
cdef void cb_canvas_free(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_FREE is not supported by canvas."
print("EVAS_CALLBACK_FREE is not supported by canvas.")
cdef void cb_canvas_key_down(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_KEY_DOWN is not supported by canvas."
print("EVAS_CALLBACK_KEY_DOWN is not supported by canvas.")
cdef void cb_canvas_key_up(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_KEY_UP is not supported by canvas."
print("EVAS_CALLBACK_KEY_UP is not supported by canvas.")
cdef void cb_canvas_focus_in(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_FOCUS_IN is not supported by canvas."
print("EVAS_CALLBACK_FOCUS_IN is not supported by canvas.")
cdef void cb_canvas_focus_out(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_FOCUS_OUT is not supported by canvas."
print("EVAS_CALLBACK_FOCUS_OUT is not supported by canvas.")
cdef void cb_canvas_show(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_SHOW is not supported by canvas."
print("EVAS_CALLBACK_SHOW is not supported by canvas.")
cdef void cb_canvas_hide(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_HIDE is not supported by canvas."
print("EVAS_CALLBACK_HIDE is not supported by canvas.")
cdef void cb_canvas_move(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_MOVE is not supported by canvas."
print("EVAS_CALLBACK_MOVE is not supported by canvas.")
cdef void cb_canvas_resize(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_RESIZE is not supported by canvas."
print("EVAS_CALLBACK_RESIZE is not supported by canvas.")
cdef void cb_canvas_restack(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_RESTACK is not supported by canvas."
print("EVAS_CALLBACK_RESTACK is not supported by canvas.")
cdef void cb_canvas_del(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_DEL is not supported by canvas."
print("EVAS_CALLBACK_DEL is not supported by canvas.")
cdef void cb_canvas_hold(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_HOLD is not supported by canvas."
print("EVAS_CALLBACK_HOLD is not supported by canvas.")
cdef void cb_canvas_changed_size_hints(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_CHANGED_SIZE_HINTS is not supported by canvas."
print("EVAS_CALLBACK_CHANGED_SIZE_HINTS is not supported by canvas.")
cdef void cb_canvas_image_preloaded(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_IMAGE_PRELOADED is not supported by canvas."
print("EVAS_CALLBACK_IMAGE_PRELOADED is not supported by canvas.")
cdef void cb_canvas_image_resize(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_IMAGE_RESIZE is not supported by canvas."
print("EVAS_CALLBACK_IMAGE_RESIZE is not supported by canvas.")
cdef void cb_canvas_device_changed(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_DEVICE_CHANGED is not supported by canvas."
print("EVAS_CALLBACK_DEVICE_CHANGED is not supported by canvas.")
cdef void cb_canvas_canvas_focus_in(void *data, Evas *e, void *e_inf) with gil:
cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_CANVAS_FOCUS_IN)
@ -165,8 +143,7 @@ cdef void cb_canvas_canvas_object_focus_out(void *data, Evas *e, void *e_inf) wi
cdef void cb_canvas_image_unloaded(void *data, Evas *e, void *e_inf) with gil:
print "EVAS_CALLBACK_IMAGE_UNLOADED is not supported by canvas."
print("EVAS_CALLBACK_IMAGE_UNLOADED is not supported by canvas.")
cdef void cb_canvas_render_pre(void *data, Evas *e, void *e_inf) with gil:
#cdef Evas_Object *obj = <Evas_Object*>e_inf

View File

@ -9,13 +9,13 @@ from efl import ecore
def print_remote_handles(adapter, bdaddr):
handles = [hex(int(h)) \
for h in list(adapter.GetRemoteServiceHandles(bdaddr, ""))]
print "Handles:", handles
print("Handles:", handles)
ecore.idler_add(ecore.main_loop_quit)
return False
if len(sys.argv) != 2:
print "USAGE: %s <bdaddr>" % sys.argv[0]
print("USAGE: %s <bdaddr>" % sys.argv[0])
sys.exit(1)
dbus_ml = dbus_mainloop.DBusEcoreMainLoop()

View File

@ -6,20 +6,20 @@ from efl import ecore
def disc_started_signal():
print "Signal: DiscoveryStarted()"
print("Signal: DiscoveryStarted()")
def rem_dev_found_signal(address, cls, rssi):
print "Signal: RemoteDeviceFound(%s, %s, %s)" % (address, cls, rssi)
print("Signal: RemoteDeviceFound(%s, %s, %s)" % (address, cls, rssi))
def rem_dev_name_signal(address, name):
print "Signal: RemoteNameUpdated(%s, %s)" % (address, name)
print("Signal: RemoteNameUpdated(%s, %s)" % (address, name))
def disc_completed_signal():
print "Signal: DiscoveryCompleted()"
ecore.idler_add(ecore.main_loop_quit)
print("Signal: DiscoveryCompleted()")
ecore.idler_add(ecore.main_loop_quit)
dbus_ml = dbus_mainloop.DBusEcoreMainLoop()

View File

@ -14,17 +14,17 @@ def emit_signal(obj):
def hello_signal_handler(hello_string):
print "Received signal (by connecting using remote " \
"object) and it says: %s" % hello_string
print("Received signal (by connecting using remote "
"object) and it says: %s" % hello_string)
def catchall_hello_signals_handler(hello_string):
print "Received a hello signal and it says: %s" % hello_string
print("Received a hello signal and it says: %s" % hello_string)
def catchall_testservice_interface_handler(hello_string, dbus_message):
print "com.example.TestService interface says %s " \
"when it sent signal %s" % (hello_string, dbus_message.get_member())
print("com.example.TestService interface says %s "
"when it sent signal %s" % (hello_string, dbus_message.get_member()))
dbus_ml = dbus_mainloop.DBusEcoreMainLoop()

View File

@ -6,7 +6,7 @@ from efl import ecore
def print_name_owner_changed(obj, old, new):
print "Obj = '%s', Old = '%s', New = '%s'" % (obj, old, new)
print("Obj = '%s', Old = '%s', New = '%s'" % (obj, old, new))
dbus_ml = dbus_mainloop.DBusEcoreMainLoop()

View File

@ -227,12 +227,12 @@ def focus_clicked(obj, item=None):
# Focus 2
def _focus_obj(bt, newfocus):
print newfocus
print(newfocus)
newfocus.focus = True
def _focus_layout_part(bt, layout):
newfocus = layout.edje.part_object_get("sky")
print newfocus
print(newfocus)
newfocus.focus = True
@ -308,12 +308,12 @@ def focus2_clicked(obj, item=None):
focused = None
def _focused_cb(obj):
global focused
print obj
print(obj)
focused = obj
def _unfocused_cb(obj):
global focused
print obj
print(obj)
focused = None
def _add_cb(bt, win, bx):
@ -383,12 +383,12 @@ def _win_highlight_animate_cb(chk, win):
win.focus_highlight_animate = chk.state
def _custom_chain_cb(chk, bx):
print chk.state
print(chk.state)
if chk.state is True:
i = 0
custom_chain = []
for child in bx.children:
print child
print(child)
if i == 0:
c = child
custom_chain.append(child)

View File

@ -36,7 +36,7 @@ class TestExe(unittest.TestCase):
print(" Event : %s" % repr(event))
for l in event.lines:
print(" %s" % repr(l))
print
print()
exe = ecore.Exe("ls -la", flags)
exe.on_add_event_add(on_add, 1, c=3, b=2)