Commit Graph

81 Commits

Author SHA1 Message Date
Kai Huuhko 54adcd9970 Bump copyright year 2016-08-13 01:13:30 +03:00
Davide Andreoli be3069b280 Update to new Eo callback stop mechanism
#FollowTheWhiteRabbit (tm)
2016-06-26 15:54:36 +02:00
Davide Andreoli 243664d738 Add a test to check eo class names
a bit hackish, but do his work.
And is important to check those names now that efl class names are going to be shuffled around :P
2016-06-03 14:20:41 +02:00
Davide Andreoli cadf409404 Going back to use eo_del instead of eo_unref
...still untested as the bindings are broken for something else atm
2016-06-03 09:14:31 +02:00
Davide Andreoli 7fd0f973ca Safer version of the parent hack
not all objects have a bindable parent, Timer fe have Loop as parent and we don't have bindings for Loop.
2016-05-29 15:49:17 +02:00
Davide Andreoli c2c09d4dc9 Hack to keep the legacy behavior of Eo.parent 2016-05-29 15:41:46 +02:00
Davide Andreoli eca2dfaa0b Follow Eo changes
eo_del -> eo_unref
eo_key_del -> eo_key_set(NULL)
EO_BASE_EVENT_DEL -> EO_EVENT_DEL
2016-05-18 21:38:46 +02:00
Davide Andreoli aba5250634 Follow recent Eo changes 2016-04-24 12:11:07 +02:00
Kai Huuhko 77d023dfe1 More Eo updates 2016-03-09 20:07:05 +02:00
Kai Huuhko 05c19962dc Follow changes in Eo
- version 4 (eo_add changes coming later)
- events
2016-03-04 11:10:11 +02:00
Kai Huuhko caef23bb34 Trivial todo note updates and doc fix 2016-02-02 14:23:00 +02:00
Kai Huuhko fa69908d71 Eo: Add a private dict which can be used for callbacks etc. 2016-01-23 15:38:06 +02:00
Kai Huuhko 37930f389d Follow recent changes in Eo 2015-06-01 17:59:47 +03:00
Kai Huuhko 219ba9cdd9 Use atexit to shutdown eo, evas and ecore modules
They already had a call to init in the module, thus there was a mismatch
not obvious to users.
2015-04-15 12:02:34 +03:00
Kai Huuhko 0266db28bd Eo: Add the property 'parent' 2015-03-21 10:06:45 +02:00
Kai Huuhko fbc22d850d Make Evas.SO iterator a generic Eo iterator and move to efl.eo 2015-03-09 19:36:42 +02:00
Davide Andreoli 9afb74906b Fix code to conform to recent Eo changes. 2015-02-25 21:44:31 +01:00
Davide Andreoli 1d8ffd1ed4 Restructured eo docs 2015-01-31 17:00:18 +01:00
Davide Andreoli bbb747eb5e New style enums for eo 2015-01-04 22:30:19 +01:00
Davide Andreoli a4f2cc37cc Another year has passed... 2015-01-02 20:03:53 +01:00
Davide Andreoli d3f98802b0 Optimize the _set_properties_from_keyword_args() function.
We do not need to check if the attribute exist to raise an exception, setattr() yet raise a well formatted expection in case of failure.

This way we avoid a dir() call and an IN check in a hot path.

The only drawback is that this change the raised exception in the case an attr not exist, from  AssertionError to AttributeError... I hope none was using that eception explicitly.
2014-11-22 14:25:39 +01:00
Davide Andreoli 9a78c4e22d Expose object_from_instance and the inverse to other C code
This create the efl.eo_api.h file that you can copy to your source if you want to use the exported api
2014-08-16 12:33:29 +02:00
Davide Andreoli 4a57a7deaa Follow recent Eo api changes
eo_event_global_freeze_get -> eo_event_global_freeze_count_get
eo_event__freeze_get -> eo_event_freeze_count_get
2014-06-02 17:21:42 +02:00
Davide Andreoli b3eef73b0e s/2013/2014/g 2014-04-14 22:21:03 +02:00
Davide Andreoli cc02387266 Adjust the bindings to work with Eo2 2014-04-14 21:41:38 +02:00
Kai Huuhko d65101b24b Code cleanup: Unused/misplaced cimports 2014-04-14 00:51:19 +03:00
Davide Andreoli beff74c28a added docs for Eo 2014-04-06 23:36:05 +02:00
Kai Huuhko d6dc3a2045 Revert "Remove Python -> C string hacks"
A quote from Cython documentation:

"The other direction, i.e. automatic encoding to C strings, is only supported
for the ASCII codec (and the “default encoding”, which is runtime specific
and may or may not be ASCII). This is because CPython handles the memory
management in this case by keeping an encoded copy of the string alive
together with the original unicode string. Otherwise, there would be no way
to limit the lifetime of the encoded string in any sensible way, thus
rendering any attempt to extract a C string pointer from it a dangerous
endeavour."

Cython plays it safe and we can't live with ASCII-only; reverting to
our earlier "hacks" for string conversion.

This reverts commit b547ff2aa2.

Conflicts:
	efl/elementary/entry.pyx
	efl/elementary/object.pyx
2014-04-06 23:48:16 +03:00
Kai Huuhko b547ff2aa2 Remove Python -> C string hacks 2014-04-06 01:50:29 +03:00
Kai Huuhko adf70fa26f Remove const hacks
They were a workaround for limitations in Cython <0.18
2014-04-05 03:13:15 +03:00
Kai Huuhko 6db1f9d0d6 Use uintptr_t instead of long or unsigned long for handling pointers. 2013-12-15 15:08:57 +02:00
Davide Andreoli 74244a5ac7 Python-EFL: fix the mess with the lgpl version.
Elm was lgpl3, COPYING was lgpl3, docs say lgpl3. So fix everything to be v3.
Also fix the COPING for Lesser: we must include gpl (in COPYING) AND lgpl (in COPYING.LESSER).
2013-12-07 17:54:58 +01:00
Kai Huuhko ca680c5a67 Elementary: Add an optimization for _set_properties_from_keyword_args
Return early when kwargs dict is empty.
2013-12-06 10:51:11 +02:00
Kai Huuhko 4bd9dd3243 Eo: Fix a Py2'ism. 2013-11-24 18:29:33 +02:00
Kai Huuhko f2b22e94bb Eo: Change _register_decorated_callbacks to not use hasattr/getattr
They actually get the value of a property, leading to unexpected
behavior. Iterate the class dict instead.
2013-11-24 17:56:08 +02:00
Kai Huuhko 225f061b05 Optimize exception propagation in several hot/time critical cases.
With "except *" a call is made to PyErr_Occurred on each call of a
function.

Adding a return value where possible and using an appropriate exception
value calls PyErr_Occurred only when that value is returned, ie.
an exception has been raised.

cdef void example_func() except *: <- PyErr_Occurred called on each call
cdef int example_func() except 0: <- PyErr_Occurred called only when
	an exception has been raised (the function thus returns 0)
2013-11-10 08:47:21 +02:00
Kai Huuhko e557b2fcb4 Eo: Add several methods, tests and more debug logging.
Methods:
 - parent_set/get
 - event_freeze(_get)/thaw
 - delete

Functions:
 - event_global_freeze(_get)/thaw

Moved enums to efl.eo.enums.pxd
2013-11-09 09:05:44 +02:00
Kai Huuhko be547283f0 Eo: Speed up, and fix a cornercase in, _properties_from_keyword_args.
hasattr tries getattr which can be variedly slow, so check dict instead.

This also fixes it in cases where the property doesn't have a __get__
function.
2013-10-30 03:19:03 +02:00
Kai Huuhko 1e40a8f5bb Simplify and correct string representation functions.
Calling str() uses __repr__ when __str__ is not found.

__repr__ should return a string with angle brackets when the object
cannot be reconstructed with exec(repr(obj)).
2013-10-28 18:55:58 +02:00
Kai Huuhko d6d440c3a6 Add support for loggers that have been initialized already.
This allows module initialization to be logged as well.

Changed add_logger to return the logger object instead of int.
2013-10-26 03:22:47 +03:00
Kai Huuhko 19e7d11f61 Resolved Py3 issues.
Fixes T459
2013-10-26 02:38:25 +03:00
Kai Huuhko 4771ca5ccb Move logger to its own module. 2013-10-24 22:58:09 +03:00
Kai Huuhko 8cbee5c44d Handle unknown domain messages in "efl" logger. 2013-10-23 21:49:56 +03:00
Kai Huuhko 7fbab02702 First attempt at integrating Eina Log with Python logging.
Has two loggers: efl and efl.eo.

To test, add handlers, formatters etc. and change levels using
normal Python logging utilities. The test messages come from
efl.eo init and class registration.
2013-10-23 14:34:42 +03:00
Kai Huuhko b981ce3840 New feature: Set properties using constructor keyword arguments.
Only applied to Elm Bubble for now as an example.
2013-10-20 14:34:53 +03:00
Kai Huuhko 9413b157b9 Evas/Eo: Fix couple of crashes related to Canvas cb's and Eo 2013-10-03 06:19:04 +03:00
Kai Huuhko 5f4a46da4b Move common conversion functions from efl.eo to efl.utils.conversions 2013-10-01 04:56:28 +03:00
Kai Huuhko 6587b5be67 Rename efl.pxd to efl.eina.pxd 2013-09-30 07:26:35 +03:00
Kai Huuhko 88db824a77 Change the _METHOD_DEPRECATED function into a decorator.
- move the decorator into a new package/module: utils/deprecated
 - simplify setup.py logic slightly, it still needs work
2013-09-20 12:01:50 +03:00
Davide Andreoli 5913721de9 Python-EFL: implemented decorators for edje.
Decorators implemented in a much more simple and generic
way than before, we can use them in other place too.

3 deco implemented:
@on_signal(emission, source)
@message_handler
@on_text_change

I choosed the 'strange' on_* naming convention to not
clash/confuse with normal callback functions, tell
me if you don't like.
2013-05-14 21:51:29 +02:00