Compare commits
332 Commits
devs/kuuko
...
master
Author | SHA1 | Date |
---|---|---|
Davide Andreoli | c8d7bddb47 | |
Davide Andreoli | 4bb6d9fa9f | |
Davide Andreoli | 0b089a5623 | |
Davide Andreoli | a7464e66e6 | |
Davide Andreoli | d1b4512e52 | |
Davide Andreoli | 9896656574 | |
Davide Andreoli | fb649f30e7 | |
Davide Andreoli | f0ab762e16 | |
Davide Andreoli | 4548c5a01b | |
Davide Andreoli | cadc757e7e | |
Davide Andreoli | ed959b59af | |
Davide Andreoli | ec2b95ceab | |
Davide Andreoli | dcf362b03f | |
Davide Andreoli | d420f60e0d | |
Davide Andreoli | 0848286409 | |
Davide Andreoli | 3ca71a067e | |
Davide Andreoli | 9dce9ccad4 | |
Davide Andreoli | 7141f21f0b | |
Davide Andreoli | fabcef1278 | |
Davide Andreoli | a0a6d756b5 | |
Davide Andreoli | e467b3e871 | |
Davide Andreoli | 69cfc2c7fc | |
Davide Andreoli | f70d7c949f | |
Davide Andreoli | 838d4b38c5 | |
Davide Andreoli | b821107688 | |
Davide Andreoli | e7545e3185 | |
Davide Andreoli | 5ac4f71131 | |
Davide Andreoli | 7e4116335a | |
Davide Andreoli | 26e2b89a9d | |
Davide Andreoli | 2d0668c548 | |
Davide Andreoli | a83da00bc7 | |
Davide Andreoli | 31a147fc7c | |
Davide Andreoli | 1f441a18c8 | |
Davide Andreoli | d7275844f1 | |
Davide Andreoli | f3c99eeafa | |
Davide Andreoli | 3dfacc01ab | |
Davide Andreoli | 22274ae81d | |
Davide Andreoli | 25ed1cc567 | |
Davide Andreoli | 22203c0838 | |
Davide Andreoli | 0253f9e178 | |
Davide Andreoli | 55e9e51f69 | |
Davide Andreoli | 5a81c2c944 | |
Davide Andreoli | 5a02f13210 | |
Davide Andreoli | 22cc200a61 | |
Davide Andreoli | 09e016bdbd | |
Davide Andreoli | bd81c36cd0 | |
Davide Andreoli | 81c48dd2d9 | |
Davide Andreoli | b9117cb590 | |
Davide Andreoli | 32aec52918 | |
Davide Andreoli | a7e86793c3 | |
Davide Andreoli | a1eeae15f8 | |
Davide Andreoli | 9ba5210a6a | |
Davide Andreoli | d61c596278 | |
Davide Andreoli | e2ce1b49a3 | |
Davide Andreoli | 8ff30f9edd | |
Davide Andreoli | d544412cd1 | |
Davide Andreoli | 3b0552259d | |
Davide Andreoli | 4fa39916ee | |
Davide Andreoli | 42ee207c16 | |
Davide Andreoli | c9f5b53e28 | |
Davide Andreoli | 8cc259ca26 | |
Davide Andreoli | d25784cca8 | |
Davide Andreoli | 7c555cc9da | |
Davide Andreoli | 3e198f7294 | |
Davide Andreoli | b855a82160 | |
Davide Andreoli | 583f42b131 | |
Davide Andreoli | 2991a6683e | |
Davide Andreoli | fb9b06931e | |
Davide Andreoli | 48d9c26945 | |
Davide Andreoli | 4721842b1e | |
Davide Andreoli | 6aa3501136 | |
Davide Andreoli | 18ca98e66f | |
Davide Andreoli | 006052543f | |
Davide Andreoli | 30c9c60b5d | |
Davide Andreoli | 26607a0986 | |
Davide Andreoli | ffc3c337dc | |
Davide Andreoli | 4b8ddcff7d | |
Davide Andreoli | 00d92cbebe | |
Davide Andreoli | f81fc890bb | |
Davide Andreoli | 28c9775898 | |
Davide Andreoli | 344da31ceb | |
Davide Andreoli | bc9d5648e7 | |
Davide Andreoli | 58ab1d26f7 | |
Davide Andreoli | fe144b8f96 | |
Davide Andreoli | efcebb52bf | |
Davide Andreoli | 7d3799d7fa | |
Davide Andreoli | 85e23f2851 | |
Davide Andreoli | c5759b6d67 | |
Davide Andreoli | 5bbaba2a6e | |
Davide Andreoli | 74ed9e86a4 | |
Davide Andreoli | 3ef64e685c | |
Davide Andreoli | 6e2b444712 | |
Davide Andreoli | 7d8049b0c5 | |
Davide Andreoli | 741000d423 | |
Davide Andreoli | fecc0c2604 | |
Davide Andreoli | 9d5efd8aef | |
Davide Andreoli | 25f620ef19 | |
Davide Andreoli | 6e80968778 | |
Davide Andreoli | 64584362b7 | |
Davide Andreoli | 8ad73b3e69 | |
Davide Andreoli | 5b9ba62e8f | |
Davide Andreoli | 26a4c38d67 | |
Davide Andreoli | 15b29e3ce8 | |
Davide Andreoli | 6bd7daa883 | |
Kai Huuhko | 5864a9dd2d | |
Kai Huuhko | a475ecba44 | |
Davide Andreoli | eace418f9b | |
Davide Andreoli | bb2a45f013 | |
Davide Andreoli | 8c7ad9f31f | |
Davide Andreoli | d9f06e72a2 | |
Davide Andreoli | df221788f0 | |
Davide Andreoli | 6a7e698368 | |
Davide Andreoli | 4557daa602 | |
Kai Huuhko | a70c42e681 | |
Davide Andreoli | d87e0a5484 | |
Davide Andreoli | 89bb6a1998 | |
Kai Huuhko | b06c3151f7 | |
Davide Andreoli | add166fb62 | |
Davide Andreoli | 7aec398ede | |
Davide Andreoli | da9258f474 | |
Davide Andreoli | 9c00cbb0fe | |
Davide Andreoli | 18e2d9c102 | |
Davide Andreoli | 71354b3bb8 | |
Davide Andreoli | a293b4e124 | |
Davide Andreoli | e3224c882a | |
Davide Andreoli | dccd0ed62f | |
Davide Andreoli | 9231e530bf | |
Davide Andreoli | 6f92607ba4 | |
Davide Andreoli | f76e272990 | |
Davide Andreoli | 3e0dbeb7f7 | |
Davide Andreoli | 98b7b2408f | |
Davide Andreoli | ac7013064f | |
Davide Andreoli | f2f8906968 | |
Davide Andreoli | 032750af77 | |
Davide Andreoli | 16fa850f24 | |
Davide Andreoli | 0b03f8b2f3 | |
Davide Andreoli | 810623dbe4 | |
Davide Andreoli | 01220931fc | |
Davide Andreoli | 924f291660 | |
Davide Andreoli | 2e5e96a8dd | |
Davide Andreoli | ea4bc8790d | |
Davide Andreoli | 9e25d34920 | |
Davide Andreoli | 953f468229 | |
Davide Andreoli | f872e7b8c6 | |
Davide Andreoli | e0d892ecaa | |
Davide Andreoli | cb062511b2 | |
Davide Andreoli | fa5b944f31 | |
Davide Andreoli | 99c618fc2b | |
Davide Andreoli | 1a2b8e64f8 | |
Kai Huuhko | 6ad9bb3521 | |
Kai Huuhko | 0217da6c1f | |
Kai Huuhko | f7e96cf0af | |
Kai Huuhko | 58cfedf5af | |
Kai Huuhko | 818e7db2e6 | |
Kai Huuhko | 6fa2d3ff95 | |
Davide Andreoli | 212eca4321 | |
Davide Andreoli | cca359974a | |
Kai Huuhko | f652b6e18f | |
Kai Huuhko | fdab8ed5b6 | |
Kai Huuhko | b2af779d7d | |
Davide Andreoli | 4bd421562d | |
Davide Andreoli | d6fc38ea59 | |
Davide Andreoli | 380e7a58ff | |
Davide Andreoli | 939cd71702 | |
Kai Huuhko | 0ef56b3a58 | |
Kai Huuhko | c955d488f9 | |
Kai Huuhko | a575effa6b | |
Davide Andreoli | 3d31901da7 | |
Davide Andreoli | 79979d9d2d | |
Davide Andreoli | a8c1486aad | |
Kai Huuhko | 54adcd9970 | |
Kai Huuhko | 96ae57ed6a | |
Davide Andreoli | eaa09b6b16 | |
Davide Andreoli | 6ff9589e83 | |
Davide Andreoli | 222f32eaf2 | |
Davide Andreoli | 5258779d41 | |
Davide Andreoli | 5342d77d60 | |
Davide Andreoli | 7066070992 | |
Davide Andreoli | cfb967333d | |
Davide Andreoli | 78d90dd467 | |
Kai Huuhko | 30c2ce90c3 | |
Kai Huuhko | 55039295f2 | |
Kai Huuhko | ad2ead12f7 | |
Kai Huuhko | ecd93319ee | |
Davide Andreoli | 187ca5249b | |
Davide Andreoli | a1bef554e0 | |
Davide Andreoli | 23c6ffc8cf | |
Davide Andreoli | 71946bffb3 | |
Davide Andreoli | bc411cd774 | |
Kai Huuhko | aeeee73fda | |
Davide Andreoli | 9fb954433e | |
Davide Andreoli | 4e57019e1e | |
Davide Andreoli | f59e7c0c18 | |
Davide Andreoli | e47f403a0b | |
Davide Andreoli | 2f1aff95c5 | |
Davide Andreoli | 01d334b5f6 | |
Davide Andreoli | 105743d304 | |
Davide Andreoli | c11a7cf227 | |
Davide Andreoli | 99113cd990 | |
Davide Andreoli | 9381d46765 | |
Davide Andreoli | 83656bff33 | |
Davide Andreoli | 48eec126bb | |
Davide Andreoli | b37c970587 | |
Davide Andreoli | 5a3c19b521 | |
Davide Andreoli | 02f7eb07dd | |
Davide Andreoli | 4a0310140a | |
Davide Andreoli | d87b3bb9d0 | |
Davide Andreoli | a19f0ad434 | |
Davide Andreoli | 11d23a94f1 | |
Davide Andreoli | f287a1f98c | |
Davide Andreoli | ffb294b82f | |
Kai Huuhko | 78c9fe21af | |
Kai Huuhko | 13ea0cbe1d | |
Kai Huuhko | f86234dd25 | |
Davide Andreoli | fbabb111d8 | |
Davide Andreoli | 283efd1a28 | |
Davide Andreoli | 12217e9c2a | |
Kai Huuhko | bc8bac1f1a | |
Kai Huuhko | 0916eae9ff | |
Kai Huuhko | d6bad7a838 | |
Davide Andreoli | 2ebc0dcf74 | |
Davide Andreoli | e2edab7b1c | |
Davide Andreoli | 11c7d38a56 | |
Davide Andreoli | 9b5b526620 | |
Davide Andreoli | 8f23c26d89 | |
Davide Andreoli | 5680c76a49 | |
Davide Andreoli | 082456600a | |
Davide Andreoli | be3069b280 | |
Davide Andreoli | 36ca39e015 | |
Davide Andreoli | 243664d738 | |
Davide Andreoli | e0456df2a2 | |
Davide Andreoli | 51946aaf8b | |
Davide Andreoli | cadf409404 | |
Davide Andreoli | 7fd0f973ca | |
Davide Andreoli | c2c09d4dc9 | |
Davide Andreoli | bae6125061 | |
Bernhard M. Wiedemann | 5bbbed95c0 | |
Davide Andreoli | eca2dfaa0b | |
Davide Andreoli | aba5250634 | |
Kai Huuhko | 41c1779e81 | |
Kai Huuhko | 77d023dfe1 | |
Kai Huuhko | 05c19962dc | |
Davide Andreoli | fea03a787c | |
Davide Andreoli | b6f729dc3a | |
Davide Andreoli | 6668176720 | |
Kai Huuhko | 9a3d441f1c | |
Kai Huuhko | d5656fdd3d | |
Kai Huuhko | ba7bf818d8 | |
Kai Huuhko | 1189e17fe0 | |
Kai Huuhko | fc987411da | |
Kai Huuhko | 523fe8ad4d | |
Kai Huuhko | 3661a78c96 | |
Kai Huuhko | caef23bb34 | |
Kai Huuhko | 684ad779dc | |
Davide Andreoli | 625500bffc | |
Davide Andreoli | 0ecf04eba9 | |
Davide Andreoli | 11d3007f02 | |
Davide Andreoli | cab804e69b | |
Davide Andreoli | 190d0aa7b6 | |
Davide Andreoli | 24318c8d33 | |
Kai Huuhko | 6980ffb0e4 | |
Kai Huuhko | fa69908d71 | |
Davide Andreoli | 86aa8c5138 | |
Davide Andreoli | 9809eb2739 | |
Davide Andreoli | 4f8dfc195f | |
Davide Andreoli | 078d440e05 | |
Davide Andreoli | e087d0d918 | |
Davide Andreoli | 920a8891e6 | |
Davide Andreoli | f03f83fba9 | |
Davide Andreoli | 926c325de8 | |
Davide Andreoli | 005dd26f73 | |
Davide Andreoli | 90595ffdca | |
Davide Andreoli | fc68b43317 | |
Davide Andreoli | 458121f6be | |
Davide Andreoli | f3e6315413 | |
Davide Andreoli | 592467c7bd | |
Davide Andreoli | 1599140196 | |
Davide Andreoli | 0021e4a186 | |
Davide Andreoli | 17df9e69aa | |
Davide Andreoli | 93d2c01002 | |
Davide Andreoli | e963e6d061 | |
Davide Andreoli | 8af35d3f56 | |
Kai Huuhko | 8f2baa86b5 | |
Kai Huuhko | 6c16e2f746 | |
Kai Huuhko | 16f7cb1a24 | |
Davide Andreoli | 06cb7ad598 | |
Kai Huuhko | 75fa5ff256 | |
Kai Huuhko | 5d73c59088 | |
Kai Huuhko | 453c2a123c | |
Davide Andreoli | 8e7616c1b3 | |
Davide Andreoli | 76e94bcbf8 | |
Davide Andreoli | eaf3110089 | |
Davide Andreoli | f01ac0788e | |
Davide Andreoli | d4f355f584 | |
Davide Andreoli | 5594375fac | |
Davide Andreoli | aceff14567 | |
Davide Andreoli | 8ad08e8ef8 | |
Davide Andreoli | ed5f93850f | |
Davide Andreoli | 435e57ca44 | |
Davide Andreoli | fd0b963651 | |
Davide Andreoli | a7c8b2d40d | |
Davide Andreoli | b82ed6f029 | |
Davide Andreoli | df1719d4c9 | |
Davide Andreoli | 3c20338884 | |
Davide Andreoli | 95846a8eaa | |
Davide Andreoli | e9c55b7f5e | |
Davide Andreoli | 28812962d5 | |
Davide Andreoli | 191ce5c22c | |
Davide Andreoli | 40ac305d0d | |
Davide Andreoli | d0026d6103 | |
Davide Andreoli | 1dc4053ce5 | |
Davide Andreoli | 7f132af8d6 | |
Davide Andreoli | 870611de99 | |
Davide Andreoli | 0834e66762 | |
Davide Andreoli | 43591f8b8e | |
Davide Andreoli | 3de1d7be24 | |
Davide Andreoli | 634c56d14c | |
Davide Andreoli | f3b3858902 | |
Davide Andreoli | f3df1b4cc9 | |
Davide Andreoli | 7f5c30c7fd | |
Davide Andreoli | 281cb65c1a | |
Davide Andreoli | 130f1db451 | |
Davide Andreoli | 97dadf30da | |
Davide Andreoli | 5e138dcdf2 | |
Davide Andreoli | 4ad8fc60ae | |
Kai Huuhko | 37930f389d | |
Davide Andreoli | ac685358bd | |
Davide Andreoli | 92c05e801a | |
Kai Huuhko | 3dd36bd770 | |
Kai Huuhko | 9b234a4266 | |
Kai Huuhko | a1f36bb073 | |
Davide Andreoli | dba05cc1ba |
|
@ -28,4 +28,9 @@ pip-log.txt
|
|||
# Cython generated files
|
||||
efl/*/*.c
|
||||
efl/*/*.h
|
||||
!efl/dbus_mainloop/e_dbus.*
|
||||
efl/*/*.html
|
||||
|
||||
# Various editors trash
|
||||
.idea/
|
||||
.vscode/
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
[MESSAGES CONTROL]
|
||||
|
||||
#enable=
|
||||
|
||||
disable=consider-using-f-string, # for older python we still support
|
||||
redundant-u-string-prefix, # for older python we still support
|
||||
invalid-name, # seems too pedantic to me
|
||||
missing-function-docstring,
|
||||
missing-class-docstring,
|
||||
missing-module-docstring,
|
154
CODING
154
CODING
|
@ -1,3 +1,28 @@
|
|||
TODO
|
||||
====
|
||||
* Automatically build and publish binary wheels on pypi
|
||||
- for py: 36,37,38,39,310
|
||||
- for linux x86 and rpi
|
||||
- see https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
||||
- see https://github.com/pypa/manylinux
|
||||
- also include efl itsef in the wheels? PySide is doing this
|
||||
|
||||
* Drop python 2 compatibility
|
||||
- Switch to cython3
|
||||
- remove all the workarounds for py2 (see strings and enums)
|
||||
|
||||
* Improved editors support, at least on VSCode and PyCharm
|
||||
|
||||
* Try to implement better the elementary module, removing
|
||||
the __init__ module hack (that create problems in the docs)
|
||||
|
||||
* Make the examples a first citizen!
|
||||
- install them with python efl
|
||||
- make them easily runnable
|
||||
- show them in the docs
|
||||
- show the code inside the examples themself?
|
||||
- make the code editable on the fly?
|
||||
|
||||
|
||||
Style
|
||||
=====
|
||||
|
@ -23,6 +48,46 @@ Style
|
|||
...also because I found it more readable and I like it more :P -davemds-
|
||||
|
||||
|
||||
Documentation cheatsheet
|
||||
========================
|
||||
|
||||
* Links:
|
||||
|
||||
:class:`List` (for classes)
|
||||
:func:`elm_list_go` (for functions)
|
||||
:attr:`homogeneous` (for properties)
|
||||
:ref:`Elm_List_Mode` (for enums)
|
||||
:data:`ELM_LIST_LIMIT` (for enum values)
|
||||
|
||||
:func:`efl.evas.Object.delete` (for items not in current scope)
|
||||
:func:`~efl.evas.Object.delete` (will show it short, just "delete")
|
||||
|
||||
* Formatting:
|
||||
|
||||
``ELM_LIST_SCROLL`` (for enum values, bools and None)
|
||||
|
||||
|
||||
* Versions:
|
||||
|
||||
.. versionadded:: 1.15
|
||||
|
||||
.. versionchanged:: 1.15
|
||||
Description of the change.
|
||||
|
||||
.. deprecated:: 1.15
|
||||
Use the blah, blah way instead.
|
||||
|
||||
* Notes:
|
||||
|
||||
.. seealso:: :py:attr:`mode`
|
||||
|
||||
.. note:: Some text to be noted, blah, blah, blah,
|
||||
some more information for this note, etc.
|
||||
|
||||
.. warning:: Same as note, but the box will be red
|
||||
some more information for this warning, etc.
|
||||
|
||||
|
||||
Design patterns
|
||||
===============
|
||||
|
||||
|
@ -58,61 +123,54 @@ Tips
|
|||
Release process instructions
|
||||
============================
|
||||
|
||||
* Announce at enlightenment-release@lists.sourceforge.net that you are planning
|
||||
for the release
|
||||
* Change versions in efl/__init__.py (ex: 1.9.0)
|
||||
* use "api_coverage.py --python elementary" to see the missing bindings
|
||||
|
||||
* Version:
|
||||
- change versions in efl/__init__.py (ex: 1.9.0)
|
||||
- update EFL_MIN_VER in setup.py (if needed)
|
||||
|
||||
* Update the ChangeLog file:
|
||||
setup.py build_doc -b changes ...and manually merge from the html file
|
||||
* Git push and wait jenkins to generate the 2 tarballs
|
||||
* Test the generated tarballs
|
||||
* scp tarballs & md5sums to:
|
||||
download.enlightenment.org:/srv/web/download.enlightenment.org/public_html/pre-releases/
|
||||
* Announce at enlightenment-release@lists.sourceforge.net that tarballs are
|
||||
ready for testing
|
||||
- setup.py build_doc -b changes ...and manually merge from the html file
|
||||
|
||||
... wait 24 hours, fix any issues found. In the mean time you can prepare the
|
||||
release announcement for phame/ml.
|
||||
* Generate the source (tar) and binary (wheel) distributions:
|
||||
- make maintainer-clean (just to be sure nothing is cached)
|
||||
- make dist
|
||||
|
||||
* Test the generated tarball and wheel:
|
||||
- the targz must work by extracting and running: python setup.py install [--user]
|
||||
- the targz must be installable using: pip install python-efl-1.9.0.tar.gz
|
||||
- the wheel must be installable using: pip install python_efl-1.9.0-xxxx.whl
|
||||
|
||||
* Publish the 2 tar archive on e.org:
|
||||
- scp tarballs & md5sums to:
|
||||
download.enlightenment.org:/srv/web/download.enlightenment.org/rel/bindings/python/
|
||||
- update download link on the wiki (www.enlightenment.org/download)
|
||||
|
||||
* Publish the .tar.gz archive on pypi:
|
||||
- twine upload python-efl-1.9.0.tar.gz [--repository testpypy]
|
||||
- TODO: also upload binary wheels for linux py36,37,38,39,310 (see manylinux on pypa)
|
||||
|
||||
* Documentation:
|
||||
- make doc (check that inheritance graphs are there)
|
||||
- scp the generated html documentation to:
|
||||
download.enlightenment.org:/srv/web/docs.enlightenment.org/python-efl/1.9.0/
|
||||
- update the 'current' link on the server (ssh)
|
||||
|
||||
* ssh to download.enlightenment.org and mv tarballs & md5sums to:
|
||||
/srv/web/download.enlightenment.org/public_html/rel/bindings/python
|
||||
* Upload the .tar.gz archive to pypi
|
||||
* Create and push the tag for the release
|
||||
git tag -a v1.9.0 && git push origin v1.9.0
|
||||
- git tag -a v1.9.0 && git push origin v1.9.0
|
||||
|
||||
* Create and push the branch for stable backporting
|
||||
git branch python-efl-1.9 && git push origin python-efl-1.9
|
||||
* Publish the blog post on phame (Official Announcements)
|
||||
* Announce the release to release@lists.enlightenment.org
|
||||
(an alias for e-announce etc.)
|
||||
* Update download link on website (clone website/www.git, edit, commit, push)
|
||||
|
||||
* Announce the release to release@lists.enlightenment.org and
|
||||
enlightenment-release@lists.sourceforge.net
|
||||
|
||||
* Change versions again in efl/__init__.py (ex: 1.9.99)
|
||||
|
||||
more info at:
|
||||
phab.enlightenment.org/w/release_procedure/
|
||||
for more info:
|
||||
--------------
|
||||
* packaging.python.org
|
||||
* phab.enlightenment.org/w/release_procedure/
|
||||
* phab.enlightenment.org/w/hosting/ssh/
|
||||
|
||||
|
||||
Discussion
|
||||
==========
|
||||
|
||||
* Internal utility functions used in the bindings must start with an
|
||||
underscore and must have the shortest name as possible.
|
||||
^
|
||||
This needs further discussion/expansion.
|
||||
|
||||
When we define a function with cdef it is not exposed to Python API.
|
||||
This should be explicit enough to not need the underscore prefix, which
|
||||
at best looks ugly, and at worst just plain confusing.
|
||||
|
||||
A function name should summarize its functionality in one clear text,
|
||||
short sentence. We have both too long and too short names. And I admit to
|
||||
being guilty of adding many of both.
|
||||
|
||||
Let's build up a short review so we can see where we stand with this and
|
||||
make necessary corrections.
|
||||
|
||||
/ kuuko
|
||||
|
||||
|
||||
The underscore usage is a coding standard in all the EFL, we should try
|
||||
to follow the efl style also here (where is possible and make sense)
|
||||
|
||||
/ davemds
|
||||
|
|
288
ChangeLog
288
ChangeLog
|
@ -1,16 +1,298 @@
|
|||
===================
|
||||
2015-08-03 v1.15.0
|
||||
2023-10-08 v1.26.1
|
||||
===================
|
||||
|
||||
Maintenance release:
|
||||
* rebuilt using Cython 0.29.34 to fix install on python 3.11
|
||||
|
||||
|
||||
===================
|
||||
2022-02-27 v1.26.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to setuptools for the build system (can now install from pip again)
|
||||
* Dropped py2.6 support, minimum is now 2.7
|
||||
* Deprecated python2 support, with a big-fat-slow warning
|
||||
* Improved documentation
|
||||
|
||||
Fixes:
|
||||
* Fixed a memory allocation error in EvasSmart
|
||||
|
||||
|
||||
===================
|
||||
2020-09-24 v1.25.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.21 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2020-04-30 v1.24.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.16 for the tarball generation
|
||||
* No more pypi packages uploaded, you must install from tarball
|
||||
|
||||
|
||||
===================
|
||||
2019-10-06 v1.23.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.13 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2019-04-23 v1.22.0
|
||||
===================
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.29.7 for the tarball generation
|
||||
|
||||
|
||||
===================
|
||||
2018-08-24 v1.21.0
|
||||
===================
|
||||
|
||||
BREAKS:
|
||||
* systray.pxi do not work anymore as the widget has been removed from efl.
|
||||
The widget has been completly removed and the function elm_need_systray
|
||||
now always return False that means systray is not available.
|
||||
Apologies for the inconvenient.
|
||||
|
||||
Changes:
|
||||
* Switched to Cython 0.28.4 for the tarball generation, should fix build
|
||||
issues with python3.7
|
||||
|
||||
Additions:
|
||||
* ecore.ECORE_EXE_ISOLATE_IO
|
||||
* edje.part_text_prediction_hint_hash_del
|
||||
* edje.part_text_prediction_hint_hash_set
|
||||
* elm.Entry.prediction_hint_hash_del
|
||||
* elm.Entry.prediction_hint_hash_set
|
||||
* elm.Ctxpopup.item_insert_after
|
||||
* elm.Ctxpopup.item_insert_before
|
||||
|
||||
|
||||
===================
|
||||
2017-05-06 v1.20.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* ecore.input and ecore.x can now coexsist
|
||||
|
||||
Changes:
|
||||
* ecore.Poller is no more an Eo object in C (nothing should be changed in py)
|
||||
* removed edje.Object custom __repr__ implementation
|
||||
* Use Cython 23.5 to generate the C source in dist tarball (see T5589)
|
||||
|
||||
Additions:
|
||||
* elm.Entry.prediction_hint
|
||||
* elm.Genlist.multi_select_mode
|
||||
* elm.Menu.open()
|
||||
* elm.Spinner.callback_max_reached_add()
|
||||
* elm.Spinner.callback_max_reached_del()
|
||||
* edje.part_text_prediction_hint_set()
|
||||
* evas.Map.coords_get()
|
||||
|
||||
|
||||
===================
|
||||
2017-04-18 v1.19.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* Fixes for cython 0.25 compatibility
|
||||
* elm.font_properties_get
|
||||
* elm.Gengrid.item_insert_after now work as expected
|
||||
|
||||
Changes:
|
||||
* Removed ecore warning about subprocess incompatibility, with test to prove it
|
||||
* Emotion: changed default module_name to "gstreamer1"
|
||||
* elm.font_properties_free: Changed to no-op as we now do the free
|
||||
automatically when there are no more references to the FontProperties object
|
||||
* elm.Panel.scrollable_content_size is now also readable
|
||||
* EcoreConUrl is no more an Eo object in C
|
||||
|
||||
Additions:
|
||||
* evas.Image.load_head_skip
|
||||
* elm.ELM_INPUT_PANEL_LAYOUT_VOICE
|
||||
* elm.ELM_CALENDAR_REVERSE_DAILY
|
||||
* elm.Calendar.date_max
|
||||
* elm.Calendar.date_min
|
||||
* elm.GengridItem.custom_size
|
||||
* elm.Image.async_open
|
||||
* elm.Image.callback_load_cancel_add
|
||||
* elm.Image.callback_load_error_add
|
||||
* elm.Image.callback_load_open_add
|
||||
* elm.Image.callback_load_ready_add
|
||||
* elm.Naviframe.callback_item_activated_add
|
||||
* elm.Panel.callback_toggled_add
|
||||
* elm.Progressbar.is_pulsing
|
||||
* elm.Spinner.callback_drag_start_add
|
||||
* elm.Spinner.callback_drag_stop_add
|
||||
|
||||
|
||||
===================
|
||||
2016-08-22 v1.18.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
* Fixed (workaround) dbus crash on python >= 3.5
|
||||
* Fixed Logger module to not fail on unicode error messages
|
||||
|
||||
Changes:
|
||||
* Changed enums implementation to gain compatibility with Cython > 0.22
|
||||
* Docs: Allow to skip last_updated and sphinx_version
|
||||
* elm.Combobox: The combobox widget has been deprecated.
|
||||
* elm.Photo.editable property is now also readable
|
||||
* elm.Photo.fill_inside property is now also readable
|
||||
* elm.Photo.size property is now also readable
|
||||
|
||||
Additions:
|
||||
* ecore.Exe.is_deleted
|
||||
* ecore.FdHandler.is_deleted
|
||||
* edje.Edje.part_box_insert_after
|
||||
* elm.Configuration.accel_preference_override
|
||||
* elm.Configuration.first_item_focus_on_first_focusin
|
||||
* elm.Configuration.font_hint_type
|
||||
* elm.Configuration.icon_theme
|
||||
* elm.Configuration.popup_scrollable
|
||||
* elm.Configuration.scroll_accel_factor
|
||||
* elm.Configuration.scroll_animation_disabled
|
||||
* elm.Configuration.vsync
|
||||
* elm.Configuration.web_backend
|
||||
* elm.Entry.file_text_format
|
||||
* elm.Entry.select_allow
|
||||
* elm.Entry.select_region
|
||||
* elm.GengridItem.all_contents_unset
|
||||
* elm.Genlist.filtered_items_count
|
||||
* elm.GenlistItem.all_contents_unset
|
||||
* elm.List.multi_select_mode (and the Elm_Object_Multi_Select_Mode enum)
|
||||
* elm.Object.focus_move_policy_automatic
|
||||
* elm.Popup.align
|
||||
* elm.Popup.scrollable
|
||||
* elm.Slider.range
|
||||
* elm.Slider.range_enabled
|
||||
* elm.Slider.indicator_show_on_focus
|
||||
* elm.Transit.revert
|
||||
* elm.Window.noblank
|
||||
|
||||
|
||||
==================
|
||||
2016-01-7 v1.17.0
|
||||
==================
|
||||
|
||||
Fixes:
|
||||
* Fixed compatibility with python 3.5 (utils.deprecated was broken)
|
||||
* Various ref leaks fixed in elementary
|
||||
* Multibuttonentry filter callback
|
||||
|
||||
Additions:
|
||||
* ecore_input Module
|
||||
* ecore_con Module
|
||||
* ecore_con.Url Class
|
||||
* ecore_con.Lookup Class
|
||||
* evas.Object.paragraph_direction
|
||||
* evas.EVAS_BIDI_DIRECTION_INHERIT
|
||||
* edje.Edje.color_class_clear
|
||||
* edje.Edje.size_class_del
|
||||
* edje.Edje.size_class_get
|
||||
* edje.Edje.size_class_set
|
||||
* edje.Edje.text_class_del
|
||||
* edje.size_class_del
|
||||
* edje.size_class_get
|
||||
* edje.size_class_list
|
||||
* edje.size_class_set
|
||||
* ethumb Module
|
||||
* ethumb.Ethumb Class
|
||||
* ethumb_client Module
|
||||
* ethumb_client.EthumbClient Class
|
||||
* elm.Combobox Class
|
||||
* elm.Configuration.context_menu_disabled
|
||||
* elm.Configuration.profile_derived_add
|
||||
* elm.Configuration.profile_derived_del
|
||||
* elm.Configuration.profile_exists
|
||||
* elm.Configuration.profile_list_full
|
||||
* elm.Configuration.profile_save
|
||||
* elm.Ctxpopup.callback_geometry_update_add
|
||||
* elm.ELM_GENGRID_ITEM_SCROLLTO_BOTTOM
|
||||
* elm.Gengrid.drag_item_container_add
|
||||
* elm.Gengrid.drag_item_container_del
|
||||
* elm.Gengrid.drop_item_container_add
|
||||
* elm.Gengrid.drop_item_container_del
|
||||
* elm.ELM_GENLIST_ITEM_SCROLLTO_BOTTTOM
|
||||
* elm.Genlist.callback_filter_done_add
|
||||
* elm.Genlist.drag_item_container_add
|
||||
* elm.Genlist.drag_item_container_del
|
||||
* elm.Genlist.drop_item_container_add
|
||||
* elm.Genlist.drop_item_container_del
|
||||
* elm.Genlist.filter
|
||||
* elm.MultiButtonEntry.filter_remove
|
||||
* elm.Notify.callback_dismissed_add
|
||||
* elm.Notify.dismiss
|
||||
* elm.Object.callback_moved_add
|
||||
* elm.Object.drag_action_set
|
||||
* elm.Object.drag_start
|
||||
* elm.Object.drop_target_add
|
||||
* elm.Object.drop_target_del
|
||||
* elm.Popup.callback_dismissed_add
|
||||
* elm.Popup.dismiss
|
||||
|
||||
|
||||
===================
|
||||
2015-11-14 v1.16.0
|
||||
===================
|
||||
|
||||
Additions:
|
||||
|
||||
* elm.Configuration.scroll_thumbscroll_smooth_amount
|
||||
* elm.Configuration.scroll_thumbscroll_smooth_start
|
||||
* elm.Configuration.scroll_thumbscroll_smooth_time_window
|
||||
* elm.Genlist.callback_changed_add
|
||||
* elm.GenlistItem.data is now also writable
|
||||
* elm.Object.focus_next_item_get
|
||||
* elm.Object.focus_next_item_set
|
||||
* elm.Object.focus_region_show_mode
|
||||
* elm.Object.tooltip_orient
|
||||
* elm.ObjectItem.focus_next_item_get
|
||||
* elm.ObjectItem.focus_next_item_set
|
||||
* elm.ObjectItem.focus_next_object_get
|
||||
* elm.ObjectItem.focus_next_object_set
|
||||
|
||||
|
||||
===================
|
||||
2015-08-05 v1.15.0
|
||||
===================
|
||||
|
||||
Fixes:
|
||||
|
||||
Improvements:
|
||||
* elm.Entry: Fixed name of the callback_rejected_del function
|
||||
* Fixed build on OSX
|
||||
* Fixed build when ecore-x is not available
|
||||
* Fixed module init from embedded interpreter
|
||||
|
||||
|
||||
Changes:
|
||||
|
||||
* Elm: Unify modules into a monolithic module
|
||||
|
||||
|
||||
Additions:
|
||||
|
||||
Deprecation:
|
||||
* elm.Configuration.transition_duration_factor
|
||||
* elm.Window.autohide
|
||||
* elm.ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN
|
||||
* elm.Entry.callback_context_open_add/del
|
||||
* elm.ELM_FOCUS_MOVE_POLICY_KEY_ONLY
|
||||
* elm.Object.focus_move_policy
|
||||
* elm.Scrollable.wheel_disabled
|
||||
* evas.Textblock.obstacle_add
|
||||
* evas.Textblock.obstacle_del
|
||||
* evas.Textblock.obstacles_update
|
||||
* evas.EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE
|
||||
|
||||
|
||||
===================
|
||||
|
|
18
INSTALL
18
INSTALL
|
@ -3,22 +3,19 @@
|
|||
===============
|
||||
|
||||
* Python 2.6 or higher, 3.2 or higher (http://www.python.org/)
|
||||
- Tested with Python 2.7 / 3.3 / 3.4
|
||||
- Tested with Python 3.8
|
||||
|
||||
* Cython 0.21 or higher (http://cython.org/)
|
||||
- Tested with Cython 0.21.2
|
||||
- Tested with Cython 0.29.16
|
||||
|
||||
* EFL core library
|
||||
- eo, evas, ecore, edje, emotion and elementary
|
||||
|
||||
* pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
|
||||
- Windows executable (and GLib dependency) can be downloaded from
|
||||
http://www.gtk.org/download/win32.php
|
||||
* EFL must be the same minor version of the bindings,
|
||||
es. python-efl 1.24 need efl 1.24
|
||||
|
||||
* To build the DOCS you will also need:
|
||||
- python-sphinx
|
||||
- [optional] graphviz
|
||||
|
||||
* At least 4GB of free RAM to build
|
||||
|
||||
|
||||
2. BUILDING PYTHON-EFL
|
||||
|
@ -29,6 +26,11 @@
|
|||
|
||||
python setup.py build
|
||||
|
||||
IMPORTANT NOTE:
|
||||
To build the bindings you will need at least 4GB of free ram!
|
||||
Otherwise the build process will badly fail.
|
||||
|
||||
|
||||
Distribution tarballs include pre-generated C source files, so
|
||||
cython usage is disabled by default, while is enabled in development git
|
||||
versions. You can always force the usage of cython using two environment
|
||||
|
|
25
Makefile
25
Makefile
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
|
||||
|
||||
PY = python
|
||||
PY = python3
|
||||
|
||||
|
||||
.PHONY: build
|
||||
|
@ -29,6 +29,11 @@ install:
|
|||
$(PY) setup.py install
|
||||
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(PY) setup.py uninstall
|
||||
|
||||
|
||||
.PHONY: doc
|
||||
doc:
|
||||
$(PY) setup.py build build_doc
|
||||
|
@ -44,12 +49,20 @@ clean:
|
|||
$(PY) setup.py clean --all
|
||||
|
||||
|
||||
.PHONY: maintaner-clean
|
||||
maintaner-clean:
|
||||
.PHONY: maintainer-clean
|
||||
maintainer-clean:
|
||||
$(PY) setup.py clean --all clean_generated_files
|
||||
rm -rf build/
|
||||
rm -rf dist/
|
||||
rm -rf python_efl.egg-info/
|
||||
rm -f installed_files-*.txt
|
||||
|
||||
|
||||
.PHONY: dist
|
||||
dist:
|
||||
$(PY) setup.py sdist --formats=gztar,bztar
|
||||
|
||||
|
||||
$(PY) setup.py sdist --formats=gztar,xztar
|
||||
$(PY) setup.py bdist_wheel
|
||||
@cd dist/; for f in `ls *.tar.*` ; do \
|
||||
echo Generating sha256 for: $$f ; \
|
||||
sha256sum $$f > $$f.sha256; \
|
||||
done
|
||||
|
|
7
README
7
README
|
@ -1,7 +0,0 @@
|
|||
|
||||
EFL is a collection of libraries for handling many common tasks a
|
||||
developer man have such as data structures, communication, rendering,
|
||||
widgets and more.
|
||||
|
||||
PYTHON-EFL are the python bindings for the whole EFL stack (eo, evas, ecore,
|
||||
edje, emotion, ethumb and elementary)
|
|
@ -0,0 +1,92 @@
|
|||
# Python bindings for the EFL
|
||||
|
||||
EFL, or the *Enlightenment Foundation Libraries*, is a collection of libraries for handling many common tasks such as data structures, communication, rendering, widgets and more. Read more on the [efl web site](https://www.enlightenment.org/about-efl).
|
||||
|
||||
Python-EFL are the python bindings for the whole EFL stack (evas, ecore, edje, emotion, ethumb and elementary). You can use Python-EFL to build a portable GUI application in minutes.
|
||||
|
||||
The documentation for Python-EFL is available [here](https://docs.enlightenment.org/python-efl/current/).
|
||||
|
||||
## Install from pypi
|
||||
|
||||
The last stable release is always available on pypi, and pip is the raccomanded way to install Python-EFL:
|
||||
```
|
||||
pip install python-efl
|
||||
```
|
||||
The only requirement is to have the EFL already installed on your machine, see [here](https://www.enlightenment.org/docs/distros/start) for install instructions for various linux distro or for building EFL from sources.
|
||||
|
||||
NOTE: Currently only sources packages are available on pip, this means that the installation will be quite long as it need to compile all the modules, and that you need a C compiler for installation to work (we highly suggest to use clang as your C compiler). For the next release we have plans to also upload binary packages on pypi, so the installation will be blazing fast and will have zero dependencies!
|
||||
|
||||
|
||||
## Install from released tarballs
|
||||
|
||||
All the stable releases of python-efl can always be found at:
|
||||
https://download.enlightenment.org/rel/bindings/python/
|
||||
|
||||
To install download and unpack a tarball and run:
|
||||
```
|
||||
python setup.py build
|
||||
python setup.py install --user
|
||||
or
|
||||
sudo python setup.py install (for sistem-wide installation)
|
||||
```
|
||||
|
||||
NOTE: due to strange cython+gcc behaviour we highly suggest to build python-efl using clang. If you experience issues using gcc (like memory exhausted or strange compile errors) just use clang in this way:
|
||||
|
||||
```
|
||||
CC=clang python setup.py build
|
||||
```
|
||||
|
||||
## Source repository
|
||||
|
||||
If you would like to contribute to Python-EFL and make changes to the Python-EFL code you need to build from **git**. Development take place in the **master** branch, while we backport bugfixes in the release branches. You will find a branch for each released version, branches are named as **python-efl-X.X**.
|
||||
|
||||
To build from git you also need to have [Cython](https://cython.org/) installed.
|
||||
|
||||
### Main repository
|
||||
https://git.enlightenment.org/bindings/python/python-efl.git/
|
||||
|
||||
### GitHub repository
|
||||
https://github.com/DaveMDS/python-efl
|
||||
|
||||
The GitHub repo has been created to simplify the workflow for people that do
|
||||
not have a git account in the E repo, and thus improving collaboration.
|
||||
Feel free to make pull requests on GitHub.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for the last stable release can be found [here](https://docs.enlightenment.org/python-efl/current/).
|
||||
Additionally you can generate the documentation yourself from the source code using the following command:
|
||||
```
|
||||
python setup.py build build_doc
|
||||
```
|
||||
The HTML generated documentation will be available in the folder: `build/sphinx/html/`
|
||||
|
||||
## Some of the projects using Python-EFL (in random order)
|
||||
|
||||
| **Project** | **Website** |
|
||||
|-------------------------------------|------------------------------------------------------|
|
||||
| **EpyMC** - Media Center | https://github.com/DaveMDS/epymc |
|
||||
| **Espionage** - D-Bus inspector | https://phab.enlightenment.org/w/projects/espionage/ |
|
||||
| **Epour** - BitTorrent Client | https://phab.enlightenment.org/w/projects/epour/ |
|
||||
| **Eluminance** - Fast photo browser | https://github.com/DaveMDS/eluminance |
|
||||
| **Egitu** - Git User Interface | https://github.com/DaveMDS/egitu |
|
||||
| **Edone** - GettingThingsDone | https://github.com/DaveMDS/edone |
|
||||
| **Epack** - Archive extractor | https://github.com/wfx/epack |
|
||||
|
||||
... and many more that cannot fit in this short list. If have some code and want it in this list just let us know.
|
||||
|
||||
|
||||
## A short history of Python-EFL
|
||||
|
||||
Python-EFL was begun in 2007 by work of Gustavo Sverzut Barbieri and others while working for Nokia on the software project Canola Media Player. The language bindings were initially developed for the individual components of EFL, until merged together in 2013.
|
||||
|
||||
He was later joined by Ulisses Furquim Freire da Silva, who together formed the company ProFUSION embedded systems where the developement continued and a new software project called Editje was created, which uses the Python bindings for most of its functionality.
|
||||
|
||||
Python-EFL gained many more developers, also at this time an independent application project called EpyMC was created by Davide Andreoli.
|
||||
|
||||
In the beginning of the year 2011 the developement was practically halted. In 2012 Davide Andreoli picked up the developement and Kai Huuhko (@kuuko) joined him shortly after. Work at this time was focused on finishing the Python bindings for Elementary, the toolkit library.
|
||||
|
||||
In 2013 the individual components were merged together and a new documentation system was implemented, enabling easier access for the end-user developers.
|
||||
|
||||
Currently (as in 2022) the bindings are still actively maintained and improved by Davide Andreoli, in his effort to bring to python a powerfull and attractive UI toolkit.
|
45
TODO
45
TODO
|
@ -1,45 +0,0 @@
|
|||
|
||||
BUGS
|
||||
====
|
||||
* EdjeEdit: PartState API does not work
|
||||
* Elm.Map: overlays_show segfaults, scrollers in examples are jumpy
|
||||
* Elementary: when we use custom function callbacks we usually leak some
|
||||
reference around, some examples:
|
||||
- Fileselector.custom_filter_append()
|
||||
- Multibuttonentry.format_function_set()
|
||||
- Multibuttonentry.filter_append()
|
||||
- Multibuttonentry.filterprepend()
|
||||
|
||||
Failing unit tests
|
||||
------------------
|
||||
* tests.edje.test_04_edit: testPartEffect (marked as known failure)
|
||||
* tests.edje.test_04_edit: testGroupDel (skipped, segfault)
|
||||
* tests.edje.test_04_edit: testExternal (skipped, TODO)
|
||||
|
||||
TODO
|
||||
====
|
||||
* update links and text on:
|
||||
http://www.freedesktop.org/wiki/Software/DBusBindings
|
||||
(requires fd.org shell account?)
|
||||
* Review the internal functions and name them consistently
|
||||
* Evas: SmartObject needs testing
|
||||
* Improve ethumb
|
||||
* edje: complete the unit tests
|
||||
* Initial Evas GL support (for Elm)
|
||||
* Add more documentation for callbacks, events, etc.
|
||||
* Check for missing Eo type mappings
|
||||
|
||||
Elm
|
||||
---
|
||||
* Drag-n-Drop
|
||||
* Automate compilation of the example edje files.
|
||||
* Add more examples
|
||||
* Prefs (only supports simple types, not so great for us)
|
||||
* GLView
|
||||
* Unit tests
|
||||
* Images missing in the documentation:
|
||||
- datetime
|
||||
- systray
|
||||
- video
|
||||
- web
|
||||
- window ?
|
|
@ -24,6 +24,12 @@ c_exclude_list = [
|
|||
"elm_access", # Access disabled until 1.9
|
||||
"elm_config_access", # Access disabled until 1.9
|
||||
"elm_object_item_access", # Access disabled until 1.9
|
||||
"elm_systray", # We currently have this in using Eo API
|
||||
"elm_code_", # The code widget is still in beta
|
||||
"elm_need_e_dbus", # has been deprecated long time ago
|
||||
"elm_check_selected_get", # We already provide state_get
|
||||
"elm_check_selected_set", # We already provide state_set
|
||||
|
||||
]
|
||||
c_excludes = "|".join(c_exclude_list)
|
||||
|
||||
|
@ -163,7 +169,9 @@ def get_pyapis(pxd_path, header_name, prefix):
|
|||
|
||||
for path, dirs, files in os.walk(pxd_path):
|
||||
for f in files:
|
||||
if not f.endswith(".pxd"):
|
||||
# if not f.endswith(".pxd"):
|
||||
# continue
|
||||
if f.endswith(".pyc"):
|
||||
continue
|
||||
open_args = (os.path.join(path, f),)
|
||||
open_kwargs = dict(mode="r")
|
||||
|
|
153
doc/Makefile
153
doc/Makefile
|
@ -1,153 +0,0 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PythonBindingsforEnlightenmentFoundationLibraries.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PythonBindingsforEnlightenmentFoundationLibraries.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/PythonBindingsforEnlightenmentFoundationLibraries"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PythonBindingsforEnlightenmentFoundationLibraries"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
307
doc/conf.py
307
doc/conf.py
|
@ -1,40 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Python Bindings for EFL Elementary documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Jun 28 09:21:25 2012.
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
import sys, os, platform
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
|
||||
d = "lib.%s-%s-%d.%d" % (
|
||||
platform.system().lower(),
|
||||
platform.machine(),
|
||||
sys.version_info[0],
|
||||
sys.version_info[1]
|
||||
)
|
||||
sys.path.insert(0, os.path.abspath("../build/"+d))
|
||||
#sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
|
||||
# add these directories to sys.path here.
|
||||
d = 'lib.%s-%s-%d.%d' % (
|
||||
platform.system().lower(),
|
||||
platform.machine(),
|
||||
sys.version_info[0],
|
||||
sys.version_info[1]
|
||||
)
|
||||
sys.path.insert(0, os.path.abspath('../build/' + d))
|
||||
# sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
|
||||
|
||||
# Delete any previously imported efl package
|
||||
if "efl" in sys.modules:
|
||||
del sys.modules["efl"]
|
||||
if 'efl' in sys.modules:
|
||||
del sys.modules['efl']
|
||||
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'Python EFL'
|
||||
author = 'The Python-EFL community (see AUTHORS)'
|
||||
copyright = '2008-2022, ' + author # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = '1.1'
|
||||
needs_sphinx = '3.1'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
|
@ -46,113 +53,36 @@ extensions = [
|
|||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Python EFL'
|
||||
copyright = u'2008-2015, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
# version = 'X.Y'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
# release = 'X.Y.Z'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
# master_doc = 'index'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'monokai'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# Setting this True will show missing references as warnings.
|
||||
#nitpicky = True
|
||||
|
||||
# nitpick_ignore = [
|
||||
# ('py:obj', 'int'),
|
||||
# ('py:obj', 'float'),
|
||||
# ('py:obj', 'double'),
|
||||
# ('py:obj', 'callable'),
|
||||
# ('py:obj', 'function'),
|
||||
# ('py:obj', 'str'),
|
||||
# ('py:exc', 'RuntimeError'),
|
||||
# ('py:exc', 'RuntimeWarning'),
|
||||
# ('py:exc', 'ValueError'),
|
||||
# ('py:exc', 'TypeError'),
|
||||
# ('py:obj', 'Evas_Coord (int)'),
|
||||
# ('py:obj', 'string'),
|
||||
# ('py:obj', 'list'),
|
||||
# ('py:class', 'object'),
|
||||
# ('py:obj', 'unicode'),
|
||||
# ('py:obj', 'bool'),
|
||||
# ('py:obj', 'tuple of ints'),
|
||||
# ('py:class', 'efl.eo.Eo'),
|
||||
# ('py:attr', 'efl.eo.Eo.data'),
|
||||
# ('py:obj', 'datetime.date'),
|
||||
# ]
|
||||
|
||||
|
||||
# -- Autodoc configuration -----------------------------------------------------
|
||||
|
||||
autodoc_default_flags = [
|
||||
'members',
|
||||
'show-inheritance',
|
||||
# 'inherited-members',
|
||||
# 'undoc-members',
|
||||
]
|
||||
autoclass_content = "both"
|
||||
autodoc_docstring_signature = True
|
||||
# autodoc_member_order = "bysource"
|
||||
autodoc_default_options = {
|
||||
'members': True, # show methods for classes
|
||||
'show-inheritance': True, # show bases class
|
||||
'member-order': 'alphabetical', # bysource, alphabetical, groupwise
|
||||
'no-undoc-members': True, # dont show members without docstring
|
||||
'no-inherited-members': True, # dont show members from parent classes
|
||||
}
|
||||
# both the class’ and the __init__ method’s docstring are concatenated
|
||||
autoclass_content = 'both'
|
||||
|
||||
def setup(app):
|
||||
from sphinx.ext.autodoc import cut_lines
|
||||
app.connect('autodoc-process-signature', autodoc_process_signature)
|
||||
app.connect('autodoc-process-docstring', cut_lines(1, what=['class']))
|
||||
|
||||
def autodoc_process_signature(app, what, name, obj, options, signature, return_annotation):
|
||||
def autodoc_process_signature(_app, what, _name, _obj, _options, signature, return_annotation):
|
||||
"""Cleanup params: remove the 'self' param and all the cython types"""
|
||||
|
||||
if what not in ('function', 'method'):
|
||||
return
|
||||
return None
|
||||
|
||||
params = list()
|
||||
params = []
|
||||
for param in (p.strip() for p in signature[1:-1].split(',')):
|
||||
if param != 'self':
|
||||
params.append(param.rpartition(' ')[2])
|
||||
|
@ -163,28 +93,28 @@ def autodoc_process_signature(app, what, name, obj, options, signature, return_a
|
|||
# -- Inheritance Diagram ------------------------------------------------------
|
||||
|
||||
try:
|
||||
import gv
|
||||
import gv # pylint: disable=unused-import
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
extensions.append('sphinx.ext.inheritance_diagram')
|
||||
# svg scale better (look at the full elm dia)
|
||||
# but svg links are broken :(
|
||||
graphviz_output_format = "svg" # png (default) or svg
|
||||
graphviz_output_format = 'png' # png (default) or svg
|
||||
inheritance_graph_attrs = dict(
|
||||
bgcolor = 'gray25', #404040
|
||||
bgcolor = 'gray25', #404040
|
||||
)
|
||||
inheritance_node_attrs = dict(
|
||||
style = 'rounded', # or 'filled',
|
||||
# fillcolor = "gray20", # bg color (should be #CCCCCC)
|
||||
color = 'gray10', # border color (should be #202020)
|
||||
style = 'rounded', # or 'filled',
|
||||
# fillcolor = 'gray20', # bg color (should be #CCCCCC)
|
||||
color = 'gray10', # border color (should be #202020)
|
||||
fontcolor = 'white',
|
||||
font = 'sans',
|
||||
|
||||
)
|
||||
inheritance_edge_attrs = dict(
|
||||
color = 'dodgerblue3', # arrow color (should be #4399FF)
|
||||
dir = 'none', # arrow direction (back, forward, both or none)
|
||||
color = 'dodgerblue3', # arrow color (should be #4399FF)
|
||||
dir = 'none', # arrow direction (back, forward, both or none)
|
||||
)
|
||||
|
||||
|
||||
|
@ -193,10 +123,11 @@ else:
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
# html_theme = 'alabaster' # Default sphinx theme
|
||||
# html_theme = 'default' # Classic python style
|
||||
# html_theme = 'sphinxdoc' # Much modern sphinx style
|
||||
# html_theme = 'sphinx13' # The latest one from the sphinx site
|
||||
html_theme = 'efldoc' # EFL dark style
|
||||
html_theme = 'efldoc' # Our custom EFL dark style
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
|
@ -211,16 +142,16 @@ html_theme_path = ['themes']
|
|||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
html_short_title = "Python EFL"
|
||||
html_short_title = 'Python EFL'
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
html_logo = "images/logo.png"
|
||||
html_logo = 'images/logo.png'
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
html_favicon = "images/logo.ico"
|
||||
html_favicon = 'images/logo.ico'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
|
@ -231,10 +162,6 @@ html_static_path = ['images']
|
|||
# using the given strftime format.
|
||||
html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
|
@ -270,121 +197,3 @@ html_show_sourcelink = False
|
|||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'PythonEFLdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'PythonEFL.tex', u'Python Bindings for EFL Documentation',
|
||||
u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'python-efl', u'Python Bindings for EFL Documentation',
|
||||
[u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'PythonBindingsforEFLElementary', u'Python Bindings for EFL Elementary Documentation',
|
||||
u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko', 'PythonBindingsforEFLElementary', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
|
||||
# -- Options for Epub output ---------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Python Bindings for EFL'
|
||||
epub_author = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
epub_publisher = u'Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
epub_copyright = u'2008-2015, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or en if the language is not set.
|
||||
#epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
#epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#epub_cover = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_pre_files = []
|
||||
|
||||
# HTML files shat should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
#epub_exclude_files = []
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ecore_con
|
||||
|
||||
:class:`efl.ecore_con.Lookup` Class
|
||||
===================================
|
||||
|
||||
.. autoclass:: efl.ecore_con.Lookup
|
|
@ -0,0 +1,9 @@
|
|||
.. currentmodule:: efl.ecore_con
|
||||
|
||||
:class:`efl.ecore_con.Url` Class
|
||||
===================================
|
||||
|
||||
.. autoclass:: efl.ecore_con.Url
|
||||
.. autoclass:: efl.ecore_con.EventUrlComplete
|
||||
.. autoclass:: efl.ecore_con.EventUrlProgress
|
||||
.. autoclass:: efl.ecore_con.EventUrlData
|
|
@ -15,8 +15,8 @@ great responsiveness without the need for threads(or any other concurrency).
|
|||
Timers
|
||||
------
|
||||
|
||||
:py:class:`Timers<efl.ecore.Timer>` serve two main purposes: doing something at a specified time and
|
||||
repeatedly doing something with a set interval.
|
||||
:py:class:`Timers<efl.ecore.Timer>` serve two main purposes: doing something at
|
||||
a specified time and repeatedly doing something with a set interval.
|
||||
|
||||
|
||||
Animators
|
||||
|
@ -73,14 +73,6 @@ error. Any valid file descriptor can be used with this API, regardless of if
|
|||
was gotten with an OS specific API or from ecore.
|
||||
see :py:class:`FdHandler<efl.ecore.FdHandler>`
|
||||
|
||||
File download
|
||||
-------------
|
||||
|
||||
Ecore provide the :py:class:`FileDownload<efl.ecore.FileDownload>` class
|
||||
to perform asyncronous download of files from the net. Two callbacks are
|
||||
used to inform the user while progress occurs and when the download has
|
||||
finished.
|
||||
|
||||
|
||||
File monitor
|
||||
------------
|
||||
|
@ -91,6 +83,25 @@ Events will be generatd everytime a file or directory (that live in the
|
|||
give path) is created/deleted/modified.
|
||||
|
||||
|
||||
File download
|
||||
-------------
|
||||
|
||||
Ecore provide the :py:class:`FileDownload<efl.ecore.FileDownload>` class
|
||||
to perform asyncronous download of files from the net. Two callbacks are
|
||||
used to inform the user while progress occurs and when the download has
|
||||
finished.
|
||||
|
||||
|
||||
Ecore Con
|
||||
---------
|
||||
|
||||
The ecore_con module provide various utilities to perform different network
|
||||
related tasks. Everything provided in a fully async way. Most notable are the
|
||||
:class:`efl.ecore_con.Lookup` class to perform DNS requests, the
|
||||
:class:`efl.ecore_con.Url` class to perform HTTP requests and the
|
||||
:class:`efl.ecore_con.Server` class to implement your own server.
|
||||
|
||||
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
@ -99,6 +110,8 @@ API Reference
|
|||
:titlesonly:
|
||||
|
||||
module-ecore
|
||||
module-ecore_input
|
||||
module-ecore_con
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
.. automodule:: efl.ecore_con
|
||||
:exclude-members: Url, EventUrlComplete, EventUrlProgress, EventUrlData,
|
||||
Lookup, ConEventFilter
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ecore_input
|
||||
|
22
doc/efl.rst
22
doc/efl.rst
|
@ -6,10 +6,30 @@
|
|||
.. versionadded:: 1.8
|
||||
|
||||
|
||||
Object lifetime
|
||||
---------------
|
||||
|
||||
Eo objects (and any which have the delete() method) get their reference count
|
||||
internally increased by one at object creation. This means that these objects
|
||||
will not get freed when you release all references to them in your application.
|
||||
You must call the objects' delete() method to decrease the internal reference
|
||||
count. This will usually also trigger some kind of action to destroy
|
||||
the object gracefully, i.e. hiding the graphical object etc, and will set the
|
||||
C object pointer to NULL, which will prevent you from calling methods on the
|
||||
object.
|
||||
|
||||
If you can't keep track of when your application calls the delete method, you
|
||||
can check that your object is still valid with either the is_deleted() method,
|
||||
or with a non-zero check::
|
||||
|
||||
if eo_obj:
|
||||
print(repr(eo_obj))
|
||||
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
PyEFL provides `logging <http://docs.python.org/2/library/logging.html>`_
|
||||
PyEFL provides `logging <https://docs.python.org/library/logging.html>`_
|
||||
to loggers which are usually named after their equivalent module,
|
||||
f.e. *efl.eo*. There is a root logger called *efl* which also receives
|
||||
any messages coming from the underlying C libraries.
|
||||
|
|
|
@ -50,8 +50,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``clicked`` - This is called when a user has clicked the bubble.
|
||||
- ``focused`` - When the bubble has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the bubble has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -50,8 +50,6 @@ Emitted signals
|
|||
- ``repeated``: the user pressed the button without releasing it.
|
||||
- ``pressed``: button was pressed.
|
||||
- ``unpressed``: button was released after being pressed.
|
||||
- ``focused`` : When the button has received focus. (since 1.8)
|
||||
- ``unfocused`` : When the button has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
|
|
@ -28,8 +28,6 @@ Emitted signals
|
|||
- ``changed`` - emitted when the date in the calendar is changed.
|
||||
- ``display,changed`` - emitted when the current month displayed in the
|
||||
calendar is changed.
|
||||
- ``focused`` - When the calendar has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the calendar has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
@ -73,6 +71,12 @@ Calendar mark repeat types
|
|||
Marks will be displayed every last day of month after event day
|
||||
(inclusive).
|
||||
|
||||
.. data:: ELM_CALENDAR_REVERSE_DAILY
|
||||
|
||||
Marks will be displayed every day before event day.
|
||||
|
||||
.. versionadded:: 1.19
|
||||
|
||||
|
||||
.. _Elm_Calendar_Select_Mode:
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ Emitted signals
|
|||
|
||||
- ``changed`` - This is called whenever the user changes the state of
|
||||
the check objects.
|
||||
- ``focused`` - When the check has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the check has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -39,8 +39,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``changed`` - the clock's user changed the time
|
||||
- ``focused`` - When the clock has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the clock has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -28,8 +28,6 @@ Emitted signals
|
|||
- ``"color,item,longpressed"`` - When user long presses on color item.
|
||||
The event_info parameter of the callback will be the selected
|
||||
color item.
|
||||
- ``focused`` - When the colorselector has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the colorselector has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
.. currentmodule:: efl.elementary
|
||||
|
||||
Combobox
|
||||
########
|
||||
|
||||
.. warning::
|
||||
**THE COMBOBOX IS BROKEN AND DEPRECATED, DO NOT USE IN ANY CASE !!**
|
||||
|
||||
The behaviour and the API of the Combobox will change in future release.
|
||||
|
||||
If you are already using this we really encourage you to switch
|
||||
to other widgets.
|
||||
|
||||
We are really sorry about this breakage, but there is nothing we can do
|
||||
to avoid this :(
|
||||
|
||||
.. image:: /images/combobox-preview.png
|
||||
|
||||
Widget description
|
||||
==================
|
||||
|
||||
This is a the classic combobox widget, it is the composition of a
|
||||
:class:`Button`, an :class:`Entry`, a :class:`Genlist` and an :class:`Hover`.
|
||||
Thus you can use all the functionality of the base classes on the
|
||||
:class:`Combobox` itself.
|
||||
|
||||
|
||||
Available styles
|
||||
================
|
||||
|
||||
- ``default`` a normal combobox.
|
||||
|
||||
|
||||
Emitted signals
|
||||
===============
|
||||
|
||||
- ``dismissed``: The combobox hover has been dismissed.
|
||||
- ``expanded``: The combobox hover has been expanded.
|
||||
- ``clicked``: The combobox button has been clicked.
|
||||
- ``item,selected``: An item has been selected (highlighted).
|
||||
- ``item,pressed``: An item has been pressed (clicked).
|
||||
- ``filter,done``: Item filtering on genlist is completed.
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
||||
.. inheritance-diagram:: Combobox
|
||||
:parts: 2
|
||||
|
||||
|
||||
.. autoclass:: _Combobox
|
||||
.. autoclass:: Combobox
|
||||
|
|
@ -27,10 +27,8 @@ Emitted signals
|
|||
or 2. its parent area is changed or 3. the language is changed and also when
|
||||
4. the parent object is resized due to the window rotation. Then ctxpopup is
|
||||
dismissed.
|
||||
- ``language,changed`` - This is called when the program's language is
|
||||
changed.
|
||||
- ``focused`` - When the ctxpopup has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the ctxpopup has lost focus. (since 1.8)
|
||||
|
||||
- ``geometry,update`` - The geometry has changed (since 1.17)
|
||||
|
||||
Layout content parts
|
||||
====================
|
||||
|
|
|
@ -172,9 +172,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``changed`` - whenever Datetime field value is changed, this signal is sent.
|
||||
- ``language,changed`` - whenever system locale changes, this signal is sent.
|
||||
- ``focused`` - When the datetime has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the datetime has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -50,7 +50,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``dayselector,changed`` - when the user changes the state of a day.
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -26,8 +26,6 @@ Emitted signals
|
|||
- ``scroll,anim,stop`` - scrolling animation has stopped
|
||||
- ``scroll,drag,start`` - dragging the diskselector has started
|
||||
- ``scroll,drag,stop`` - dragging the diskselector has stopped
|
||||
- ``focused`` - When the diskselector has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the diskselector has lost focus. (since 1.8)
|
||||
|
||||
.. note:: The ``scroll,anim,*`` and ``scroll,drag,*`` signals are only emitted
|
||||
by user intervention.
|
||||
|
|
|
@ -115,6 +115,12 @@ Quit policy types
|
|||
|
||||
Quit when the application's last window is closed
|
||||
|
||||
.. data:: ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN
|
||||
|
||||
Quit when the application's last window is hidden
|
||||
|
||||
.. versionadded:: 1.15
|
||||
|
||||
|
||||
.. _Elm_Policy_Exit:
|
||||
|
||||
|
@ -152,6 +158,24 @@ Possible values for the #ELM_POLICY_THROTTLE policy.
|
|||
Never throttle when windows are all hidden, regardless of config settings.
|
||||
|
||||
|
||||
.. _Elm_Object_Multi_Select_Mode:
|
||||
|
||||
Object multi select policy values
|
||||
---------------------------------
|
||||
|
||||
Possible values for the #ELM_OBJECT_MULTI_SELECT_MODE policy.
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
.. data:: ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT
|
||||
|
||||
Default multiple select mode.
|
||||
|
||||
.. data:: ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL
|
||||
|
||||
Disallow mutiple selection when clicked without control key pressed.
|
||||
|
||||
|
||||
.. _Elm_Process_State:
|
||||
|
||||
Elm_Process_State
|
||||
|
@ -396,6 +420,7 @@ Inheritance diagram
|
|||
efl.elementary.Check
|
||||
efl.elementary.Clock
|
||||
efl.elementary.Colorselector
|
||||
efl.elementary.Combobox
|
||||
efl.elementary.Configuration
|
||||
efl.elementary.Conformant
|
||||
efl.elementary.Ctxpopup
|
||||
|
@ -444,7 +469,6 @@ Inheritance diagram
|
|||
efl.elementary.Slider
|
||||
efl.elementary.Slideshow
|
||||
efl.elementary.Spinner
|
||||
efl.elementary.Systray
|
||||
efl.elementary.Table
|
||||
efl.elementary.Theme
|
||||
efl.elementary.Thumb
|
||||
|
|
|
@ -223,8 +223,6 @@ Emitted signals
|
|||
- ``clicked``: The entry has been clicked (mouse press and release).
|
||||
- ``clicked,double``: The entry has been double clicked.
|
||||
- ``clicked,triple``: The entry has been triple clicked.
|
||||
- ``focused``: The entry has received focus.
|
||||
- ``unfocused``: The entry has lost focus.
|
||||
- ``selection,paste``: A paste of the clipboard contents was requested.
|
||||
- ``selection,copy``: A copy of the selected text into the clipboard was
|
||||
requested.
|
||||
|
@ -246,7 +244,6 @@ Emitted signals
|
|||
- ``anchor,down``: Mouse button has been pressed on an anchor. The event_info
|
||||
parameter for the callback will be an :py:class:`EntryAnchorInfo`.
|
||||
- ``preedit,changed``: The preedit string has changed.
|
||||
- ``language,changed``: Program language changed.
|
||||
- ``text,set,done``: Whole text has been set to the entry.
|
||||
- ``rejected``: .Called when some of inputs are rejected by the filter. (since 1.9)
|
||||
|
||||
|
@ -411,6 +408,12 @@ Input panel layouts
|
|||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
.. data:: ELM_INPUT_PANEL_LAYOUT_VOICE
|
||||
|
||||
Voice layout, but if the IME does not support voice, then normal layout will be shown
|
||||
|
||||
.. versionadded:: 1.19
|
||||
|
||||
|
||||
.. _Elm_Input_Panel_Layout_Normal_Variation:
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ Emitted signals
|
|||
|
||||
- ``file,chosen`` - the user has selected a path which comes as the
|
||||
``event_info`` data
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Layout text parts
|
||||
|
|
|
@ -39,8 +39,6 @@ Emitted signals
|
|||
couple seconds
|
||||
- ``clicked`` - The entry has been clicked
|
||||
- ``clicked,double`` - The entry has been double clicked
|
||||
- ``focused`` - The entry has received focus
|
||||
- ``unfocused`` - The entry has lost focus
|
||||
- ``selection,paste`` - A paste action has occurred on the
|
||||
entry
|
||||
- ``selection,copy`` - A copy action has occurred on the entry
|
||||
|
@ -50,7 +48,6 @@ Emitted signals
|
|||
- ``file,chosen`` - The user has selected a path via the file
|
||||
selector entry's internal file selector, whose string
|
||||
comes as the ``event_info`` data.
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Layout text parts
|
||||
|
|
|
@ -29,8 +29,6 @@ Emitted signals
|
|||
from the first item in its list to the last
|
||||
- ``underflowed`` - when the widget's current selection is changed
|
||||
from the last item in its list to the first
|
||||
- ``focused`` - When the flipselector has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the flipselector has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Layout text parts
|
||||
|
|
|
@ -233,11 +233,6 @@ Emitted signals
|
|||
when the user releases an item or keyboard selection is moved so the item
|
||||
is physically unhighlighted. The ``event_info`` parameter is the item that
|
||||
was unhighlighted.
|
||||
- ``language,changed`` - This is called when the program's language is
|
||||
changed. Call :meth:`~Gengrid.realized_items_update` if items text should
|
||||
be translated.
|
||||
- ``focused`` - When the gengrid has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the gengrid has lost focus. (since 1.8)
|
||||
- ``item,focused`` - When the gengrid item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - When the gengrid item has lost focus. (since 1.10)
|
||||
- ``item,reorder,anim,start`` - This is called when a gengrid item movement
|
||||
|
@ -271,6 +266,12 @@ Items' scroll to types
|
|||
|
||||
Scroll to the middle of viewport
|
||||
|
||||
.. data:: ELM_GENGRID_ITEM_SCROLLTO_BOTTOM
|
||||
|
||||
Scroll to the bottom of viewport
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
|
||||
.. _Elm_Gengrid_Object_Multi_Select_Mode:
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ Elementary that could have more flexible items and allow many more
|
|||
entries while still being fast and low on memory usage. At the same time
|
||||
it was also made to be able to do tree structures. But the price to pay
|
||||
is more complexity when it comes to usage. If all you want is a simple
|
||||
list with icons and a single text, use the normal
|
||||
:py:class:`~efl.elementary.list.List` object.
|
||||
list (not much items) with icons and a single text, use the normal
|
||||
:class:`List` object.
|
||||
|
||||
Genlist has a fairly large API, mostly because it's relatively complex,
|
||||
trying to be both expansive, powerful and efficient. First we will begin
|
||||
|
@ -26,63 +26,45 @@ Genlist item classes - creating items
|
|||
=====================================
|
||||
|
||||
In order to have the ability to add and delete items on the fly, genlist
|
||||
implements a class (callback) system where the application provides a
|
||||
implements the item class (callback) system where the application provides a
|
||||
structure with information about that type of item (genlist may contain
|
||||
multiple different items with different classes, states and styles).
|
||||
Genlist will call the functions in this struct (methods) when an item is
|
||||
Genlist will call the functions in this class (methods) when an item is
|
||||
"realized" (i.e., created dynamically, while the user is scrolling the
|
||||
grid). All objects will simply be deleted when no longer needed with
|
||||
:py:meth:`~efl.evas.Object.delete`. :py:class:`GenlistItemClass` contains the
|
||||
:func:`efl.evas.Object.delete`. :class:`GenlistItemClass` contains the
|
||||
following members:
|
||||
|
||||
- ``item_style`` - This is a constant string and simply defines the name
|
||||
of the item style. It **must** be specified and the default should be
|
||||
``"default".``
|
||||
- ``decorate_item_style`` - This is a constant string and simply defines
|
||||
the name of the decorate mode item style. It is used to specify
|
||||
decorate mode item style. It can be used when you call
|
||||
:py:attr:`GenlistItem.decorate_mode`.
|
||||
- ``decorate_all_item_style`` - This is a constant string and simply
|
||||
defines the name of the decorate all item style. It is used to specify
|
||||
decorate all item style. It can be used to set selection, checking and
|
||||
deletion mode. This is used when you call
|
||||
:py:attr:`Genlist.decorate_mode`.
|
||||
- ``func`` - A struct with pointers to functions that will be called when
|
||||
an item is going to be actually created. All of them receive a ``data``
|
||||
parameter that will point to the same data passed to
|
||||
:py:meth:`GenlistItem.append_to` and related item creation functions, and an
|
||||
``obj`` parameter that points to the genlist object itself.
|
||||
|
||||
The function pointers inside ``func`` are ``text_get``, ``content_get``,
|
||||
``state_get`` and ``del``. The 3 first functions also receive a ``part``
|
||||
parameter described below. A brief description of these functions follows:
|
||||
|
||||
- ``text_get`` - The ``part`` parameter is the name string of one of the
|
||||
existing text parts in the Edje group implementing the item's theme.
|
||||
See :py:meth:`GenlistItemClass.text_get`.
|
||||
- ``content_get`` - The ``part`` parameter is the name string of one of the
|
||||
existing (content) swallow parts in the Edje group implementing the
|
||||
item's theme. It must return ``None``, when no content is desired, or
|
||||
a valid object handle, otherwise. The object will be deleted by the
|
||||
- ``item_style`` - This is a constant string and define the name of the default
|
||||
item style. It **must** be provided.
|
||||
- ``decorate_item_style`` - This is a constant string and define the name of
|
||||
the style to be used in the "decorate" mode.
|
||||
See :attr:`GenlistItem.decorate_mode`.
|
||||
- ``decorate_all_item_style`` - This is a constant string and
|
||||
define the name of the style to be used in the "decorate all" mode.
|
||||
See :attr:`Genlist.decorate_mode`.
|
||||
- ``text_get`` - This function will be called for every text part. Should
|
||||
return the text to display. See :func:`GenlistItemClass.text_get`.
|
||||
- ``content_get`` - This function will be called for every content part.
|
||||
Should return an object to display, the object will be deleted by the
|
||||
genlist on its deletion or when the item is "unrealized". See
|
||||
:py:meth:`GenlistItemClass.content_get`.
|
||||
- ``func.state_get`` - The ``part`` parameter is the name string of one of
|
||||
the state parts in the Edje group implementing the item's theme. Return
|
||||
``False`` for false/off or ``True`` for true/on. Genlists will
|
||||
:func:`GenlistItemClass.content_get`.
|
||||
- ``state_get`` - This function will be called for every state part. Must
|
||||
return ``True`` for false/off or ``True`` for true/on. Genlists will
|
||||
emit a signal to its theming Edje object with ``"elm,state,xxx,active"``
|
||||
and ``"elm"`` as "emission" and "source" arguments, respectively, when
|
||||
the state is true (the default is false), where ``xxx`` is the name of
|
||||
the (state) part. See :py:meth:`GenlistItemClass.state_get`.
|
||||
the (state) part. See :func:`GenlistItemClass.state_get`.
|
||||
- ``func.del`` - This is intended for use when genlist items are deleted,
|
||||
so any data attached to the item (e.g. its data parameter on creation)
|
||||
can be deleted. See :py:meth:`GenlistItemClass.delete`.
|
||||
can be deleted. See :func:`GenlistItemClass.delete`.
|
||||
|
||||
|
||||
Available item styles
|
||||
=====================
|
||||
|
||||
- ``default``
|
||||
- ``default_style`` The text part is a textblock
|
||||
- ``default`` The default style: icon, text, end icon
|
||||
- ``default_style`` The text part is a textblock and can use markups
|
||||
- ``double_label`` Two different text parts
|
||||
- ``icon_top_text_bottom``
|
||||
- ``group_index``
|
||||
|
@ -91,6 +73,7 @@ Available item styles
|
|||
- ``no_icon`` No icon (since: 1.1)
|
||||
- ``full`` Only one object, elm.swallow.content, which consumes whole area of
|
||||
the genlist item (since: 1.7)
|
||||
- ``indent`` Has indentation to match tree group items (since: 1.19)
|
||||
|
||||
|
||||
Structure of items
|
||||
|
@ -109,11 +92,6 @@ spaces in the data fields. For the default genlist item theme, we have
|
|||
**one** text part (``elm.text``), **two** content parts
|
||||
(``elm.swallow.icon`` and ``elm.swallow.end``) and **no** state parts.
|
||||
|
||||
A genlist item may be at one of several styles. Elementary provides one
|
||||
by default - "default", but this can be extended by system or application
|
||||
custom themes/overlays/extensions (see :py:mod:`themes<efl.elementary.theme>`)
|
||||
for more details).
|
||||
|
||||
|
||||
Editing and Navigating
|
||||
======================
|
||||
|
@ -147,7 +125,7 @@ item. :py:meth:`GenlistItem.subitems_clear` will clear all items that are
|
|||
children of the indicated parent item.
|
||||
|
||||
To help inspect list items you can jump to the item at the top of the list
|
||||
with :py:attr:`Genlist.first_item` which will return the item pointer, and
|
||||
with :py:attr:`Genlist.first_item` which will return the first item, and
|
||||
similarly :py:attr:`Genlist.last_item` gets the item at the end of the list.
|
||||
:py:attr:`GenlistItem.next` and :py:attr:`GenlistItem.prev` get the next
|
||||
and previous items respectively relative to the indicated item. Using
|
||||
|
@ -367,10 +345,11 @@ Emitted signals
|
|||
when the user releases an item or keyboard selection is moved so the item
|
||||
is physically unhighlighted. The ``event_info`` parameter is the item that
|
||||
was unhighlighted.
|
||||
- ``focused`` - When the genlist has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the genlist has lost focus. (since 1.8)
|
||||
- ``item,focused`` - When the genlist item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - When the genlist item has lost focus. (since 1.10)
|
||||
- ``changed`` - Genlist is now changed their items and properties and all
|
||||
calculation is finished. (since 1.16)
|
||||
- ``filter,done`` - Genlist filter operation is completed.. (since 1.17)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
@ -437,6 +416,12 @@ Genlist items' scroll-to types
|
|||
|
||||
Scroll to the middle of viewport
|
||||
|
||||
.. data:: ELM_GENLIST_ITEM_SCROLLTO_BOTTTOM
|
||||
|
||||
Scroll to the bottom of viewport
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
|
|
@ -39,8 +39,6 @@ Emitted signals
|
|||
(since 1.8)
|
||||
- ``smart,changed`` - a content object placed under the "smart"
|
||||
policy was replaced to a new slot direction.
|
||||
- ``focused`` - When the hover has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the hover has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -38,6 +38,13 @@ Emitted signals
|
|||
- ``download,progress`` - url download in progress
|
||||
- ``download,end`` - remote url download has finished
|
||||
- ``download,error`` - remote url download has finished with errors
|
||||
- ``load,open`` - Triggered when the file has been opened, if async open is
|
||||
enabled (image size is known). (since 1.19)
|
||||
- ``load,ready`` - Triggered when the image file is ready for display, if
|
||||
preload is enabled. (since 1.19)
|
||||
- ``load,error`` - Triggered if an async I/O or decoding error occurred, if
|
||||
async open or preload is enabled (since 1.19)
|
||||
- ``load,cancel`` - Triggered whenener async I/O was cancelled. (since 1.19)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -42,9 +42,6 @@ Emitted signals
|
|||
level to the second level
|
||||
- ``level,down`` - when the user moves a finger from the second
|
||||
level to the first level
|
||||
- ``language,changed`` - the program's language changed
|
||||
- ``focused`` - When the index has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the index has lost focus. (since 1.8)
|
||||
|
||||
The ``delay,changed`` event has a delay on change before the event is actually
|
||||
reported and moreover just the last event happening on those time frames will
|
||||
|
|
|
@ -20,9 +20,17 @@ Available styles
|
|||
================
|
||||
|
||||
``default``
|
||||
No animation
|
||||
The default style
|
||||
``default/left``
|
||||
Left aligned label (since 1.18)
|
||||
``default/right``
|
||||
Right aligned label (since 1.18)
|
||||
``marker``
|
||||
Centers the text in the label and makes it bold by default
|
||||
``marker/left``
|
||||
Like marker but left aligned (since 1.18)
|
||||
``marker/right``
|
||||
Like marker but right aligned (since 1.18)
|
||||
``slide_long``
|
||||
The entire text appears from the right of the screen and
|
||||
slides until it disappears in the left of the screen(reappearing on
|
||||
|
@ -43,7 +51,6 @@ they like.
|
|||
Emitted signals
|
||||
===============
|
||||
|
||||
- ``language,changed`` - The program's language changed.
|
||||
- ``slide,end`` - The slide is end.
|
||||
|
||||
|
||||
|
|
|
@ -151,7 +151,6 @@ Emitted signals
|
|||
===============
|
||||
|
||||
- ``theme,changed`` - The theme was changed.
|
||||
- ``language,changed`` - the program's language changed
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
|
|
@ -38,9 +38,6 @@ Emitted signals
|
|||
- ``unhighlighted`` - an item in the list is unhighlighted. This is called
|
||||
when the user releases an item or keyboard selection is moved so the item
|
||||
is physically unhighlighted.
|
||||
- ``language,changed`` - the program's language changed
|
||||
- ``focused`` - When the list has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the list has lost focus. (since 1.8)
|
||||
- ``item,focused`` - When the list item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - When the list item has lost focus. (since 1.10)
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@ Emitted signals
|
|||
- ``name,loaded,fail`` - Name request fails.
|
||||
- ``overlay,clicked`` - A overlay is clicked.
|
||||
- ``loaded`` - when a map is finally loaded.
|
||||
- ``language,changed`` - the program's language changed
|
||||
- ``focused`` - When the map has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the map has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Scrollable Interface
|
||||
|
@ -200,3 +197,13 @@ Inheritance diagram
|
|||
|
||||
|
||||
.. autoclass:: Map
|
||||
.. autoclass:: MapRoute
|
||||
.. autoclass:: MapName
|
||||
.. autoclass:: MapOverlay
|
||||
.. autoclass:: MapOverlayClass
|
||||
.. autoclass:: MapOverlayBubble
|
||||
.. autoclass:: MapOverlayLine
|
||||
.. autoclass:: MapOverlayPolygon
|
||||
.. autoclass:: MapOverlayCircle
|
||||
.. autoclass:: MapOverlayScale
|
||||
.. autoclass:: MapOverlayRoute
|
||||
|
|
|
@ -36,13 +36,12 @@ Emitted signals
|
|||
interaction. Both "item,selected" and "item,clicked" are needed.
|
||||
event_info contains the item.
|
||||
- ``clicked`` - when multi-button entry is clicked.
|
||||
- ``focused`` - when multi-button entry is focused.
|
||||
- ``unfocused`` - when multi-button entry is unfocused.
|
||||
- ``expanded`` - when multi-button entry is expanded.
|
||||
- ``contracted`` - when multi-button entry is contracted.
|
||||
- ``expand,state,changed`` - when shrink mode state of
|
||||
multi-button entry is changed.
|
||||
|
||||
|
||||
Layout text parts
|
||||
=================
|
||||
|
||||
|
@ -58,3 +57,4 @@ Inheritance diagram
|
|||
|
||||
|
||||
.. autoclass:: MultiButtonEntry
|
||||
.. autoclass:: MultiButtonEntryItem
|
||||
|
|
|
@ -65,8 +65,7 @@ Emitted signals
|
|||
- ``transition,finished`` - When the transition is finished in changing the item
|
||||
- ``title,transition,finished`` - When the title area's transition is finished
|
||||
- ``title,clicked`` - User clicked title area
|
||||
- ``focused`` - When the naviframe has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the naviframe has lost focus. (since 1.8)
|
||||
- ``item,activated`` - Naviframe item was activated (since 1.19)
|
||||
|
||||
All the parts, for content and text, described here will also be
|
||||
reachable by naviframe **items** direct calls:
|
||||
|
|
|
@ -21,6 +21,7 @@ Emitted signals
|
|||
|
||||
- ``timeout`` - when timeout happens on notify and it's hidden
|
||||
- ``block,clicked`` - when a click outside of the notify happens
|
||||
- ``dismissed`` - When notify is closed as a result of a dismiss (since 1.17)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -47,6 +47,15 @@ More information is on
|
|||
- X11R6 Inter-Client Communication Conventions Manual, section 2
|
||||
|
||||
|
||||
Emitted smart events
|
||||
====================
|
||||
|
||||
- ``moved`` - When the object change position. (since 1.17)
|
||||
- ``focus`` - When the object has received focus. (since 1.8)
|
||||
- ``unfocus`` - When the object has lost focus. (since 1.8)
|
||||
- ``language,changed`` - Whenever system locale changes.
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
|
@ -105,6 +114,12 @@ Focus move policy
|
|||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
.. data:: ELM_FOCUS_MOVE_POLICY_KEY_ONLY
|
||||
|
||||
Focus is set on key input like Left, Right, Up, Down, Tab, or Shift+Tab
|
||||
|
||||
.. versionadded:: 1.15
|
||||
|
||||
|
||||
.. _Elm_Focus_Autoscroll_Mode:
|
||||
|
||||
|
@ -131,6 +146,24 @@ Focus autoscroll mode
|
|||
.. versionadded:: 1.10
|
||||
|
||||
|
||||
.. _Elm_Focus_Region_Show_Mode:
|
||||
|
||||
Focus region show mode
|
||||
----------------------
|
||||
|
||||
.. data:: ELM_FOCUS_REGION_SHOW_WIDGET
|
||||
|
||||
as a widget
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_FOCUS_REGION_SHOW_ITEM
|
||||
|
||||
as an item
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
|
||||
.. _Elm_Input_Event_Type:
|
||||
|
||||
Input event types
|
||||
|
@ -272,6 +305,79 @@ Selection modes
|
|||
No select mode with no finger size rule
|
||||
|
||||
|
||||
.. _Elm_Tooltip_Orient:
|
||||
|
||||
Tooltip orientation
|
||||
-------------------
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_NONE
|
||||
|
||||
Default value, Tooltip moves with mouse pointer
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_TOP_LEFT
|
||||
|
||||
Tooltip should appear at the top left of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_TOP
|
||||
|
||||
Tooltip should appear at the top of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_TOP_RIGHT
|
||||
|
||||
Tooltip should appear at the top right of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_LEFT
|
||||
|
||||
Tooltip should appear at the left of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_CENTER
|
||||
|
||||
Tooltip should appear at the center of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_RIGHT
|
||||
|
||||
Tooltip should appear at the right of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_BOTTOM_LEFT
|
||||
|
||||
Tooltip should appear at the bottom left of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_BOTTOM
|
||||
|
||||
Tooltip should appear at the bottom of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT
|
||||
|
||||
Tooltip should appear at the bottom right of parent
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
.. data:: ELM_TOOLTIP_ORIENT_LAST
|
||||
|
||||
Sentinel value, don't use
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
||||
|
|
|
@ -17,8 +17,7 @@ It can be expanded or contracted by clicking the button on it's edge.
|
|||
Emitted signals
|
||||
===============
|
||||
|
||||
- ``focused`` - When the panel has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the panel has lost focus. (since 1.8)
|
||||
- ``toggled`` - Emitted when the panel has been toggled. (since 1.19)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -41,8 +41,6 @@ Emitted signals
|
|||
- ``download,progress`` - url download in progress
|
||||
- ``download,end`` - remote url download has finished
|
||||
- ``download,error`` - remote url download has finished with errors
|
||||
- ``focused`` - When the photocam has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the photocam has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Scrollable Interface
|
||||
|
|
|
@ -69,11 +69,9 @@ Emitted signals
|
|||
|
||||
- ``timeout`` - when ever popup is closed as a result of timeout.
|
||||
- ``block,clicked`` - when ever user taps on Blocked Event area.
|
||||
- ``focused`` - When the popup has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the popup has lost focus. (since 1.8)
|
||||
- ``language,changed`` - the program's language changed (since 1.8)
|
||||
- ``item,focused`` - the popup item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - the popup item has lost focus. (since 1.10)
|
||||
- ``dismissed`` - the popup has been dismissed. (since 1.17)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -34,8 +34,7 @@ This widget emits the following signals, besides the ones sent from
|
|||
:py:class:`~efl.elementary.layout_class.LayoutClass`:
|
||||
|
||||
- ``changed`` - when the value is changed
|
||||
- ``focused`` - When the progressbar has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the progressbar has lost focus. (since 1.8)
|
||||
|
||||
|
||||
This widget has the following styles:
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ Emitted signals
|
|||
|
||||
- ``changed`` - This is called whenever the user changes the state of one of
|
||||
the radio objects within the group of radio objects that work together.
|
||||
- ``focused`` - When the radio has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the radio has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Layout text parts
|
||||
|
|
|
@ -50,8 +50,6 @@ Emitted signals
|
|||
- ``hbar,press`` - the horizontal scroll bar has been pressed
|
||||
- ``hbar,unpress`` - the horizontal scroll bar has been unpressed
|
||||
- ``scroll,page,changed`` - the visible page has changed
|
||||
- ``focused`` - When the scroller has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the scroller has lost focus. (since 1.8)
|
||||
|
||||
.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by
|
||||
user intervention.
|
||||
|
@ -134,3 +132,4 @@ Inheritance diagram
|
|||
|
||||
|
||||
.. autoclass:: Scroller
|
||||
.. autoclass:: Scrollable
|
||||
|
|
|
@ -48,3 +48,4 @@ Inheritance diagram
|
|||
|
||||
|
||||
.. autoclass:: SegmentControl
|
||||
.. autoclass:: SegmentControlItem
|
||||
|
|
|
@ -43,8 +43,6 @@ Emitted signals
|
|||
the user. This will be called only when the user stops dragging
|
||||
for a very short period or when they release their finger/mouse,
|
||||
so it avoids possibly expensive reactions to the value change.
|
||||
- ``focused`` - When the slider has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the slider has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Layout content parts
|
||||
|
|
|
@ -60,8 +60,6 @@ Emitted signals
|
|||
event_info parameter in callback contains the current visible item
|
||||
- ``transition,end`` - when a slide transition ends. event_info
|
||||
parameter in callback contains the current visible item
|
||||
- ``focused`` - When the slideshow has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the slideshow has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
|
@ -72,3 +70,5 @@ Inheritance diagram
|
|||
|
||||
|
||||
.. autoclass:: Slideshow
|
||||
.. autoclass:: SlideshowItem
|
||||
.. autoclass:: SlideshowItemClass
|
||||
|
|
|
@ -31,9 +31,10 @@ Emitted signals
|
|||
the user. This will be called only when the user stops dragging
|
||||
for a very short period or when they release their finger/mouse,
|
||||
so it avoids possibly expensive reactions to the value change.
|
||||
- ``language,changed`` - the program's language changed
|
||||
- ``focused`` - When the spinner has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the spinner has lost focus. (since 1.8)
|
||||
- ``spinner,drag,start`` - When dragging has started.
|
||||
- ``spinner,drag,stop`` - When dragging has stopped.
|
||||
- ``min,reached`` - Called when spinner value reached min (since 1.20)
|
||||
- ``max,reached`` - Called when spinner value reached max (since 1.20)
|
||||
|
||||
|
||||
Available styles
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
.. currentmodule:: efl.elementary
|
||||
|
||||
Systray
|
||||
#######
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
.. _Elm_Systray_Category:
|
||||
|
||||
Category of the Status Notifier Item.
|
||||
-------------------------------------
|
||||
|
||||
.. data:: ELM_SYSTRAY_CATEGORY_APP_STATUS
|
||||
|
||||
Indicators of application status
|
||||
|
||||
.. data:: ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
|
||||
|
||||
Communications apps
|
||||
|
||||
.. data:: ELM_SYSTRAY_CATEGORY_SYS_SERVICES
|
||||
|
||||
System Service apps
|
||||
|
||||
.. data:: ELM_SYSTRAY_CATEGORY_HARDWARE
|
||||
|
||||
Hardware indicators
|
||||
|
||||
.. data:: ELM_SYSTRAY_CATEGORY_OTHER
|
||||
|
||||
Undefined category
|
||||
|
||||
|
||||
.. _Elm_Systray_Status:
|
||||
|
||||
Application status information.
|
||||
-------------------------------
|
||||
|
||||
.. data:: ELM_SYSTRAY_STATUS_PASSIVE
|
||||
|
||||
Passive (normal)
|
||||
|
||||
.. data:: ELM_SYSTRAY_STATUS_ACTIVE
|
||||
|
||||
Active
|
||||
|
||||
.. data:: ELM_SYSTRAY_STATUS_ATTENTION
|
||||
|
||||
Needs Attention
|
||||
|
||||
|
||||
|
||||
.. autoclass:: Systray
|
||||
.. autofunction:: on_systray_ready
|
||||
|
||||
.. autoclass:: EventSystrayReady
|
|
@ -23,9 +23,6 @@ Emitted signals
|
|||
|
||||
- ``clicked`` - when the user clicks on a toolbar item and becomes selected.
|
||||
- ``longpressed`` - when the toolbar is pressed for a certain amount of time.
|
||||
- ``language,changed`` - when the program language changes.
|
||||
- ``focused`` - When the toolbar has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the toolbar has lost focus. (since 1.8)
|
||||
- ``item,focused`` - When the toolbar item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - When the toolbar item has lost focus. (since 1.10)
|
||||
|
||||
|
|
|
@ -13,12 +13,6 @@ It embeds the video inside an Edje object, so you can do some
|
|||
animation depending on the video state change. It also implements a
|
||||
resource management policy to remove this burden from the application.
|
||||
|
||||
These widgets emit the following signals, besides the ones sent from
|
||||
:py:class:`~efl.elementary.layout_class.LayoutClass`:
|
||||
|
||||
- ``focused`` - When the widget has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the widget has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
===================
|
||||
|
|
|
@ -76,8 +76,6 @@ Emitted signals
|
|||
- ``windows,close,request``: A JavaScript request to close the current
|
||||
window was requested
|
||||
- ``zoom,animated,end``: Animated zoom finished
|
||||
- ``focused`` : When the web has received focus. (since 1.8)
|
||||
- ``unfocused`` : When the web has lost focus. (since 1.8)
|
||||
|
||||
|
||||
Enumerations
|
||||
|
|
|
@ -95,8 +95,6 @@ Emitted signals
|
|||
- ``indicator,prop,changed``: an indicator's property has been changed
|
||||
- ``rotation,changed``: window rotation has been changed
|
||||
- ``profile,changed``: profile of the window has been changed
|
||||
- ``focused`` - When the window has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the window has lost focus. (since 1.8)
|
||||
- ``theme,changed`` - The theme was changed. (since 1.13)
|
||||
|
||||
|
||||
|
|
|
@ -47,9 +47,20 @@ loaded file.
|
|||
|
||||
There will be a delay between an API being called and it being really
|
||||
executed, since this request will be done in the main thread, and it needs to
|
||||
be sent to the decoding thread. For this reason, always call functions like
|
||||
emotion_object_size_get() or emotion_object_length_get() after some signal
|
||||
being sent, like "playback_started" or "open_done".
|
||||
be sent to the decoding thread. For this reason, never access properties or
|
||||
call methods before a start up signal being sent, such "playback_started" or
|
||||
"open_done".
|
||||
|
||||
|
||||
Supported module names
|
||||
======================
|
||||
|
||||
- **gstreamer1** (default)
|
||||
- **xine**
|
||||
- **libvlc**
|
||||
- generic modules (launched in a separate process)
|
||||
|
||||
- **vlc**
|
||||
|
||||
|
||||
Emitted signals
|
||||
|
@ -70,7 +81,7 @@ interesting signals:
|
|||
- ``length_change`` Emitted if the media change it's size
|
||||
- ``channels_change`` Emitted when the number of channels change
|
||||
- ``title_change`` Emitted when the title change (?)
|
||||
- ``progress_change``
|
||||
- ``progress_change``
|
||||
- ``ref_change``
|
||||
- ``button_num_change``
|
||||
- ``button_change``
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
:class:`efl.ethumb.Ethumb` Class
|
||||
================================
|
||||
|
||||
.. autoclass:: efl.ethumb.Ethumb
|
|
@ -0,0 +1,6 @@
|
|||
.. currentmodule:: efl.ethumb_client
|
||||
|
||||
:class:`efl.ethumb_client.EthumbClient` Class
|
||||
=============================================
|
||||
|
||||
.. autoclass:: efl.ethumb_client.EthumbClient
|
|
@ -1,28 +1,55 @@
|
|||
|
||||
.. _ethumb_main_intro:
|
||||
|
||||
|
||||
What is Ethumb?
|
||||
----------------
|
||||
===============
|
||||
|
||||
Ethumb will use Evas to generate thumbnail images of given files. The API
|
||||
allows great customization of the generated files and also helps compling to
|
||||
FreeDesktop.Org Thumbnail Specification.
|
||||
|
||||
How to use the Ethumb object
|
||||
-----------------------------
|
||||
(http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html)
|
||||
|
||||
However, thumbnailing can be an expensive process that will impact your
|
||||
application experience, blocking animations and user interaction during the
|
||||
generation. Another problem is that one should try to cache the thumbnails in
|
||||
a place that other applications can benefit from the file.
|
||||
|
||||
:class:`~efl.ethumb_client.EthumbClient` exists to solve this. It will
|
||||
communicate with a server using standard D-Bus protocol. The server will use
|
||||
:class:`~efl.ethumb.Ethumb` itself to generate the thumbnail images and cache
|
||||
them using FreeDesktop.Org standard. It is recommended that most applications
|
||||
use :class:`~efl.ethumb_client.EthumbClient` instead of
|
||||
:class:`~efl.ethumb.Ethumb` directly.
|
||||
|
||||
Another difference is that one :class:`~efl.ethumb.Ethumb` instance
|
||||
can only generate a single thumbnail at a given time, so you must implement
|
||||
some sort of queue mechanism if you need more than one. Instead
|
||||
:class:`~efl.ethumb_client.EthumbClient` is a able to receive more than one
|
||||
request at the same time.
|
||||
|
||||
Recommended reading:
|
||||
|
||||
:class:`~efl.ethumb.Ethumb` to generate thumbnails in the local process.
|
||||
|
||||
:class:`~efl.ethumb_client.EthumbClient` to generate thumbnails using a
|
||||
server (recommended).
|
||||
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
:titlesonly:
|
||||
|
||||
ethumb_module
|
||||
pyethumb
|
||||
ethumb_client
|
||||
module-ethumb.rst
|
||||
module-ethumb_client.rst
|
||||
|
||||
|
||||
Inheritance diagram
|
||||
-------------------
|
||||
===================
|
||||
|
||||
.. inheritance-diagram::
|
||||
efl.ethumb
|
||||
efl.ethumb_client
|
||||
.. inheritance-diagram:: efl.ethumb
|
||||
:parts: 2
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
|
||||
:class:`efl.ethumb_client.Client` Class
|
||||
========================================
|
||||
|
||||
.. autoclass:: efl.ethumb_client.Client
|
|
@ -1,5 +0,0 @@
|
|||
:mod:`efl.ethumb` Module
|
||||
========================
|
||||
|
||||
.. automodule:: efl.ethumb
|
||||
:exclude-members: PyEthumb
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ethumb
|
||||
:exclude-members: Ethumb
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. automodule:: efl.ethumb_client
|
||||
:exclude-members: EthumbClient
|
|
@ -1,9 +0,0 @@
|
|||
.. currentmodule:: efl.ethumb
|
||||
|
||||
:class:`efl.ethumb.PyEthumb` Class
|
||||
==================================
|
||||
|
||||
.. autoclass:: efl.ethumb.PyEthumb
|
||||
|
||||
.. currentmodule:: efl.ethumb
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
|
@ -1,36 +1,7 @@
|
|||
|
||||
Python Bindings for Enlightenment Foundation Libraries' documentation
|
||||
Python-EFL
|
||||
#####################################################################
|
||||
|
||||
EFL is a collection of libraries that are independent or may build on top of
|
||||
each-other to provide useful features that complement an OS's existing
|
||||
environment, rather than wrap and abstract it, trying to be their own
|
||||
environment and OS in its entirety. This means that it expects you to use
|
||||
other system libraries and API's in conjunction with EFL libraries, to provide
|
||||
a whole working application or library, simply using EFL as a set of
|
||||
convenient pre-made libraries to accomplish a whole host of complex
|
||||
or painful tasks for you.
|
||||
|
||||
One thing that has been important to EFL is efficiency. That is in both
|
||||
speed and size. The core EFL libraries even with Elementary are about half
|
||||
the size of the equivalent "small stack" of GTK+ that things like GNOME
|
||||
use. It is in the realm of one quarter the size of Qt. Of course these
|
||||
are numbers that can be argued over as to what constitutes an equivalent
|
||||
measurement. EFL is low on actual memory usage at runtime with memory
|
||||
footprints a fraction the size of those in the GTK+ and Qt worlds. In
|
||||
addition EFL is fast. For what it does. Some libraries claim to be very
|
||||
fast - but then they also don't "do much". It's easy to be fast when you
|
||||
don't tackle the more complex rendering problems involving alpha blending,
|
||||
interpolated scaling and transforms with dithering etc. EFL tackles these,
|
||||
and more.
|
||||
|
||||
.. seealso::
|
||||
|
||||
- `EFL Overview <http://trac.enlightenment.org/e/wiki/EFLOverview>`_
|
||||
- `EFL Documentation <http://web.enlightenment.org/p.php?p=docs>`_
|
||||
- `EDC Reference <https://build.enlightenment.org/job/nightly_efl_gcc_x86_64/lastSuccessful Buil d/artifact/doc/html/edcref.html>`_
|
||||
- `EFL Big Picture <http://docs.enlightenment.org/books/efl-big-picture/efl_big_picture.pdf>`_
|
||||
|
||||
|
||||
EFL
|
||||
===
|
||||
|
@ -62,6 +33,7 @@ Ethumb
|
|||
======
|
||||
|
||||
.. toctree:: ethumb/ethumb.rst
|
||||
:titlesonly:
|
||||
|
||||
|
||||
Edje
|
||||
|
@ -91,29 +63,25 @@ DBus integration
|
|||
.. toctree:: dbus/dbus
|
||||
|
||||
|
||||
Tutorials
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
tutorials/01-window.rst
|
||||
tutorials/02-sizehints.rst
|
||||
|
||||
|
||||
Acknowledgements
|
||||
================
|
||||
|
||||
:Copyright:
|
||||
Python Bindings for EFL are Copyright (C) 2008-2015 Simon Busch
|
||||
and various contributors (see AUTHORS).
|
||||
2008-2022 The Python-EFL community (see AUTHORS)
|
||||
|
||||
:License:
|
||||
Python Bindings for EFL are licensed LGPL-3 (see COPYING).
|
||||
Python Bindings for EFL are licensed LGPL-3 (see COPYING)
|
||||
|
||||
:Authors:
|
||||
- `Gustavo Sverzut Barbieri <mailto:barbieri@gmail.com>`_
|
||||
- `Simon Busch <mailto:morphis@gravedo.de>`_
|
||||
- `Boris 'billiob' Faure <mailto:billiob@gmail.com>`_
|
||||
- `Davide 'davemds' Andreoli <mailto:dave@gurumeditation.it>`_
|
||||
- `Fabiano Fidêncio <mailto:fidencio@profusion.mobi>`_
|
||||
- `Bruno Dilly <mailto:bdilly@profusion.mobi>`_
|
||||
- `Tiago Falcão <mailto:tiago@profusion.mobi>`_
|
||||
- `Joost Albers <mailto:joost.albers@nomadrail.com>`_
|
||||
- `Kai Huuhko <mailto:kai.huuhko@gmail.com>`_
|
||||
- `Ulisses Furquim <ulissesf@gmail.com>`_
|
||||
|
||||
:Contact: `Enlightenment developer mailing list <mailto:enlightenment-devel@lists.sourceforge.net>`_
|
||||
:Contact:
|
||||
`Enlightenment developer mailing list <mailto:enlightenment-devel@lists.sourceforge.net>`_
|
||||
|
||||
|
||||
Indices and tables
|
||||
|
|
190
doc/make.bat
190
doc/make.bat
|
@ -1,190 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PythonBindingsforEnlightenmentFoundationLibraries.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PythonBindingsforEnlightenmentFoundationLibraries.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Sphinx layout template for the sphinxdoc theme.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "basic/layout.html" %}
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
{% block extrahead %}
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css'>
|
||||
{{ super() }}
|
||||
|
||||
|
@ -20,46 +20,15 @@
|
|||
<style type="text/css">
|
||||
table.right { float: right; margin-left: 20px; }
|
||||
table.right td { border: 1px solid #ccc; }
|
||||
{% if pagename == 'index' %}
|
||||
.related { display: none; }
|
||||
{% endif %}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// intelligent scrolling of the sidebar content
|
||||
$(window).scroll(function() {
|
||||
var sb = $('.sphinxsidebarwrapper');
|
||||
var win = $(window);
|
||||
var sbh = sb.height();
|
||||
var offset = $('.sphinxsidebar').position()['top'];
|
||||
var wintop = win.scrollTop();
|
||||
var winbot = wintop + win.innerHeight();
|
||||
var curtop = sb.position()['top'];
|
||||
var curbot = curtop + sbh;
|
||||
// does sidebar fit in window?
|
||||
if (sbh < win.innerHeight()) {
|
||||
// yes: easy case -- always keep at the top
|
||||
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
|
||||
$(document).height() - sbh - 200]));
|
||||
} else {
|
||||
// no: only scroll if top/bottom edge of sidebar is at
|
||||
// top/bottom edge of window
|
||||
if (curtop > wintop && curbot > winbot) {
|
||||
sb.css('top', $u.max([wintop - offset - 10, 0]));
|
||||
} else if (curtop < wintop && curbot < winbot) {
|
||||
sb.css('top', $u.min([winbot - sbh - offset - 20,
|
||||
$(document).height() - sbh - 200]));
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{%- endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block rootrellink %}
|
||||
<li><a href="{{ pathto('index') }}">Home</a> |</li>
|
||||
<!-- <li><a href="{{ pathto('contents') }}">Documentation</a> »</li>-->
|
||||
<li><a href="{{ pathto('index') }}">Home</a> |</li>
|
||||
<!-- <li><a href="{{ pathto('contents') }}">Documentation</a> »</li>-->
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
|
@ -68,8 +37,8 @@
|
|||
<li class="index"><a href="{{ pathto('index') }}"><span></span></a></li>
|
||||
<li class="maintitle">{{ project }} - {{ version }}</li>
|
||||
<li class="current"><a href="{{ pathto('index') }}"><span>python docs</span></a></li>
|
||||
<li><a href="http://enlightenment.org/p.php?p=docs"><span>other docs</span></a></li>
|
||||
<li><a href="http://enlightenment.org/p.php?p=about"><span>EFL</span></a></li>
|
||||
<li><a href="https://www.enlightenment.org/docs"><span>other docs</span></a></li>
|
||||
<li><a href="https://www.enlightenment.org/about-efl"><span>EFL</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -77,20 +46,17 @@
|
|||
{%- block content %}
|
||||
<div class="document">
|
||||
{%- block document %}
|
||||
{{ sidebar() }}
|
||||
<div class="documentwrapper">
|
||||
{%- if render_sidebar %}
|
||||
<div class="bodywrapper">
|
||||
{%- endif %}
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
<div id="layout">
|
||||
<div id="content">
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
<div id="sidebar">{{ sidebar() }}</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
|
@ -98,7 +64,11 @@
|
|||
<div class="footer">
|
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||
<br>
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- if last_updated %}
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- if show_sphinx %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
|
|
@ -6,19 +6,27 @@
|
|||
*
|
||||
* Originally based on sphinx13 theme.
|
||||
*
|
||||
* All the modification done from the s13 theme are marked with the original
|
||||
* value in a comment, new tags are marked with an empty comment, removed tags
|
||||
* are just commented out.
|
||||
* This is usefull when something looks not so good as the original one to
|
||||
* understand the reason.
|
||||
*
|
||||
* :copyright: Copyright 2013-2015 by the Python-EFL team, see AUTHORS.
|
||||
* :copyright: Copyright 2013-2022 by the Python-EFL team, see AUTHORS.
|
||||
* :license: LGPL, see COPYING for details.
|
||||
*
|
||||
*/
|
||||
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- main flex layout ----------------------------------------------------- */
|
||||
|
||||
#layout {
|
||||
display: flex;
|
||||
}
|
||||
#content {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#sidebar {
|
||||
flex-grow: 0;
|
||||
width: 230px;
|
||||
border-left: 1px solid rgb(111,111,111);
|
||||
}
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
|
@ -26,9 +34,8 @@ body {
|
|||
'Verdana', sans-serif;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
/* background-image: url(bodybg.png); */
|
||||
background-color: rgb(64,64,64); /* */
|
||||
color: white; /*black*/
|
||||
background-color: rgb(64,64,64);
|
||||
color: white;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -48,7 +55,6 @@ body {
|
|||
height: 63px;
|
||||
padding-right: 18px;
|
||||
background: url("header_menu_background_last.png") no-repeat scroll right center transparent;
|
||||
|
||||
}
|
||||
|
||||
.pageheader li {
|
||||
|
@ -92,7 +98,6 @@ body {
|
|||
}
|
||||
|
||||
div.document {
|
||||
/* background-color: white; */
|
||||
text-align: left;
|
||||
border: 1px solid rgb(111,111,111);
|
||||
width: 90%;
|
||||
|
@ -101,11 +106,6 @@ div.document {
|
|||
max-width: 1080px;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin-right: 240px;
|
||||
border-right: 1px solid rgb(111,111,111); /*#0a507a*/
|
||||
}
|
||||
|
||||
div.body {
|
||||
padding: 0.5em 20px 20px 20px;
|
||||
}
|
||||
|
@ -120,10 +120,10 @@ div.related {
|
|||
}
|
||||
|
||||
div.related ul {
|
||||
background-image: url(rel_background.png); /*url(relbg.png)*/
|
||||
background-image: url(rel_background.png);
|
||||
height: 1.9em;
|
||||
border-top: 1px solid rgb(32,32,32); /*#002e50*/
|
||||
border-bottom: 1px solid rgb(32,32,32); /*#002e50*/
|
||||
border-top: 1px solid rgb(32,32,32);
|
||||
border-bottom: 1px solid rgb(32,32,32);
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
@ -144,44 +144,49 @@ div.related ul li a {
|
|||
padding: 0 5px 0 5px;
|
||||
line-height: 1.75em;
|
||||
color: rgb(249,249,240);
|
||||
/* text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5); */
|
||||
}
|
||||
|
||||
div.related ul li a:hover {
|
||||
color: white;
|
||||
/*text-decoration: underline;*/
|
||||
/* text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5); */
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
/* Avoid the buggy moving sidebar
|
||||
position: relative;
|
||||
top: 0px;
|
||||
*/
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
/* -- sidebar ------------------------------------------------------------- */
|
||||
|
||||
div.sphinxsidebar {
|
||||
margin: 0;
|
||||
padding: 0 15px 15px 0;
|
||||
width: 210px;
|
||||
float: right;
|
||||
padding: 0;
|
||||
float: none;
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
margin: 0;
|
||||
padding: 15px 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo {
|
||||
font-size: 1.8em;
|
||||
color: rgb(10,80,122);
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .download a img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.subscribeformwrapper {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid rgb(170,170,170);
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
|
@ -189,9 +194,30 @@ div.sphinxsidebar input {
|
|||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input {
|
||||
border: 1px solid #aaa;
|
||||
font-size: 0.9em;
|
||||
float: left;
|
||||
padding: 0.25em 0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="text"] {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="submit"] {
|
||||
width: 40%;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
font-size: 1.5em;
|
||||
border-top: 1px solid rgb(111,111,111); /*#0a507a;*/
|
||||
border-top: 1px solid rgb(111,111,111);
|
||||
margin-top: 1em;
|
||||
margin-bottom: 0.5em;
|
||||
padding-top: 0.5em;
|
||||
|
@ -202,14 +228,11 @@ div.sphinxsidebar h4 {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4 {
|
||||
margin-right: -15px;
|
||||
margin-left: -15px;
|
||||
padding-right: 14px;
|
||||
padding-left: 14px;
|
||||
color: rgb(51, 153, 255); /*#333*/
|
||||
div.sphinxsidebar h3,
|
||||
div.sphinxsidebar h4
|
||||
{
|
||||
color: rgb(51, 153, 255);
|
||||
font-weight: 300;
|
||||
/*text-shadow: 0px 0px 0.5px rgba(0, 0, 0, 0.4);*/
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper > h3:first-child {
|
||||
|
@ -218,7 +241,7 @@ div.sphinxsidebarwrapper > h3:first-child {
|
|||
}
|
||||
|
||||
div.sphinxsidebar h3 a {
|
||||
color: rgb(51, 153, 255); /*#333*/
|
||||
color: rgb(51, 153, 255);
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
|
@ -233,15 +256,18 @@ div.sphinxsidebar ul ul {
|
|||
list-style-image: url(listitem.png);
|
||||
}
|
||||
|
||||
|
||||
/* -- footer ----------------------------------------------------------- */
|
||||
|
||||
div.footer {
|
||||
background-image: url(footer_background.png); /*url(footerbg.png)*/
|
||||
background-image: url(footer_background.png);
|
||||
color: rgb(204,204,204);
|
||||
text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8);
|
||||
padding: 6px; /*3px 8px 3px 0*/
|
||||
padding: 6px;
|
||||
clear: both;
|
||||
font-size: 0.8em;
|
||||
text-align: center; /*right*/
|
||||
height: 50px; /*3em*/
|
||||
text-align: center;
|
||||
height: 50px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
|
@ -250,6 +276,7 @@ div.footer a {
|
|||
color: rgb(204,204,204);
|
||||
}
|
||||
|
||||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
p {
|
||||
|
@ -263,7 +290,7 @@ a {
|
|||
|
||||
a:hover {
|
||||
color: rgb(200,200,210);
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 6px; /* */
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 6px;
|
||||
}
|
||||
|
||||
div.body a {
|
||||
|
@ -271,19 +298,18 @@ div.body a {
|
|||
}
|
||||
|
||||
h1 {
|
||||
margin: 10px 0 0 0;
|
||||
margin: 0.3em 0;
|
||||
font-size: 2.4em;
|
||||
color: rgb(51, 153, 255); /*#0A507A*/
|
||||
color: rgb(51, 153, 255);
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 1.em 0 0.2em 0;
|
||||
margin: 0.8em 0 0 0;
|
||||
font-size: 1.5em;
|
||||
font-weight: 300;
|
||||
padding: 0;
|
||||
color: rgb(51, 153, 255); /*#174967*/
|
||||
text-shadow: rgb(51, 153, 255) 0px 0px 10px; /* */
|
||||
color: rgb(51, 153, 255);
|
||||
}
|
||||
|
||||
h3 {
|
||||
|
@ -297,7 +323,7 @@ div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.b
|
|||
}
|
||||
|
||||
div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, div.body h4 a tt, div.body h5 a tt, div.body h6 a tt {
|
||||
color: rgb(51, 153, 255) !important; /*#0A507A*/
|
||||
color: rgb(51, 153, 255) !important;
|
||||
font-size: inherit !important;
|
||||
}
|
||||
|
||||
|
@ -315,6 +341,11 @@ a.headerlink:hover {
|
|||
color: white!important;
|
||||
}
|
||||
|
||||
/* avoid font-size when :mod: role in headings */
|
||||
h1 code, h2 code, h3 code, h4 code {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
cite, code, tt {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
|
@ -322,12 +353,16 @@ cite, code, tt {
|
|||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
table.deprecated code.literal {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
code, tt {
|
||||
background-color: rgb(51,51,51); /*#f2f2f2*/
|
||||
border: 1px solid rgb(32,32,32); /*#ddd*/
|
||||
background-color: rgb(51,51,51);
|
||||
border: 1px solid rgb(32,32,32);
|
||||
border-radius: 3px;
|
||||
color: white; /*#333*/
|
||||
padding: 1px;
|
||||
color: white;
|
||||
padding: 1px 0.2em;
|
||||
}
|
||||
|
||||
.descname, .descclassname, .xref {
|
||||
|
@ -342,10 +377,6 @@ code, tt {
|
|||
color: rgb(160,160,255);
|
||||
}
|
||||
|
||||
/*tt.xref {
|
||||
color: rgb(200,200,255);
|
||||
}*/
|
||||
|
||||
hr {
|
||||
border: 1px solid rgb(170,187,204);
|
||||
margin: 2em;
|
||||
|
@ -361,15 +392,14 @@ a tt:hover, a code:hover{
|
|||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
font-family: 'Consolas', 'Courier New', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.015em;
|
||||
line-height: 120%;
|
||||
padding: 0.5em;
|
||||
border-radius: 4px; /*2px*/
|
||||
background-color: rgb(51,51,51); /*#f8f8f8*/
|
||||
border: 1px solid rgb(32,32,32);/*#ccc*/
|
||||
border-radius: 6px;
|
||||
background-color: rgb(51,51,51);
|
||||
}
|
||||
|
||||
pre a {
|
||||
|
@ -399,49 +429,41 @@ table {
|
|||
margin: 0 -0.5em 0 -0.5em;
|
||||
}
|
||||
|
||||
table td, table th {
|
||||
table td,
|
||||
table th
|
||||
{
|
||||
padding: 0.2em 0.5em 0.2em 0.5em;
|
||||
}
|
||||
|
||||
div.admonition, div.warning {
|
||||
font-size: 0.9em;
|
||||
margin: 1em 0 1em 0;
|
||||
border: 1px dashed rgb(32,32,32); /*#86989B*/
|
||||
border-radius: 12px;
|
||||
background-color: rgb(51,51,51); /*#f7f7f7*/
|
||||
padding: 0;
|
||||
div.admonition,
|
||||
div.warning
|
||||
{
|
||||
background-color: rgb(51,51,51);
|
||||
}
|
||||
|
||||
div.admonition p, div.warning p {
|
||||
margin: 0.5em 1em 0.5em 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition pre, div.warning pre {
|
||||
div.admonition > pre,
|
||||
div.warning > pre
|
||||
{
|
||||
margin: 0.4em 1em 0.4em 1em;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
margin-top: 1em;
|
||||
padding-top: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border-color: rgb(101,16,16); /*#940000*/
|
||||
background-color: rgb(101,51,51); /*#FFCCCF*/
|
||||
border-color: rgb(101,16,16);
|
||||
/* background-color: rgb(101,51,51); /*#FFCCCF*/
|
||||
}
|
||||
|
||||
div.warning p.admonition-title {
|
||||
}
|
||||
|
||||
div.admonition ul, div.admonition ol,
|
||||
div.warning ul, div.warning ol {
|
||||
div.admonition > ul,
|
||||
div.admonition > ol,
|
||||
div.warning > ul,
|
||||
div.warning > ol {
|
||||
margin: 0.1em 0.5em 0.5em 3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition div.highlight {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
|
@ -453,7 +475,13 @@ div.viewcode-block:target {
|
|||
border-bottom: 1px solid rgb(170,204,153);
|
||||
}
|
||||
|
||||
dt:target, .highlighted { /* */
|
||||
.contentstable {
|
||||
margin-left: 30px;
|
||||
margin: 0 auto;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
dt:target, .highlighted {
|
||||
background-color: rgb(251,229,78);
|
||||
background-image: url(hilight_background.png);
|
||||
border-top: 1px solid rgb(32,32,32);
|
||||
|
@ -475,57 +503,96 @@ div.deprecated span.versionmodified {
|
|||
text-shadow: 0px 0px 3px rgba(180,60,20,0.6);
|
||||
}
|
||||
|
||||
|
||||
/* Toc tree */
|
||||
div.toctree-wrapper ul {
|
||||
padding-left: 1.5em;
|
||||
list-style-type: disc;
|
||||
margin-top: 0.2em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
div.toctree-wrapper a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* box for enumerations */
|
||||
div#enumerations > div.section {
|
||||
div#enumerations > div.section, /* older sphinx */
|
||||
section#enumerations > section /* newer sphinx */
|
||||
{
|
||||
border: 1px solid #202020;
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
div#enumerations > div.section h3 {
|
||||
div#enumerations > div.section h3, /* older sphinx */
|
||||
section#enumerations > section h3 /* newer sphinx */
|
||||
{
|
||||
background-color: #333;
|
||||
margin-top: 0;
|
||||
padding: 3px;
|
||||
padding: 2px 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#enumerations > div.section dl,
|
||||
div#enumerations > div.section p {
|
||||
padding-left: 3px;
|
||||
div#enumerations > div.section > dl, /* older sphinx */
|
||||
div#enumerations > div.section > p,
|
||||
section#enumerations > section > dl, /* newer sphinx */
|
||||
section#enumerations > section > p
|
||||
{
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* box for classes */
|
||||
dd {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
dl.class {
|
||||
border: 1px solid #202020;
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
dl.class > dt {
|
||||
font-size: 1.2em;
|
||||
background-color: #333;
|
||||
padding: 2px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
dl.class > dt em {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
dl.class dt{
|
||||
dl.class > dd {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* attributes/properties/methods/etc. */
|
||||
dl.attribute > dt,
|
||||
dl.method > dt,
|
||||
dl.function > dt,
|
||||
dl.data > dt
|
||||
{
|
||||
border-bottom: 1px solid #333;
|
||||
}
|
||||
|
||||
/* attributes/properties/methods/etc. */
|
||||
dl.attribute dd, dl.method dd, dl.data dd {
|
||||
padding-left: 6px;
|
||||
border-left: 1px solid rgba(200,200,255,0.4);
|
||||
dl.attribute > dd,
|
||||
dl.method > dd,
|
||||
dl.function > dd,
|
||||
dl.data > dd
|
||||
{
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
dl.field-list > dt {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
/* -- pygments fix ---------------------------------------------------------- */
|
||||
.highlight {
|
||||
background: none;
|
||||
}
|
||||
.highlight .go {
|
||||
color: white !important;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[theme]
|
||||
inherit = basic
|
||||
stylesheet = efl.css
|
||||
pygments_style = trac
|
||||
pygments_style = monokai
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Sphinx layout template for the sphinxdoc theme.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "basic/layout.html" %}
|
||||
|
@ -14,8 +14,8 @@
|
|||
{% block sidebar2 %}{% endblock %}
|
||||
|
||||
{% block extrahead %}
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css'>
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css' />
|
||||
{{ super() }}
|
||||
{%- if not embedded %}
|
||||
<style type="text/css">
|
||||
|
@ -25,7 +25,7 @@
|
|||
.related { display: none; }
|
||||
{% endif %}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
// intelligent scrolling of the sidebar content
|
||||
$(window).scroll(function() {
|
||||
var sb = $('.sphinxsidebarwrapper');
|
||||
|
@ -57,17 +57,17 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block rootrellink %}
|
||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="pageheader">
|
||||
<ul>
|
||||
<li><a href="{{ pathto('index') }}">Home</a></li>
|
||||
<li><a href="{{ pathto('install') }}">Get it</a></li>
|
||||
<li><a href="{{ pathto('usage/installation') }}">Get it</a></li>
|
||||
<li><a href="{{ pathto('contents') }}">Docs</a></li>
|
||||
<li><a href="{{ pathto('develop') }}">Extend/Develop</a></li>
|
||||
<li><a href="{{ pathto('development/index') }}">Extend</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<a href="{{ pathto('index') }}">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Sphinx stylesheet -- sphinx13 theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
@ -127,6 +127,7 @@ div.sphinxsidebar {
|
|||
float: right;
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
max-height: 0px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .logo {
|
||||
|
@ -140,11 +141,41 @@ div.sphinxsidebar .logo img {
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .download a img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.subscribeformwrapper {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #aaa;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input {
|
||||
border: 1px solid #aaa;
|
||||
font-size: 0.9em;
|
||||
float: left;
|
||||
padding: 0.25em 0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="text"] {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
div.sphinxsidebar .subscribeform input[type="submit"] {
|
||||
width: 40%;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
|
@ -208,7 +239,7 @@ div.footer a {
|
|||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
p {
|
||||
p {
|
||||
margin: 0.8em 0 0.5em 0;
|
||||
}
|
||||
|
||||
|
@ -269,6 +300,11 @@ a.headerlink:hover {
|
|||
color: white!important;
|
||||
}
|
||||
|
||||
/* avoid font-size when :mod: role in headings */
|
||||
h1 code, h2 code, h3 code, h4 code {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
cite, code, tt {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
|
@ -276,12 +312,16 @@ cite, code, tt {
|
|||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
table.deprecated code.literal {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
tt {
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 2px;
|
||||
color: #333;
|
||||
padding: 1px;
|
||||
padding: 1px 0.2em;
|
||||
}
|
||||
|
||||
tt.descname, tt.descclassname, tt.xref {
|
||||
|
@ -303,7 +343,7 @@ a tt:hover {
|
|||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Consolas', 'DejaVu Sans Mono',
|
||||
font-family: 'Consolas', 'Courier New', 'DejaVu Sans Mono',
|
||||
'Bitstream Vera Sans Mono', monospace;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.015em;
|
||||
|
@ -354,36 +394,37 @@ div.admonition, div.warning {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition p, div.warning p {
|
||||
div.admonition > p, div.warning > p {
|
||||
margin: 0.5em 1em 0.5em 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition pre, div.warning pre {
|
||||
div.admonition > pre, div.warning > pre {
|
||||
margin: 0.4em 1em 0.4em 1em;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
margin-top: 1em;
|
||||
padding-top: 0.5em;
|
||||
div.admonition > p.admonition-title,
|
||||
div.warning > p.admonition-title {
|
||||
margin-top: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border: 1px solid #940000;
|
||||
/* background-color: #FFCCCF;*/
|
||||
}
|
||||
|
||||
div.warning p.admonition-title {
|
||||
}
|
||||
|
||||
div.admonition ul, div.admonition ol,
|
||||
div.warning ul, div.warning ol {
|
||||
div.admonition > ul,
|
||||
div.admonition > ol,
|
||||
div.warning > ul,
|
||||
div.warning > ol {
|
||||
margin: 0.1em 0.5em 0.5em 3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.admonition div.highlight {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
||||
'Verdana', sans-serif;
|
||||
|
@ -394,3 +435,9 @@ div.viewcode-block:target {
|
|||
border-top: 1px solid #ac9;
|
||||
border-bottom: 1px solid #ac9;
|
||||
}
|
||||
|
||||
.contentstable {
|
||||
margin-left: 30px;
|
||||
margin: 0 auto;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Tutorial 1 - Window
|
||||
===================
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mattis id dui
|
||||
vitae lobortis. Fusce et tempus ipsum. Nulla non luctus urna. Pellentesque et
|
||||
luctus diam. Etiam fermentum vestibulum nisi, eget vestibulum turpis aliquet vitae.
|
||||
Integer interdum enim eu lacus pulvinar malesuada. Ut urna mi, congue non
|
||||
pellentesque id, varius eget diam. Ut placerat neque sed orci tincidunt consequat.
|
||||
Cras fermentum fringilla pulvinar. Ut tempor turpis odio.
|
||||
|
||||
Vivamus sed magna tempor orci pharetra dapibus. Phasellus est elit, rhoncus
|
||||
vitae consequat id, semper at ligula. Sed vitae odio tempor, maximus mi placerat,
|
||||
faucibus metus. Quisque eget mauris quis ex gravida iaculis finibus vitae arcu.
|
||||
Morbi non porttitor velit. Nullam pretium ex neque, ac malesuada felis dapibus
|
||||
sodales. Pellentesque tristique est vel accumsan lobortis. Curabitur viverra
|
||||
diam sit amet odio tincidunt pellentesque. Vestibulum non eros orci. Aliquam
|
||||
accumsan convallis ullamcorper. Donec tristique massa nec massa venenatis tempus.
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
||||
himenaeos. Aliquam augue nibh, viverra at urna in, lacinia maximus leo.
|
||||
Nullam vestibulum lobortis elementum.
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Tutorial 2 - Size Hints
|
||||
=======================
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mattis id dui
|
||||
vitae lobortis. Fusce et tempus ipsum. Nulla non luctus urna. Pellentesque et
|
||||
luctus diam. Etiam fermentum vestibulum nisi, eget vestibulum turpis aliquet vitae.
|
||||
Integer interdum enim eu lacus pulvinar malesuada. Ut urna mi, congue non
|
||||
pellentesque id, varius eget diam. Ut placerat neque sed orci tincidunt consequat.
|
||||
Cras fermentum fringilla pulvinar. Ut tempor turpis odio.
|
||||
|
||||
Vivamus sed magna tempor orci pharetra dapibus. Phasellus est elit, rhoncus
|
||||
vitae consequat id, semper at ligula. Sed vitae odio tempor, maximus mi placerat,
|
||||
faucibus metus. Quisque eget mauris quis ex gravida iaculis finibus vitae arcu.
|
||||
Morbi non porttitor velit. Nullam pretium ex neque, ac malesuada felis dapibus
|
||||
sodales. Pellentesque tristique est vel accumsan lobortis. Curabitur viverra
|
||||
diam sit amet odio tincidunt pellentesque. Vestibulum non eros orci. Aliquam
|
||||
accumsan convallis ullamcorper. Donec tristique massa nec massa venenatis tempus.
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
|
||||
himenaeos. Aliquam augue nibh, viverra at urna in, lacinia maximus leo.
|
||||
Nullam vestibulum lobortis elementum.
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -16,9 +16,26 @@
|
|||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# semver examples:
|
||||
# development: "1.12.99" ( 1, 12, 99 )
|
||||
# pre-release: "1.13.0-beta1" ( 1, 13, 0 )
|
||||
# release: "1.13.0" ( 1, 13, 0 )
|
||||
# development: '1.12.99' ( 1, 12, 99 )
|
||||
# pre-release: '1.13.0-beta1' ( 1, 13, 0 )
|
||||
# release: '1.13.0' ( 1, 13, 0 )
|
||||
|
||||
__version__ = "1.14.99"
|
||||
__version_info__ = ( 1, 14, 99 )
|
||||
__version__ = '1.26.99'
|
||||
__version_info__ = (1, 26, 99)
|
||||
|
||||
|
||||
__all__ = [
|
||||
'dbus_mainloop',
|
||||
'ecore',
|
||||
'ecore_con',
|
||||
'ecore_input',
|
||||
'ecore_x',
|
||||
'edje',
|
||||
'edje_edit',
|
||||
'elementary',
|
||||
'emotion',
|
||||
'eo',
|
||||
'ethumb',
|
||||
'evas',
|
||||
'utils',
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
* Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
*
|
||||
* This file is part of Python-EFL.
|
||||
*
|
||||
|
@ -17,8 +17,8 @@
|
|||
* along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "e_dbus.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
#ifndef E_DBUS_COLOR_DEFAULT
|
||||
|
@ -30,9 +30,9 @@ static int _e_dbus_log_dom = -1;
|
|||
#define WARN(...) EINA_LOG_DOM_WARN(_e_dbus_log_dom, __VA_ARGS__)
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_e_dbus_log_dom, __VA_ARGS__)
|
||||
|
||||
static int connection_slot = -1;
|
||||
static int e_dbus_idler_active = 0;
|
||||
static int close_connection = 0;
|
||||
static int _edbus_connection_slot = -1;
|
||||
static int _edbus_idler_active = 0;
|
||||
static int _edbus_close_connection = 0;
|
||||
static int _edbus_init_count = 0;
|
||||
|
||||
// change this define for extra debug
|
||||
|
@ -43,8 +43,7 @@ static int _edbus_init_count = 0;
|
|||
static Eina_Bool
|
||||
e_dbus_idler(void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
cd = data;
|
||||
E_DBus_Connection *cd = data;
|
||||
|
||||
if (DBUS_DISPATCH_COMPLETE == dbus_connection_get_dispatch_status(cd->conn))
|
||||
{
|
||||
|
@ -52,18 +51,18 @@ e_dbus_idler(void *data)
|
|||
cd->idler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
e_dbus_idler_active++;
|
||||
_edbus_idler_active++;
|
||||
dbus_connection_ref(cd->conn);
|
||||
DBG("dispatch()");
|
||||
dbus_connection_dispatch(cd->conn);
|
||||
dbus_connection_unref(cd->conn);
|
||||
e_dbus_idler_active--;
|
||||
if (!e_dbus_idler_active && close_connection)
|
||||
_edbus_idler_active--;
|
||||
if (!_edbus_idler_active && _edbus_close_connection)
|
||||
{
|
||||
do
|
||||
{
|
||||
e_dbus_connection_close(cd);
|
||||
} while (--close_connection);
|
||||
} while (--_edbus_close_connection);
|
||||
}
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
@ -71,10 +70,12 @@ e_dbus_idler(void *data)
|
|||
static void
|
||||
cb_dispatch_status(DBusConnection *conn, DBusDispatchStatus new_status, void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
E_DBus_Connection *cd = data;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DBG("dispatch status: %d!", new_status);
|
||||
cd = data;
|
||||
|
||||
if (new_status == DBUS_DISPATCH_DATA_REMAINS && !cd->idler)
|
||||
cd->idler = ecore_idler_add(e_dbus_idler, cd);
|
||||
|
@ -192,6 +193,9 @@ cb_watch_del(DBusWatch *watch, void *data)
|
|||
{
|
||||
E_DBus_Handler_Data *hd;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DDBG("Watch del on fd: %d (flags: %d)", dbus_watch_get_unix_fd(watch),
|
||||
dbus_watch_get_flags(watch));
|
||||
|
||||
|
@ -212,6 +216,9 @@ cb_watch_toggle(DBusWatch *watch, void *data)
|
|||
{
|
||||
E_DBus_Handler_Data *hd;
|
||||
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
DDBG("Watch toggle on fd: %d (flags: %d) enable: %d",
|
||||
dbus_watch_get_unix_fd(watch), dbus_watch_get_flags(watch),
|
||||
dbus_watch_get_enabled(watch));
|
||||
|
@ -225,19 +232,15 @@ cb_watch_toggle(DBusWatch *watch, void *data)
|
|||
static Eina_Bool
|
||||
e_dbus_timeout_handler(void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
E_DBus_Timeout_Data *td = data;
|
||||
|
||||
td = data;
|
||||
DBG("timeout expired!");
|
||||
|
||||
if (!dbus_timeout_get_enabled(td->timeout))
|
||||
{
|
||||
DBG("timeout_handler (not enabled, ending)");
|
||||
td->handler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
if (dbus_timeout_get_enabled(td->timeout))
|
||||
dbus_timeout_handle(td->timeout);
|
||||
|
||||
DBG("timeout handler!");
|
||||
dbus_timeout_handle(td->timeout);
|
||||
td->cd->timeouts = eina_list_remove(td->cd->timeouts, td->handler);
|
||||
td->handler = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
|
@ -245,7 +248,8 @@ static void
|
|||
e_dbus_timeout_data_free(void *timeout_data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td = timeout_data;
|
||||
DBG("e_dbus_timeout_data_free");
|
||||
|
||||
DBG("timeout data free!");
|
||||
if (td->handler) ecore_timer_del(td->handler);
|
||||
free(td);
|
||||
}
|
||||
|
@ -253,21 +257,23 @@ e_dbus_timeout_data_free(void *timeout_data)
|
|||
static dbus_bool_t
|
||||
cb_timeout_add(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Connection *cd;
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td;
|
||||
double interval = (double)dbus_timeout_get_interval(timeout) / 1000;
|
||||
|
||||
DBG("timeout add! enabled: %d, interval: %.2f secs",
|
||||
dbus_timeout_get_enabled(timeout), interval);
|
||||
|
||||
cd = data;
|
||||
DBG("timeout add!");
|
||||
td = calloc(1, sizeof(E_DBus_Timeout_Data));
|
||||
td->cd = cd;
|
||||
td->timeout = timeout;
|
||||
dbus_timeout_set_data(timeout, (void *)td, e_dbus_timeout_data_free);
|
||||
|
||||
td->interval = dbus_timeout_get_interval(timeout);
|
||||
td->timeout = timeout;
|
||||
|
||||
if (dbus_timeout_get_enabled(timeout))
|
||||
td->handler = ecore_timer_add(td->interval, e_dbus_timeout_handler, td);
|
||||
td->cd->timeouts = eina_list_append(td->cd->timeouts, td->handler);
|
||||
{
|
||||
td->handler = ecore_timer_add(interval, e_dbus_timeout_handler, td);
|
||||
cd->timeouts = eina_list_append(cd->timeouts, td->handler);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -275,14 +281,14 @@ cb_timeout_add(DBusTimeout *timeout, void *data)
|
|||
static void
|
||||
cb_timeout_del(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
DBG("timeout del!");
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td = dbus_timeout_get_data(timeout);
|
||||
|
||||
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
|
||||
DBG("timeout del!");
|
||||
|
||||
if (td->handler)
|
||||
{
|
||||
td->cd->timeouts = eina_list_remove(td->cd->timeouts, td->handler);
|
||||
cd->timeouts = eina_list_remove(cd->timeouts, td->handler);
|
||||
ecore_timer_del(td->handler);
|
||||
td->handler = NULL;
|
||||
}
|
||||
|
@ -293,18 +299,20 @@ cb_timeout_del(DBusTimeout *timeout, void *data)
|
|||
static void
|
||||
cb_timeout_toggle(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
E_DBus_Timeout_Data *td;
|
||||
DBG("timeout toggle!");
|
||||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Timeout_Data *td = dbus_timeout_get_data(timeout);
|
||||
double interval = (double)dbus_timeout_get_interval(timeout) / 1000;
|
||||
|
||||
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
|
||||
DBG("timeout toggle!");
|
||||
|
||||
if (dbus_timeout_get_enabled(td->timeout))
|
||||
{
|
||||
td->interval = dbus_timeout_get_interval(timeout);
|
||||
td->handler = ecore_timer_add(td->interval, e_dbus_timeout_handler, td);
|
||||
td->handler = ecore_timer_add(interval, e_dbus_timeout_handler, td);
|
||||
cd->timeouts = eina_list_append(cd->timeouts, td->handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
cd->timeouts = eina_list_remove(cd->timeouts, td->handler);
|
||||
ecore_timer_del(td->handler);
|
||||
td->handler = NULL;
|
||||
}
|
||||
|
@ -330,9 +338,12 @@ e_dbus_connection_free(void *data)
|
|||
E_DBus_Connection *cd = data;
|
||||
E_DBus_Handler_Data *hd;
|
||||
Ecore_Timer *timer;
|
||||
DBG("e_dbus_connection free!");
|
||||
Eina_List *l, *ll;
|
||||
|
||||
EINA_LIST_FREE(cd->fd_handlers, hd)
|
||||
if (_edbus_init_count <= 0)
|
||||
return;
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(cd->fd_handlers, l, ll, hd)
|
||||
e_dbus_fd_handler_del(hd);
|
||||
|
||||
EINA_LIST_FREE(cd->timeouts, timer)
|
||||
|
@ -404,9 +415,9 @@ e_dbus_connection_setup(DBusConnection *conn)
|
|||
|
||||
/* connection_setup */
|
||||
dbus_connection_set_exit_on_disconnect(cd->conn, EINA_FALSE);
|
||||
dbus_connection_allocate_data_slot(&connection_slot);
|
||||
dbus_connection_allocate_data_slot(&_edbus_connection_slot);
|
||||
|
||||
dbus_connection_set_data(cd->conn, connection_slot, (void *)cd,
|
||||
dbus_connection_set_data(cd->conn, _edbus_connection_slot, (void *)cd,
|
||||
e_dbus_connection_free);
|
||||
dbus_connection_set_watch_functions(cd->conn,
|
||||
cb_watch_add,
|
||||
|
@ -434,14 +445,13 @@ e_dbus_connection_close(E_DBus_Connection *conn)
|
|||
if (!conn) return;
|
||||
DBG("e_dbus_connection_close");
|
||||
|
||||
if (e_dbus_idler_active)
|
||||
if (_edbus_idler_active)
|
||||
{
|
||||
close_connection++;
|
||||
_edbus_close_connection++;
|
||||
return;
|
||||
}
|
||||
if (--(conn->refcount) != 0) return;
|
||||
|
||||
dbus_connection_free_data_slot(&connection_slot);
|
||||
dbus_connection_free_data_slot(&_edbus_connection_slot);
|
||||
dbus_connection_set_watch_functions(conn->conn,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
* Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
*
|
||||
* This file is part of Python-EFL.
|
||||
*
|
||||
|
@ -35,7 +35,6 @@ struct E_DBus_Connection
|
|||
Eina_List *fd_handlers;
|
||||
Eina_List *timeouts;
|
||||
Ecore_Idler *idler;
|
||||
int refcount;
|
||||
};
|
||||
|
||||
struct E_DBus_Handler_Data
|
||||
|
@ -52,7 +51,6 @@ struct E_DBus_Timeout_Data
|
|||
Ecore_Timer *handler;
|
||||
DBusTimeout *timeout;
|
||||
E_DBus_Connection *cd;
|
||||
int interval;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -114,6 +114,8 @@ Flags for executing a child with its stdin and/or stdout piped back.
|
|||
Makes child receive SIGTERM when parent dies
|
||||
|
||||
|
||||
.. _Ecore_Callback_Returns:
|
||||
|
||||
Callback return values
|
||||
----------------------
|
||||
|
||||
|
@ -126,6 +128,8 @@ Callback return values
|
|||
Return value to keep a callback
|
||||
|
||||
|
||||
.. _Ecore_Event_Returns:
|
||||
|
||||
Event return values
|
||||
-------------------
|
||||
|
||||
|
@ -253,10 +257,85 @@ from cpython cimport Py_INCREF, Py_DECREF
|
|||
import traceback
|
||||
import atexit
|
||||
|
||||
cimport efl.ecore.enums as enums
|
||||
|
||||
ECORE_EVENT_NONE = enums.ECORE_EVENT_NONE
|
||||
ECORE_EVENT_SIGNAL_USER = enums.ECORE_EVENT_SIGNAL_USER
|
||||
ECORE_EVENT_SIGNAL_HUP = enums.ECORE_EVENT_SIGNAL_HUP
|
||||
ECORE_EVENT_SIGNAL_EXIT = enums.ECORE_EVENT_SIGNAL_EXIT
|
||||
ECORE_EVENT_SIGNAL_POWER = enums.ECORE_EVENT_SIGNAL_POWER
|
||||
ECORE_EVENT_SIGNAL_REALTIME = enums.ECORE_EVENT_SIGNAL_REALTIME
|
||||
ECORE_EVENT_MEMORY_STATE = enums.ECORE_EVENT_MEMORY_STATE
|
||||
ECORE_EVENT_POWER_STATE = enums.ECORE_EVENT_POWER_STATE
|
||||
ECORE_EVENT_LOCALE_CHANGED = enums.ECORE_EVENT_LOCALE_CHANGED
|
||||
ECORE_EVENT_HOSTNAME_CHANGED = enums.ECORE_EVENT_HOSTNAME_CHANGED
|
||||
ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED = enums.ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED
|
||||
ECORE_EVENT_COUNT = enums.ECORE_EVENT_COUNT
|
||||
|
||||
ECORE_CALLBACK_CANCEL = enums.ECORE_CALLBACK_CANCEL
|
||||
ECORE_CALLBACK_RENEW = enums.ECORE_CALLBACK_RENEW
|
||||
|
||||
ECORE_CALLBACK_PASS_ON = enums.ECORE_CALLBACK_PASS_ON
|
||||
ECORE_CALLBACK_DONE = enums.ECORE_CALLBACK_DONE
|
||||
|
||||
ECORE_EXE_PRIORITY_INHERIT = enums.ECORE_EXE_PRIORITY_INHERIT
|
||||
|
||||
ECORE_EXE_EVENT_ADD = enums.ECORE_EXE_EVENT_ADD
|
||||
ECORE_EXE_EVENT_DEL = enums.ECORE_EXE_EVENT_DEL
|
||||
ECORE_EXE_EVENT_DATA = enums.ECORE_EXE_EVENT_DATA
|
||||
ECORE_EXE_EVENT_ERROR = enums.ECORE_EXE_EVENT_ERROR
|
||||
|
||||
ECORE_FD_READ = enums.ECORE_FD_READ
|
||||
ECORE_FD_WRITE = enums.ECORE_FD_WRITE
|
||||
ECORE_FD_ERROR = enums.ECORE_FD_ERROR
|
||||
|
||||
ECORE_EXE_NONE = enums.ECORE_EXE_NONE
|
||||
ECORE_EXE_PIPE_READ = enums.ECORE_EXE_PIPE_READ
|
||||
ECORE_EXE_PIPE_WRITE = enums.ECORE_EXE_PIPE_WRITE
|
||||
ECORE_EXE_PIPE_ERROR = enums.ECORE_EXE_PIPE_ERROR
|
||||
ECORE_EXE_PIPE_READ_LINE_BUFFERED = enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED
|
||||
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED
|
||||
ECORE_EXE_PIPE_AUTO = enums.ECORE_EXE_PIPE_AUTO
|
||||
ECORE_EXE_RESPAWN = enums.ECORE_EXE_RESPAWN
|
||||
ECORE_EXE_USE_SH = enums.ECORE_EXE_USE_SH
|
||||
ECORE_EXE_NOT_LEADER = enums.ECORE_EXE_NOT_LEADER
|
||||
ECORE_EXE_TERM_WITH_PARENT = enums.ECORE_EXE_TERM_WITH_PARENT
|
||||
|
||||
ECORE_POS_MAP_LINEAR = enums.ECORE_POS_MAP_LINEAR
|
||||
ECORE_POS_MAP_ACCELERATE = enums.ECORE_POS_MAP_ACCELERATE
|
||||
ECORE_POS_MAP_DECELERATE = enums.ECORE_POS_MAP_DECELERATE
|
||||
ECORE_POS_MAP_SINUSOIDAL = enums.ECORE_POS_MAP_SINUSOIDAL
|
||||
ECORE_POS_MAP_ACCELERATE_FACTOR = enums.ECORE_POS_MAP_ACCELERATE_FACTOR
|
||||
ECORE_POS_MAP_DECELERATE_FACTOR = enums.ECORE_POS_MAP_DECELERATE_FACTOR
|
||||
ECORE_POS_MAP_SINUSOIDAL_FACTOR = enums.ECORE_POS_MAP_SINUSOIDAL_FACTOR
|
||||
ECORE_POS_MAP_DIVISOR_INTERP = enums.ECORE_POS_MAP_DIVISOR_INTERP
|
||||
ECORE_POS_MAP_BOUNCE = enums.ECORE_POS_MAP_BOUNCE
|
||||
ECORE_POS_MAP_SPRING = enums.ECORE_POS_MAP_SPRING
|
||||
ECORE_POS_MAP_CUBIC_BEZIER = enums.ECORE_POS_MAP_CUBIC_BEZIER
|
||||
|
||||
ECORE_ANIMATOR_SOURCE_TIMER = enums.ECORE_ANIMATOR_SOURCE_TIMER
|
||||
ECORE_ANIMATOR_SOURCE_CUSTOM = enums.ECORE_ANIMATOR_SOURCE_CUSTOM
|
||||
|
||||
ECORE_POLLER_CORE = enums.ECORE_POLLER_CORE
|
||||
|
||||
|
||||
ECORE_FILE_EVENT_NONE = enums.ECORE_FILE_EVENT_NONE
|
||||
ECORE_FILE_EVENT_CREATED_FILE = enums.ECORE_FILE_EVENT_CREATED_FILE
|
||||
ECORE_FILE_EVENT_CREATED_DIRECTORY = enums.ECORE_FILE_EVENT_CREATED_DIRECTORY
|
||||
ECORE_FILE_EVENT_DELETED_FILE = enums.ECORE_FILE_EVENT_DELETED_FILE
|
||||
ECORE_FILE_EVENT_DELETED_DIRECTORY = enums.ECORE_FILE_EVENT_DELETED_DIRECTORY
|
||||
ECORE_FILE_EVENT_DELETED_SELF = enums.ECORE_FILE_EVENT_DELETED_SELF
|
||||
ECORE_FILE_EVENT_MODIFIED = enums.ECORE_FILE_EVENT_MODIFIED
|
||||
ECORE_FILE_EVENT_CLOSED = enums.ECORE_FILE_EVENT_CLOSED
|
||||
|
||||
ECORE_FILE_PROGRESS_CONTINUE = enums.ECORE_FILE_PROGRESS_CONTINUE
|
||||
ECORE_FILE_PROGRESS_ABORT = enums.ECORE_FILE_PROGRESS_ABORT
|
||||
|
||||
|
||||
cdef Eina_Bool _ecore_task_cb(void *data) with gil:
|
||||
cdef Eo obj = <Eo>data
|
||||
cdef Eina_Bool ret
|
||||
cdef:
|
||||
Eo obj = <Eo>data
|
||||
Eina_Bool ret
|
||||
|
||||
try:
|
||||
ret = obj._task_exec()
|
||||
|
@ -283,15 +362,15 @@ def init():
|
|||
|
||||
global _event_type_mapping
|
||||
_event_type_mapping = {
|
||||
ECORE_EVENT_SIGNAL_USER: EventSignalUser,
|
||||
ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
|
||||
ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
|
||||
ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
|
||||
ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
|
||||
ECORE_EXE_EVENT_ADD: EventExeAdd,
|
||||
ECORE_EXE_EVENT_DEL: EventExeDel,
|
||||
ECORE_EXE_EVENT_DATA: EventExeData,
|
||||
ECORE_EXE_EVENT_ERROR: EventExeData,
|
||||
enums.ECORE_EVENT_SIGNAL_USER: EventSignalUser,
|
||||
enums.ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
|
||||
enums.ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
|
||||
enums.ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
|
||||
enums.ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
|
||||
enums.ECORE_EXE_EVENT_ADD: EventExeAdd,
|
||||
enums.ECORE_EXE_EVENT_DEL: EventExeDel,
|
||||
enums.ECORE_EXE_EVENT_DATA: EventExeData,
|
||||
enums.ECORE_EXE_EVENT_ERROR: EventExeData,
|
||||
}
|
||||
|
||||
ecore_file_init()
|
||||
|
@ -346,27 +425,30 @@ init()
|
|||
atexit.register(shutdown)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# This conflict seems to not exists anymore, see tests/ecore/test_08_exe.py
|
||||
#---------------------------------------------------------------------------
|
||||
# let's try to warn users that ecore conflicts with subprocess module
|
||||
import subprocess
|
||||
|
||||
_orig_subprocess = None
|
||||
|
||||
def subprocess_warning(*a, **ka):
|
||||
print(""" DEVELOPER WARNING:
|
||||
Using subprocess (Popen and derivatives) with Ecore is a bad idea.
|
||||
|
||||
Ecore will set some signal handlers subprocess module depends and this
|
||||
may cause this module to operate unexpectedly.
|
||||
|
||||
Instead of using subprocess.Popen(), please consider using Ecore's
|
||||
Exe() class.
|
||||
""")
|
||||
return _orig_subprocess(*a, **ka)
|
||||
|
||||
if subprocess.Popen is not subprocess_warning:
|
||||
_orig_subprocess = subprocess.Popen
|
||||
subprocess.Popen = subprocess_warning
|
||||
# import subprocess
|
||||
#
|
||||
# _orig_subprocess = None
|
||||
#
|
||||
# def subprocess_warning(*a, **ka):
|
||||
# print(""" DEVELOPER WARNING:
|
||||
# Using subprocess (Popen and derivatives) with Ecore is a bad idea.
|
||||
#
|
||||
# Ecore will set some signal handlers subprocess module depends and this
|
||||
# may cause this module to operate unexpectedly.
|
||||
#
|
||||
# Instead of using subprocess.Popen(), please consider using Ecore's
|
||||
# Exe() class.
|
||||
# """)
|
||||
# traceback.print_stack()
|
||||
# return _orig_subprocess(*a, **ka)
|
||||
#
|
||||
# if subprocess.Popen is not subprocess_warning:
|
||||
# _orig_subprocess = subprocess.Popen
|
||||
# subprocess.Popen = subprocess_warning
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ cdef class Animator(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""Animator(...)
|
||||
"""
|
||||
|
||||
:param func: function to call at every frame.
|
||||
:type func: callable
|
||||
|
@ -60,27 +60,44 @@ cdef class Animator(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_animator_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 animators are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_animator_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_animator_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Animator(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Animator(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Animator(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_animator_del(self.obj)
|
||||
ecore_animator_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def stop(self):
|
||||
"""Alias for delete()."""
|
||||
self.delete()
|
||||
|
||||
|
||||
cdef Eina_Bool _ecore_timeline_cb(void *data, double pos) with gil:
|
||||
assert data != NULL
|
||||
cdef:
|
||||
|
@ -124,7 +141,7 @@ cdef class AnimatorTimeline(Animator):
|
|||
"""
|
||||
|
||||
def __init__(self, func, double runtime, *args, **kargs):
|
||||
"""AnimatorTimeline(...)
|
||||
"""
|
||||
|
||||
:param func: The function to call when it ticks off
|
||||
:type func: callable
|
||||
|
@ -146,11 +163,17 @@ cdef class AnimatorTimeline(Animator):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 animators are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self))
|
||||
self.obj2 = ecore_animator_timeline_add(runtime, _ecore_timeline_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
|
||||
def animator_add(func, *args, **kargs):
|
||||
"""Animator factory, for C-api compatibility.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -29,6 +29,11 @@ cdef object _event_mapping_register(int type, cls):
|
|||
cdef object _event_mapping_unregister(int type):
|
||||
_event_type_mapping.pop(type)
|
||||
|
||||
cdef object _event_mapping_get(int type):
|
||||
if not type in _event_type_mapping:
|
||||
raise ValueError("event type '%d' not registered." % type)
|
||||
return _event_type_mapping.get(type)
|
||||
|
||||
|
||||
cdef Eina_Bool event_handler_cb(void *data, int type, void *event) with gil:
|
||||
cdef EventHandler handler
|
||||
|
@ -65,6 +70,9 @@ cdef class Event(object):
|
|||
cdef int _set_obj(self, void *obj) except 0:
|
||||
raise NotImplementedError("Event._set_obj() not implemented.")
|
||||
|
||||
cdef object _get_obj(self):
|
||||
raise NotImplementedError("Event._get_obj() not implemented.")
|
||||
|
||||
|
||||
cdef class EventHandler(object):
|
||||
def __init__(self, int type, func, *args, **kargs):
|
||||
|
@ -73,7 +81,7 @@ cdef class EventHandler(object):
|
|||
raise TypeError("Parameter 'func' must be callable")
|
||||
event_cls = _event_type_mapping.get(type, None)
|
||||
if event_cls is None:
|
||||
raise ValueError("Unknow Ecore_Event type %d" % type)
|
||||
raise ValueError("Unknown Ecore_Event type %d" % type)
|
||||
self.type = type
|
||||
self.event_cls = event_cls
|
||||
self.func = func
|
||||
|
@ -166,7 +174,7 @@ cdef class EventSignalUser2(EventSignalUser):
|
|||
|
||||
cdef class EventHandlerSignalUser(EventHandler):
|
||||
def __init__(self, func, *args, **kargs):
|
||||
EventHandler.__init__(self, ECORE_EVENT_SIGNAL_USER,
|
||||
EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_USER,
|
||||
func, *args, **kargs)
|
||||
|
||||
cdef Eina_Bool _exec(self, void *event) except 2:
|
||||
|
@ -198,7 +206,7 @@ cdef class EventSignalHup(Event):
|
|||
|
||||
|
||||
def on_signal_hup(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class EventSignalExit(Event):
|
||||
|
@ -245,7 +253,7 @@ cdef class EventSignalTerminate(EventSignalExit):
|
|||
|
||||
cdef class EventHandlerSignalExit(EventHandler):
|
||||
def __init__(self, func, *args, **kargs):
|
||||
EventHandler.__init__(self, ECORE_EVENT_SIGNAL_EXIT,
|
||||
EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_EXIT,
|
||||
func, *args, **kargs)
|
||||
|
||||
cdef Eina_Bool _exec(self, void *event) except 2:
|
||||
|
@ -279,7 +287,7 @@ cdef class EventSignalPower(Event):
|
|||
|
||||
|
||||
def on_signal_power(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class EventSignalRealtime(Event):
|
||||
|
@ -297,7 +305,7 @@ cdef class EventSignalRealtime(Event):
|
|||
|
||||
|
||||
def on_signal_realtime(func, *args, **kargs):
|
||||
return EventHandler(ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
|
||||
return EventHandler(enums.ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
|
||||
|
||||
|
||||
cdef class CustomEvent(Event):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -25,24 +25,28 @@ cdef extern from "Python.h":
|
|||
|
||||
cdef exe_flags2str(int value):
|
||||
flags = []
|
||||
if value & ECORE_EXE_PIPE_READ:
|
||||
if value & enums.ECORE_EXE_PIPE_READ:
|
||||
flags.append("PIPE_READ")
|
||||
if value & ECORE_EXE_PIPE_WRITE:
|
||||
if value & enums.ECORE_EXE_PIPE_WRITE:
|
||||
flags.append("PIPE_WRITE")
|
||||
if value & ECORE_EXE_PIPE_ERROR:
|
||||
if value & enums.ECORE_EXE_PIPE_ERROR:
|
||||
flags.append("PIPE_ERROR")
|
||||
if value & ECORE_EXE_PIPE_READ_LINE_BUFFERED:
|
||||
if value & enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED:
|
||||
flags.append("PIPE_READ_LINE_BUFFERED")
|
||||
if value & ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
|
||||
if value & enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
|
||||
flags.append("PIPE_ERROR_LINE_BUFFERED")
|
||||
if value & ECORE_EXE_PIPE_AUTO:
|
||||
if value & enums.ECORE_EXE_PIPE_AUTO:
|
||||
flags.append("PIPE_AUTO")
|
||||
if value & ECORE_EXE_RESPAWN:
|
||||
if value & enums.ECORE_EXE_RESPAWN:
|
||||
flags.append("RESPAWN")
|
||||
if value & ECORE_EXE_USE_SH:
|
||||
if value & enums.ECORE_EXE_USE_SH:
|
||||
flags.append("USE_SH")
|
||||
if value & ECORE_EXE_NOT_LEADER:
|
||||
if value & enums.ECORE_EXE_NOT_LEADER:
|
||||
flags.append("NOT_LEADER")
|
||||
if value & enums.ECORE_EXE_TERM_WITH_PARENT:
|
||||
flags.append("ECORE_EXE_TERM_WITH_PARENT")
|
||||
if value & enums.ECORE_EXE_ISOLATE_IO:
|
||||
flags.append("ECORE_EXE_ISOLATE_IO")
|
||||
return ", ".join(flags)
|
||||
|
||||
|
||||
|
@ -58,17 +62,17 @@ cdef Eina_Bool _exe_event_filter_cb(void *data, int type, void *event) with gil:
|
|||
|
||||
try:
|
||||
assert self.event_type == type, "event is not what we asked? impossible"
|
||||
if type == ECORE_EXE_EVENT_ADD:
|
||||
if type == enums.ECORE_EXE_EVENT_ADD:
|
||||
e_add = <Ecore_Exe_Event_Add *>event
|
||||
if e_add.exe != self.exe:
|
||||
return 1
|
||||
e = EventExeAdd()
|
||||
elif type == ECORE_EXE_EVENT_DEL:
|
||||
elif type == enums.ECORE_EXE_EVENT_DEL:
|
||||
e_del = <Ecore_Exe_Event_Del *>event
|
||||
if e_del.exe != self.exe:
|
||||
return 1
|
||||
e = EventExeDel()
|
||||
elif type == ECORE_EXE_EVENT_DATA or type == ECORE_EXE_EVENT_ERROR:
|
||||
elif type == enums.ECORE_EXE_EVENT_DATA or type == enums.ECORE_EXE_EVENT_ERROR:
|
||||
e_data = <Ecore_Exe_Event_Data *>event
|
||||
if e_data.exe != self.exe:
|
||||
return 1
|
||||
|
@ -298,6 +302,13 @@ cdef class Exe(object):
|
|||
Do not use setsid() to have the executed process be its own
|
||||
session leader
|
||||
|
||||
ECORE_EXE_TERM_WITH_PARENT
|
||||
Makes child receive SIGTERM when parent dies
|
||||
|
||||
ECORE_EXE_ISOLATE_IO
|
||||
Try and isolate stdin/out and err of the process so it isn't
|
||||
shared with the parent. Since 1.21
|
||||
|
||||
:type flags: int
|
||||
:param data: extra data to be associated and available with ``data_get()``
|
||||
|
||||
|
@ -363,6 +374,17 @@ cdef class Exe(object):
|
|||
<uintptr_t>self.exe, PY_REFCOUNT(self),
|
||||
pid, cmd, flags, data)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
"""
|
||||
return bool(self.exe == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Forcefully frees the given process handle.
|
||||
|
||||
|
@ -536,6 +558,10 @@ cdef class Exe(object):
|
|||
- ECORE_EXE_USE_SH: Use /bin/sh to run the command.
|
||||
- ECORE_EXE_NOT_LEADER Do not use setsid() to have the
|
||||
executed process be its own session leader
|
||||
- ECORE_EXE_TERM_WITH_PARENT Makes child receive SIGTERM when
|
||||
parent dies
|
||||
- ECORE_EXE_ISOLATE_IO Try and isolate stdin/out and err of the
|
||||
process so it isn't shared with the parent
|
||||
|
||||
:return: set of masks, ORed.
|
||||
|
||||
|
@ -632,10 +658,10 @@ cdef class Exe(object):
|
|||
:see: on_exe_add_event_add()
|
||||
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_ADD)
|
||||
self.__callbacks[ECORE_EXE_EVENT_ADD] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ADD)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_ADD] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_add_event_del(self, func, *args, **kargs):
|
||||
|
@ -646,7 +672,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -668,10 +694,10 @@ cdef class Exe(object):
|
|||
:see: on_del_event_del()
|
||||
:see: on_exe_del_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_DEL)
|
||||
self.__callbacks[ECORE_EXE_EVENT_DEL] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DEL)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_DEL] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_del_event_del(self, func, *args, **kargs):
|
||||
|
@ -682,7 +708,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -704,10 +730,10 @@ cdef class Exe(object):
|
|||
:see: on_data_event_del()
|
||||
:see: on_exe_data_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_DATA)
|
||||
self.__callbacks[ECORE_EXE_EVENT_DATA] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DATA)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_DATA] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_data_event_del(self, func, *args, **kargs):
|
||||
|
@ -718,7 +744,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -740,10 +766,10 @@ cdef class Exe(object):
|
|||
:see: on_error_event_del()
|
||||
:see: on_exe_error_event_add()
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR)
|
||||
if filter is None:
|
||||
filter = ExeEventFilter(self, ECORE_EXE_EVENT_ERROR)
|
||||
self.__callbacks[ECORE_EXE_EVENT_ERROR] = filter
|
||||
filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ERROR)
|
||||
self.__callbacks[enums.ECORE_EXE_EVENT_ERROR] = filter
|
||||
filter.callback_add(func, args, kargs)
|
||||
|
||||
def on_error_event_del(self, func, *args, **kargs):
|
||||
|
@ -754,7 +780,7 @@ cdef class Exe(object):
|
|||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
|
||||
filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR)
|
||||
if filter is None:
|
||||
raise ValueError("callback not registered %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
@ -774,9 +800,9 @@ def exe_pipe_run(exe_cmd, int flags=0, data=None):
|
|||
cdef class EventExeAdd(Event):
|
||||
"""Represents Ecore_Exe_Event_Add event from C-api.
|
||||
|
||||
This event notifies the process created with :py:class:`Exe` was started.
|
||||
This event notifies that the process created with :py:class:`Exe` has been started.
|
||||
|
||||
See property ``exe`` for ``Exe`` instance.
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Add *obj
|
||||
|
@ -793,9 +819,14 @@ cdef class EventExeAdd(Event):
|
|||
cdef class EventExeDel(Event):
|
||||
"""Represents Ecore_Exe_Event_Del from C-api.
|
||||
|
||||
This event notifies the process created with ``Exe`` is now dead.
|
||||
This event notifies that the process created with ``Exe`` is now dead.
|
||||
|
||||
See property ``exe`` for ``Exe`` instance.
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
:ivar int pid: Process ID
|
||||
:ivar int exit_code: Exit code
|
||||
:ivar int exit_signal: Exit signal
|
||||
:ivar bool exited: Has process exited
|
||||
:ivar bool signalled: Has process been signalled
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Del *obj
|
||||
|
@ -823,12 +854,10 @@ cdef class EventExeData(Event):
|
|||
This event is issued by :py:class:`Exe` instances created with flags that
|
||||
allow reading from either stdout or stderr.
|
||||
|
||||
See properties:
|
||||
|
||||
- **exe** instance of :py:class:`Exe` that created this event.
|
||||
- **data** the raw string buffer with binary data from child process.
|
||||
- **size** the size of **data** (same as ``len(data)``)
|
||||
- **lines** list of strings with all text lines
|
||||
:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
|
||||
:ivar string ~EventExeData.data: The raw string buffer with binary data from child process.
|
||||
:ivar int ~EventExeData.size: The size of **data** (same as ``len(data)``)
|
||||
:ivar list lines: List of strings with all text lines
|
||||
"""
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
cdef Ecore_Exe_Event_Data *obj
|
||||
|
@ -880,7 +909,7 @@ def on_exe_add_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_ADD, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_ADD, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_del_event_add(func, *args, **kargs):
|
||||
|
@ -889,7 +918,7 @@ def on_exe_del_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_DEL, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_DEL, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_data_event_add(func, *args, **kargs):
|
||||
|
@ -898,7 +927,7 @@ def on_exe_data_event_add(func, *args, **kargs):
|
|||
:see: EventHandler
|
||||
:see: EventHandlerExe
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_DATA, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_DATA, func, *args, **kargs)
|
||||
|
||||
|
||||
def on_exe_error_event_add(func, *args, **kargs):
|
||||
|
@ -907,4 +936,4 @@ def on_exe_error_event_add(func, *args, **kargs):
|
|||
:see: :py:class:`EventHandler`
|
||||
:see: :py:class:`EventHandlerExe`
|
||||
"""
|
||||
return EventHandlerExe(ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
|
||||
return EventHandlerExe(enums.ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -31,11 +31,11 @@ cdef void fd_handler_prepare_cb(void *data, Ecore_Fd_Handler *fdh) with gil:
|
|||
|
||||
cdef flags2str(int value):
|
||||
flags = []
|
||||
if value & <int>ECORE_FD_READ:
|
||||
if value & <int>enums.ECORE_FD_READ:
|
||||
flags.append("READ")
|
||||
if value & <int>ECORE_FD_WRITE:
|
||||
if value & <int>enums.ECORE_FD_WRITE:
|
||||
flags.append("WRITE")
|
||||
if value & <int>ECORE_FD_ERROR:
|
||||
if value & <int>enums.ECORE_FD_ERROR:
|
||||
flags.append("ERROR")
|
||||
return ", ".join(flags)
|
||||
|
||||
|
@ -78,7 +78,7 @@ cdef class FdHandler(object):
|
|||
|
||||
"""
|
||||
def __init__(self, fd, int flags, func, *args, **kargs):
|
||||
"""FdHandler(...)
|
||||
"""
|
||||
|
||||
:param fd: file descriptor or object with fileno() method.
|
||||
:param flags: bitwise OR of ECORE_FD_READ, ECORE_FD_WRITE...
|
||||
|
@ -144,6 +144,17 @@ cdef class FdHandler(object):
|
|||
cdef object _exec(self):
|
||||
return self.func(self, *self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
.. versionadded:: 1.18
|
||||
|
||||
"""
|
||||
return bool(self.obj == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
if self.obj != NULL:
|
||||
|
@ -193,15 +204,15 @@ cdef class FdHandler(object):
|
|||
|
||||
def can_read(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_READ))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_READ))
|
||||
|
||||
def can_write(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_WRITE))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_WRITE))
|
||||
|
||||
def has_error(self):
|
||||
""":rtype: bool"""
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, ECORE_FD_ERROR))
|
||||
return bool(ecore_main_fd_handler_active_get(self.obj, enums.ECORE_FD_ERROR))
|
||||
|
||||
def prepare_callback_set(self, func, *args, **kargs):
|
||||
"""Set a function to call before doing the select() on the fd.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -73,7 +73,7 @@ cdef class FileDownload(object):
|
|||
|
||||
"""
|
||||
def __init__(self, url, dst, completion_cb, progress_cb, *args, **kargs):
|
||||
"""FileDownload(...)
|
||||
"""
|
||||
|
||||
:param url: The complete url to download
|
||||
:param dst: Where to download the file
|
||||
|
@ -99,7 +99,7 @@ cdef class FileDownload(object):
|
|||
if not ecore_file_download(
|
||||
<const char *>url if url is not None else NULL,
|
||||
<const char *>dst if dst is not None else NULL,
|
||||
_completion_cb, _progress_cb,
|
||||
_completion_cb, _progress_cb, # TODO really connect everytime? or check if cb given?
|
||||
<void *>self, &job):
|
||||
raise SystemError("could not download '%s' to %s" % (url, dst))
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -60,7 +60,7 @@ cdef class FileMonitor(object):
|
|||
|
||||
"""
|
||||
def __init__(self, path, monitor_cb, *args, **kargs):
|
||||
"""FileMonitor(...)
|
||||
"""
|
||||
|
||||
:param path: The complete path of the folder you want to monitor.
|
||||
:type path: str
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ cdef class Idler(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""Idler(...)
|
||||
"""
|
||||
|
||||
:param func: Function to call when system is idle.
|
||||
:type func: callable
|
||||
|
@ -59,22 +59,38 @@ cdef class Idler(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idler_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idler_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idler_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Idler(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Idler(func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Idler(obj=%#x, func=%s, args=%s, kargs=%s)" % (
|
||||
<uintptr_t>self.obj2, self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idler_del(self.obj)
|
||||
ecore_idler_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def stop(self):
|
||||
"""Alias for stop()."""
|
||||
|
@ -107,7 +123,7 @@ cdef class IdleEnterer(Idler):
|
|||
|
||||
"""
|
||||
def __init__(self, func, *args, **kargs):
|
||||
"""IdleEnterer(...)
|
||||
"""
|
||||
|
||||
:param func: Function to call when system enters idle.
|
||||
:type func: callable
|
||||
|
@ -126,11 +142,18 @@ cdef class IdleEnterer(Idler):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idle_enterer_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idle_enterer_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idle_enterer_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idle_enterer_del(self.obj)
|
||||
ecore_idle_enterer_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class IdleExiter(Idler):
|
||||
|
@ -173,11 +196,18 @@ cdef class IdleExiter(Idler):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.18 idlers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_idle_exiter_add(_ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def delete(self):
|
||||
"""Stop callback emission and free internal resources."""
|
||||
ecore_idle_exiter_del(self.obj)
|
||||
ecore_idle_exiter_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
def idler_add(func, *args, **kargs):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -60,7 +60,7 @@ cdef class Poller(Eo):
|
|||
|
||||
"""
|
||||
def __init__(self, int interval, func, pol_type=0, *args, **kargs):
|
||||
"""Poller(...)
|
||||
"""
|
||||
|
||||
:param interval: The poll interval
|
||||
:type interval: int
|
||||
|
@ -83,24 +83,39 @@ cdef class Poller(Eo):
|
|||
self.func = func
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
self._set_obj(ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self))
|
||||
|
||||
# From efl 1.20 pollers are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self))
|
||||
self.obj2 = ecore_poller_add(pol_type, interval, _ecore_task_cb, <void *>self)
|
||||
Py_INCREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s Poller(func=%s, args=%s, kargs=%s)" % (Eo.__str__(self),
|
||||
self.func, self.args, self.kargs)
|
||||
return "Poller(func=%s, args=%s, kargs=%s)" % (
|
||||
self.func, self.args, self.kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s Poller(interval=%d, func=%s, args=%s, kargs=%s)" % (Eo.__repr__(self),
|
||||
self.interval if self.obj else -1,
|
||||
return "Poller(interval=%d, func=%s, args=%s, kargs=%s)" % (
|
||||
self.interval if self.obj2 else -1,
|
||||
self.func, self.args, self.kargs)
|
||||
|
||||
cpdef bint _task_exec(self) except *:
|
||||
return self.func(*self.args, **self.kargs)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
def delete(self):
|
||||
""" Stop callback emission and free internal resources. """
|
||||
ecore_poller_del(self.obj)
|
||||
|
||||
ecore_poller_del(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
property interval:
|
||||
""" The interval (in ticks) between each call of the poller
|
||||
|
@ -109,15 +124,15 @@ cdef class Poller(Eo):
|
|||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_poller_poller_interval_get(self.obj)
|
||||
return ecore_poller_poller_interval_get(self.obj2)
|
||||
|
||||
def __set__(self, int t):
|
||||
ecore_poller_poller_interval_set(self.obj, t)
|
||||
ecore_poller_poller_interval_set(self.obj2, t)
|
||||
|
||||
def interval_set(self, int t):
|
||||
ecore_poller_poller_interval_set(self.obj, t)
|
||||
ecore_poller_poller_interval_set(self.obj2, t)
|
||||
def interval_get(self):
|
||||
return ecore_poller_poller_interval_get(self.obj)
|
||||
return ecore_poller_poller_interval_get(self.obj2)
|
||||
|
||||
|
||||
def poller_add(int t, func, *args, **kargs):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2007-2015 various contributors (see AUTHORS)
|
||||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
|
@ -36,9 +36,13 @@ cdef class Timer(Eo):
|
|||
returning *False* from ``func``, otherwise they'll continue alive, even
|
||||
if the current python context delete it's reference to it.
|
||||
|
||||
For convenience and readability callback can also return one of the
|
||||
:ref:`Ecore_Callback_Returns`. That is ``ECORE_CALLBACK_RENEW`` (like
|
||||
returning True) or ``ECORE_CALLBACK_CANCEL`` (like returning False).
|
||||
|
||||
"""
|
||||
def __init__(self, double interval, func, *args, **kargs):
|
||||
"""Timer(...)
|
||||
"""
|
||||
|
||||
:param interval: interval in seconds.
|
||||
:type interval: float
|
||||
|
|
|
@ -0,0 +1,347 @@
|
|||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
:mod:`efl.ecore_con` Module
|
||||
###########################
|
||||
|
||||
The ecore_con module provide various utilities to perform different network
|
||||
related tasks. Everything in a full async ecore way. Most notable are the
|
||||
:class:`Lookup` class to perform DNS requests, the :class:`Url` class to
|
||||
perform HTTP requests and the :class:`Server` class to implement your own
|
||||
server.
|
||||
|
||||
Don't forget about the :class:`efl.ecore.FileDownload` class if what you need
|
||||
is just to fetch some data to file.
|
||||
|
||||
|
||||
Classes
|
||||
=======
|
||||
|
||||
.. toctree::
|
||||
|
||||
class-lookup.rst
|
||||
class-url.rst
|
||||
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
.. _Ecore_Con_Type:
|
||||
|
||||
Ecore Con Type
|
||||
--------------
|
||||
|
||||
Types for an ecore_con client/server object.
|
||||
|
||||
A correct way to set this type is with an ECORE_CON_$TYPE, optionally OR'ed
|
||||
with an ECORE_CON_$USE if encryption is desired, and LOAD_CERT if the
|
||||
previously loaded certificate should be used.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_USER
|
||||
|
||||
Socket in ~/.ecore.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_SYSTEM
|
||||
|
||||
Socket in /tmp.
|
||||
|
||||
.. data:: ECORE_CON_LOCAL_ABSTRACT
|
||||
|
||||
Abstract socket.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_TCP
|
||||
|
||||
Remote server using TCP.
|
||||
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_MCAST
|
||||
|
||||
Remote multicast server.
|
||||
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_UDP
|
||||
|
||||
Remote server using UDP.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_BROADCAST
|
||||
|
||||
Remote broadcast using UDP.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_NODELAY
|
||||
|
||||
Remote connection sending packets immediately.
|
||||
|
||||
.. data:: ECORE_CON_REMOTE_CORK
|
||||
|
||||
Remote connection sending data in large chunks. (only on linux)
|
||||
|
||||
.. data:: ECORE_CON_USE_SSL2
|
||||
|
||||
Use SSL2: UNSUPPORTED.
|
||||
|
||||
.. data:: ECORE_CON_USE_SSL3
|
||||
|
||||
Use SSL3: UNSUPPORTED.
|
||||
|
||||
.. data:: ECORE_CON_USE_TLS
|
||||
|
||||
Use TLS.
|
||||
|
||||
.. data:: ECORE_CON_USE_MIXED
|
||||
|
||||
Use both TLS and SSL3.
|
||||
|
||||
.. data:: ECORE_CON_LOAD_CERT
|
||||
|
||||
Attempt to use the loaded certificate.
|
||||
|
||||
.. data:: ECORE_CON_NO_PROXY
|
||||
|
||||
Disable all types of proxy on the server.
|
||||
|
||||
|
||||
.. _Ecore_Con_Url_Time:
|
||||
|
||||
Ecore Con Url Time
|
||||
------------------
|
||||
|
||||
The type of condition to use when making an HTTP request dependent on time, so
|
||||
that headers such as "If-Modified-Since" are used.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_NONE
|
||||
|
||||
Do not place time restrictions on the HTTP requests.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_IFMODSINCE
|
||||
|
||||
Add the "If-Modified-Since" HTTP header, so that the request is performed by
|
||||
the server only if the target has been modified since the time value passed
|
||||
to it in the request.
|
||||
|
||||
.. data:: ECORE_CON_URL_TIME_IFUNMODSINCE
|
||||
|
||||
Add the "If-Unmodified-Since" HTTP header, so that the request is performed
|
||||
by the server only if the target has NOT been modified since the time value
|
||||
passed to it in the request.
|
||||
|
||||
|
||||
.. _Ecore_Con_Url_Http_Version:
|
||||
|
||||
Ecore Con Url Http Version
|
||||
--------------------------
|
||||
|
||||
The http version to use.
|
||||
|
||||
.. data:: ECORE_CON_URL_HTTP_VERSION_1_0
|
||||
|
||||
HTTP version 1.0.
|
||||
|
||||
.. data:: ECORE_CON_URL_HTTP_VERSION_1_1
|
||||
|
||||
HTTP version 1.1 (default)
|
||||
|
||||
|
||||
Module level functions
|
||||
======================
|
||||
|
||||
"""
|
||||
|
||||
from libc.stdint cimport uintptr_t
|
||||
from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF
|
||||
|
||||
import traceback
|
||||
import atexit
|
||||
|
||||
|
||||
from efl.ecore cimport _event_mapping_register, _event_mapping_get, \
|
||||
ecore_event_handler_add, ecore_event_handler_del
|
||||
|
||||
cimport efl.ecore_con.enums as enums
|
||||
|
||||
ECORE_CON_LOCAL_USER = enums.ECORE_CON_LOCAL_USER
|
||||
ECORE_CON_LOCAL_SYSTEM = enums.ECORE_CON_LOCAL_SYSTEM
|
||||
ECORE_CON_LOCAL_ABSTRACT = enums.ECORE_CON_LOCAL_ABSTRACT
|
||||
ECORE_CON_REMOTE_TCP = enums.ECORE_CON_REMOTE_TCP
|
||||
ECORE_CON_REMOTE_MCAST = enums.ECORE_CON_REMOTE_MCAST
|
||||
ECORE_CON_REMOTE_UDP = enums.ECORE_CON_REMOTE_UDP
|
||||
ECORE_CON_REMOTE_BROADCAST = enums.ECORE_CON_REMOTE_BROADCAST
|
||||
ECORE_CON_REMOTE_NODELAY = enums.ECORE_CON_REMOTE_NODELAY
|
||||
ECORE_CON_REMOTE_CORK = enums.ECORE_CON_REMOTE_CORK
|
||||
ECORE_CON_USE_SSL2 = enums.ECORE_CON_USE_SSL2
|
||||
ECORE_CON_USE_SSL3 = enums.ECORE_CON_USE_SSL3
|
||||
ECORE_CON_USE_TLS = enums.ECORE_CON_USE_TLS
|
||||
ECORE_CON_USE_MIXED = enums.ECORE_CON_USE_MIXED
|
||||
ECORE_CON_LOAD_CERT = enums.ECORE_CON_LOAD_CERT
|
||||
ECORE_CON_NO_PROXY = enums.ECORE_CON_NO_PROXY
|
||||
ECORE_CON_SOCKET_ACTIVATE = enums.ECORE_CON_SOCKET_ACTIVATE
|
||||
|
||||
ECORE_CON_URL_TIME_NONE = enums.ECORE_CON_URL_TIME_NONE
|
||||
ECORE_CON_URL_TIME_IFMODSINCE = enums.ECORE_CON_URL_TIME_IFMODSINCE
|
||||
ECORE_CON_URL_TIME_IFUNMODSINCE = enums.ECORE_CON_URL_TIME_IFUNMODSINCE
|
||||
|
||||
ECORE_CON_URL_HTTP_VERSION_1_0 = enums.ECORE_CON_URL_HTTP_VERSION_1_0
|
||||
ECORE_CON_URL_HTTP_VERSION_1_1 = enums.ECORE_CON_URL_HTTP_VERSION_1_1
|
||||
|
||||
|
||||
cdef int _con_events_registered = 0
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the Ecore Con library
|
||||
|
||||
.. note::
|
||||
You never need to call this function, it is automatically called when
|
||||
the module is imported.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
|
||||
ecore_con_init()
|
||||
ecore_con_url_init()
|
||||
|
||||
global _con_events_registered
|
||||
if _con_events_registered == 0:
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_COMPLETE, EventUrlComplete)
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_PROGRESS, EventUrlProgress)
|
||||
_event_mapping_register(ECORE_CON_EVENT_URL_DATA, EventUrlData)
|
||||
_con_events_registered = 1
|
||||
|
||||
|
||||
def shutdown():
|
||||
"""Shuts down the Ecore Con library.
|
||||
|
||||
.. note::
|
||||
You never need to call this function, it is automatically called atexit.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
ecore_con_url_shutdown()
|
||||
ecore_con_shutdown()
|
||||
|
||||
|
||||
cdef Eina_Bool _con_event_filter_cb(void *data, int ev_type, void *ev) with gil:
|
||||
cdef:
|
||||
ConEventFilter filter = <ConEventFilter>data
|
||||
object event_cls
|
||||
Event py_event
|
||||
list cbs
|
||||
Eo obj
|
||||
object func
|
||||
tuple args
|
||||
dict kargs
|
||||
|
||||
# create correct "EventAbc" python object, using the global mapping
|
||||
event_cls = _event_mapping_get(ev_type)
|
||||
if event_cls:
|
||||
py_event = event_cls()
|
||||
|
||||
# object_from_instance can fail in _set_obj if the event is
|
||||
# generated from an object not managed by us, so just ignore it.
|
||||
try:
|
||||
py_event._set_obj(ev)
|
||||
except:
|
||||
return 1
|
||||
|
||||
# do we have callbacks for this object/event ?
|
||||
try:
|
||||
obj = py_event._get_obj()
|
||||
cbs = filter.callbacks.get(ev_type).get(obj)
|
||||
except:
|
||||
cbs = None
|
||||
|
||||
if cbs:
|
||||
cbs = cbs[:] # copy, so we can change filter.callbacks
|
||||
for func, args, kargs in cbs:
|
||||
try:
|
||||
func(py_event, *args, **kargs)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
return 1 # always return true, no matter what
|
||||
|
||||
cdef class ConEventFilter(object):
|
||||
|
||||
"""
|
||||
self.callbacks = {
|
||||
EV_TYPE: {
|
||||
objX: [(cb,args,kargs), ... ]
|
||||
objY: [(cb,args,kargs), ... ]
|
||||
},
|
||||
...
|
||||
}
|
||||
"""
|
||||
|
||||
def __cinit__(self):
|
||||
self.callbacks = {}
|
||||
self.handlers = {}
|
||||
|
||||
cdef callback_add(self, int ev_type, Eo obj, object func, tuple args, dict kargs):
|
||||
# store the function in the callbacks dict
|
||||
if not ev_type in self.callbacks:
|
||||
self.callbacks[ev_type] = {}
|
||||
if not obj in self.callbacks[ev_type]:
|
||||
self.callbacks[ev_type][obj] = []
|
||||
self.callbacks[ev_type][obj].append((func,args,kargs))
|
||||
|
||||
# connect a single ecore signal, one per event_type
|
||||
cdef Ecore_Event_Handler* ee
|
||||
if not ev_type in self.handlers:
|
||||
ee = ecore_event_handler_add(ev_type, _con_event_filter_cb,
|
||||
<void *>self)
|
||||
self.handlers[ev_type] = <uintptr_t><void *>ee
|
||||
|
||||
cdef callback_del(self, int ev_type, Eo obj, object func, tuple args, dict kargs):
|
||||
try:
|
||||
self.callbacks[ev_type][obj].remove((func, args, kargs))
|
||||
except ValueError:
|
||||
raise ValueError(
|
||||
"callback is not registered: %s, args=%s, kargs=%s" %
|
||||
(func, args, kargs))
|
||||
|
||||
# can delete the ecore handler?
|
||||
if self.callbacks.get(ev_type) and self.callbacks.get(ev_type).get(obj):
|
||||
return
|
||||
if ev_type in self.handlers:
|
||||
handler = self.handlers.pop(ev_type)
|
||||
ecore_event_handler_del(<Ecore_Event_Handler *><uintptr_t>handler)
|
||||
|
||||
cdef callback_del_full(self, Eo obj):
|
||||
for ev_type in self.callbacks:
|
||||
if obj in self.callbacks[ev_type]:
|
||||
# remove all the cbs for the obj
|
||||
self.callbacks[ev_type].pop(obj, None)
|
||||
|
||||
# can delete the ecore handler?
|
||||
if len(self.callbacks[ev_type]) < 1 and ev_type in self.handlers:
|
||||
handler = self.handlers.pop(ev_type)
|
||||
ecore_event_handler_del(<Ecore_Event_Handler *><uintptr_t>handler)
|
||||
|
||||
# name suggestions are welcome for this unusual "singleton" instance
|
||||
cdef ConEventFilter GEF = ConEventFilter()
|
||||
|
||||
|
||||
include "efl.ecore_con_lookup.pxi"
|
||||
include "efl.ecore_con_url.pxi"
|
||||
|
||||
|
||||
init()
|
||||
atexit.register(shutdown)
|
|
@ -0,0 +1,88 @@
|
|||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef void _con_dns_lookup_cb(const char *canonname, const char *ip, sockaddr *sockaddr, int addrlen, void *data) with gil:
|
||||
cdef Lookup self = <Lookup>data
|
||||
|
||||
try:
|
||||
# TODO read sockaddr and replace the placeholder None with something
|
||||
# more usefull from the sockaddr struct.
|
||||
self.done_cb(_ctouni(canonname), _ctouni(ip), None, *self.args, **self.kargs)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class Lookup(object):
|
||||
def __init__(self, name, done_cb, *args, **kargs):
|
||||
"""
|
||||
|
||||
A simple class to perform asynchronous DNS lookups.
|
||||
|
||||
:param string name: The hostname to query
|
||||
:param callable done_cb: The function to call when done
|
||||
:param \*args: Any other arguments will be passed back in ``done_cb``
|
||||
:param \**kargs: Any other keywords arguments will be passed back in ``done_cb``
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
Just create an instance and give a callback function to be called
|
||||
when the operation is complete.
|
||||
|
||||
This class performs a DNS lookup on the hostname specified by
|
||||
`name`, then calls `done_cb` with the result and the data given as
|
||||
parameter. The result will be given to the done_cb as follows:
|
||||
|
||||
**expected `done_cb` signature**::
|
||||
|
||||
func(canonname, ip, sockaddr)
|
||||
|
||||
where:
|
||||
* **canonname** (string) is the canonical domain name
|
||||
* **ip** (string) is the recolved ip address
|
||||
* **sockaddr** (None) is a placeholder for future expansion
|
||||
|
||||
|
||||
|
||||
**Usage example**::
|
||||
|
||||
import ecore_con
|
||||
|
||||
def done_cb(canonname, ip, sockaddr):
|
||||
print(canonname)
|
||||
print(ip)
|
||||
|
||||
ecore_con.Lookup('example.com', done_cb)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
if not callable(done_cb):
|
||||
raise TypeError("Parameter 'done_cb' must be callable")
|
||||
|
||||
self.done_cb = done_cb
|
||||
self.args = args
|
||||
self.kargs = kargs
|
||||
|
||||
if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
|
||||
ecore_con_lookup(<const char *>name if name is not None else NULL,
|
||||
_con_dns_lookup_cb, <void*>self)
|
||||
|
||||
Py_INCREF(self)
|
||||
|
|
@ -0,0 +1,845 @@
|
|||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# from efl.ecore cimport EventHandler
|
||||
# from efl.utils.conversions cimport _ctouni as _charp_to_str
|
||||
|
||||
|
||||
|
||||
cdef class EventUrlProgress(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Progress event from C-api.
|
||||
|
||||
This event notifies the progress of the current operation.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* down_total(double): total size of the downloading data (in bytes)
|
||||
* down_now(double): current size of the downloading data (in bytes)
|
||||
* up_total(double): total size of the uploading data (in bytes)
|
||||
* up_now(double): current size of the uploading data (in bytes)
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Progress *event
|
||||
event = <Ecore_Con_Event_Url_Progress*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.down_total = event.down.total
|
||||
self.down_now = event.down.now
|
||||
self.up_total = event.up.total
|
||||
self.up_now = event.up.now
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
cdef class EventUrlComplete(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Complete event from C-api.
|
||||
|
||||
This event notifies the operation is completed.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* status(int): HTTP status code of the operation (200, 404, 401, etc.)
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Complete *event
|
||||
event = <Ecore_Con_Event_Url_Complete*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.status = event.status
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
cdef class EventUrlData(Event):
|
||||
"""Represents Ecore_Con_Event_Url_Data event from C-api.
|
||||
|
||||
This event hold the data while the are received.
|
||||
|
||||
.. note::
|
||||
The data attribute is a raw series of bytes, map to ``str`` in python2
|
||||
and ``bytes`` in python3.
|
||||
|
||||
attributes:
|
||||
* url (:class:`Url`): the object that generate the event
|
||||
* size(int): the size of the current received data (in bytes)
|
||||
* data(bytes): the data received on this event
|
||||
|
||||
"""
|
||||
cdef int _set_obj(self, void *ev) except 0:
|
||||
cdef Ecore_Con_Event_Url_Data *event
|
||||
event = <Ecore_Con_Event_Url_Data*>ev
|
||||
|
||||
self.url = <Url>ecore_con_url_data_get(event.url_con)
|
||||
self.size = event.size
|
||||
self.data = event.data[:event.size] #raw string copy
|
||||
return 1
|
||||
|
||||
cdef object _get_obj(self):
|
||||
return self.url
|
||||
|
||||
|
||||
cdef class Url(Eo):
|
||||
"""
|
||||
|
||||
Utility class to make it easy to perform http requests (POST, GET, etc).
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
Brief usage:
|
||||
1. Create an :class:`Url` object with ecore_con.Url('myurl')
|
||||
2. Register object callbacks using :func:`on_complete_event_add`,
|
||||
:func:`on_progress_event_add` and :func:`on_data_event_add` to
|
||||
receive the response, e.g. for HTTP/FTP downloads.
|
||||
3. Perform the operation with :func:`get`, :func:`head` and :func:`post`
|
||||
|
||||
If it's necessary use the :attr:`url` property. to change the object url.
|
||||
|
||||
.. note::
|
||||
It is good practice to reuse :class:`Url` objects wherever possible,
|
||||
but bear in mind that each one can only perform one operation at a
|
||||
time. You need to wait for the complete event before re-using or
|
||||
destroying the object.
|
||||
|
||||
.. warning::
|
||||
It is **really important** to call the :func:`delete()` method as soon
|
||||
as you have finished with your object, as it automatically remove all
|
||||
the registered events for you, that will otherwise continue to use
|
||||
resources.
|
||||
|
||||
Basic usage examples::
|
||||
|
||||
# HTTP GET
|
||||
u = ecore.Url("http://www.google.com")
|
||||
u.get()
|
||||
|
||||
# HTTP POST
|
||||
u = ecore.Url('https://httpbin.org/post')
|
||||
u.post(b'my data to post', 'text/txt')
|
||||
|
||||
# FTP download
|
||||
u = ecore.Url("ftp://ftp.example.com/pub/myfile")
|
||||
u.get()
|
||||
|
||||
# FTP upload as ftp://ftp.example.com/file
|
||||
u = ecore.Url("ftp://ftp.example.com")
|
||||
u.ftp_upload("/tmp/file", "user", "pass", None)
|
||||
|
||||
# FTP upload as ftp://ftp.example.com/dir/file
|
||||
u = ecore.Url("ftp://ftp.example.com")
|
||||
u.ftp_upload("/tmp/file", "user", "pass", "dir")
|
||||
|
||||
To actually make something usefull with your request you will need to
|
||||
connect the :class:`EventUrlComplete`, :class:`EventUrlProgress` and
|
||||
:class:`EventUrlData` events using the :func:`on_complete_event_add` and
|
||||
friends functions.
|
||||
|
||||
A more complete example::
|
||||
|
||||
from efl import ecore
|
||||
|
||||
def on_data(event):
|
||||
print("data: " + str(event.data[:80]))
|
||||
# do something here with the received data
|
||||
|
||||
def on_progress(event):
|
||||
# print(event)
|
||||
print("received %d on a total of %d bytes" % (
|
||||
event.down_now, event.down_total))
|
||||
|
||||
def on_complete(event):
|
||||
# print(event)
|
||||
print("http result: %d" % event.status)
|
||||
print("Total received bytes: %d" % event.url.received_bytes)
|
||||
|
||||
u.delete() # don't forget to delete !!
|
||||
|
||||
u = ecore.Url('http://www.google.com', verbose=False)
|
||||
u.on_data_event_add(on_data)
|
||||
u.on_progress_event_add(on_progress)
|
||||
u.on_complete_event_add(on_complete)
|
||||
u.get()
|
||||
|
||||
ecore.main_loop_begin()
|
||||
|
||||
If you need to save the received data to a file use the :attr:`fd`
|
||||
property, as::
|
||||
|
||||
fd = open('/tmp/tmpMxBtta', 'w')
|
||||
u = ecore.Url('http://example.com', fd=fd.fileno())
|
||||
u.get()
|
||||
|
||||
.. seealso::
|
||||
If you just need to download a file please consider using the
|
||||
simpler :class:`efl.ecore.FileDownload` class instead.
|
||||
|
||||
.. seealso::
|
||||
The ecore module level functions :func:`url_pipeline_set` and
|
||||
:func:`url_pipeline_get` to enable HTTP 1.1 pipelining.
|
||||
|
||||
"""
|
||||
def __init__(self, url, custom_request=None, **kargs):
|
||||
"""
|
||||
|
||||
:param url: URL that will receive requests.
|
||||
:type url: string
|
||||
:param custom_request: Custom request (e.g. GET, POST, HEAD, PUT, HEAD,
|
||||
SUBSCRIBE and other obscure HTTP requests)
|
||||
:type custom_request: string
|
||||
:param \**kwargs: All the remaining keyword arguments are interpreted
|
||||
as properties of the instance
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||
if custom_request is None:
|
||||
# From efl 1.19 url are no more Eo objects in C, thus
|
||||
# we cannot use Eo.obj and _set_obj() anymore :(
|
||||
# self._set_obj(ecore_con_url_new(
|
||||
# <const char *>url if url is not None else NULL))
|
||||
self.obj2 = ecore_con_url_new(
|
||||
<const char *>url if url is not None else NULL)
|
||||
|
||||
else:
|
||||
if isinstance(custom_request, unicode):
|
||||
custom_request = PyUnicode_AsUTF8String(custom_request)
|
||||
self.obj2 = ecore_con_url_custom_new(
|
||||
<const char *>url if url is not None else NULL,
|
||||
<const char *>custom_request if custom_request is not None else NULL)
|
||||
|
||||
ecore_con_url_data_set(self.obj2, <void *>self)
|
||||
Py_INCREF(self)
|
||||
self._set_properties_from_keyword_args(kargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(url=%s)" % (self.__class__.__name__, self.url)
|
||||
|
||||
def delete(self):
|
||||
"""Delete the :class:`Url` object and free all used resources.
|
||||
|
||||
.. note::
|
||||
This is **really important** to call as soon as you have finished
|
||||
with your object, as it automatically remove all the registered
|
||||
events. That will otherwise continue to use resources.
|
||||
|
||||
"""
|
||||
GEF.callback_del_full(self)
|
||||
ecore_con_url_free(self.obj2)
|
||||
self.obj2 = NULL
|
||||
Py_DECREF(self)
|
||||
|
||||
def is_deleted(self):
|
||||
"""Check if the object has been deleted thus leaving the object shallow.
|
||||
|
||||
:return: True if the object has been deleted yet, False otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(self.obj2 == NULL)
|
||||
|
||||
property fd:
|
||||
"""Set up a file to have response data written into.
|
||||
|
||||
This attr can be used to easily setup a file where the downloaded data
|
||||
will be saved.
|
||||
|
||||
Note that :class:`EventUrlData` events will not be emitted if a file
|
||||
has been set to receive the response data.
|
||||
|
||||
.. seealso::
|
||||
If you just need to download a file please consider using the
|
||||
simpler :class:`efl.ecore.FileDownload` class instead.
|
||||
|
||||
:type: int (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, int fd):
|
||||
ecore_con_url_fd_set(self.obj2, fd)
|
||||
|
||||
def get(self):
|
||||
"""Send a GET request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_get(self.obj2))
|
||||
|
||||
def head(self):
|
||||
"""Send a HEAD request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_head(self.obj2))
|
||||
|
||||
def post(self, bytes data, content_type):
|
||||
"""Send a post request.
|
||||
|
||||
The request is performed immediately, but you need to setup event
|
||||
handlers with :func:`on_complete_event_add` or
|
||||
:func:`on_complete_event_add` to get more information about its result.
|
||||
|
||||
:param data: Payload (data sent on the request). Can be ``None``.
|
||||
:type data: bytes
|
||||
:param content_type: Content type of the payload (e.g. `text/xml`).
|
||||
Can be ``None``.
|
||||
:type content_type: string
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
|
||||
"""
|
||||
if isinstance(content_type, unicode):
|
||||
content_type = PyUnicode_AsUTF8String(content_type)
|
||||
return bool(ecore_con_url_post(self.obj2,
|
||||
<const void*><const char *>data if data is not None else NULL,
|
||||
len(data),
|
||||
<const char *>content_type if content_type is not None else NULL))
|
||||
|
||||
def time(self, Ecore_Con_Url_Time time_condition, double timestamp):
|
||||
"""Whether HTTP requests should be conditional, dependent on
|
||||
modification time.
|
||||
|
||||
This function may set the header `If-Modified-Since` or
|
||||
`If-Unmodified-Since`, depending on the value of time_condition, with
|
||||
the value timestamp.
|
||||
|
||||
:param time_condition: Condition to use for HTTP requests.
|
||||
:type time_condition: :ref:`Ecore_Con_Url_Time`
|
||||
:param timestamp: Time since 1 Jan 1970 to use in the condition.
|
||||
:type timestamp: double
|
||||
|
||||
"""
|
||||
ecore_con_url_time(self.obj2, time_condition, timestamp)
|
||||
|
||||
def ftp_upload(self, filename, user, passwd, upload_dir):
|
||||
"""Upload a file to an ftp site.
|
||||
|
||||
:param string filename: The path to the file to send
|
||||
:param string user: The username to log in with
|
||||
:param string passwd: The password to log in with
|
||||
:param string upload_dir: The directory to which the file will upload
|
||||
|
||||
:return: ``True`` on success, ``False`` otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
if isinstance(filename, unicode): filename = PyUnicode_AsUTF8String(filename)
|
||||
if isinstance(user, unicode): user = PyUnicode_AsUTF8String(user)
|
||||
if isinstance(passwd, unicode): passwd = PyUnicode_AsUTF8String(passwd)
|
||||
if isinstance(upload_dir, unicode): upload_dir = PyUnicode_AsUTF8String(upload_dir)
|
||||
return bool(ecore_con_url_ftp_upload(self.obj2,
|
||||
<const char *>filename if filename is not None else NULL,
|
||||
<const char *>user if user is not None else NULL,
|
||||
<const char *>passwd if passwd is not None else NULL,
|
||||
<const char *>upload_dir if upload_dir is not None else NULL))
|
||||
|
||||
property ftp_use_epsv:
|
||||
"""Enable or disable EPSV extension.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint use_epsv):
|
||||
ecore_con_url_ftp_use_epsv_set(self.obj2, use_epsv)
|
||||
|
||||
def cookies_init(self):
|
||||
"""Enable the cookie engine for subsequent HTTP requests.
|
||||
|
||||
After this function is called, cookies set by the server in HTTP
|
||||
responses will be parsed and stored, as well as sent back to the server
|
||||
in new HTTP requests.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_init(self.obj2)
|
||||
|
||||
def cookies_clear(self):
|
||||
"""Clear currently loaded cookies.
|
||||
|
||||
The cleared cookies are removed and will not be sent in subsequent HTTP
|
||||
requests, nor will they be written to the cookiejar file set via
|
||||
:attr:`cookies_jar_file`.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet. The cookie files set by
|
||||
:func:`cookies_file_add` aren't loaded immediately, just
|
||||
when the request is started. Thus, if you ask to clear the cookies,
|
||||
but has a file already set by that function, the cookies will then
|
||||
be loaded and you will have old cookies set. In order to don't have
|
||||
any old cookie set, you need to don't call
|
||||
:func:`cookies_file_add` ever on the :class:`Url` class, and
|
||||
call this function to clear any cookie set by a previous request on
|
||||
this handler.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_clear(self.obj2)
|
||||
|
||||
def cookies_session_clear(self):
|
||||
"""Clear currently loaded session cookies.
|
||||
|
||||
Session cookies are cookies with no expire date set, which usually
|
||||
means they are removed after the current session is closed.
|
||||
|
||||
The cleared cookies are removed and will not be sent in subsequent HTTP
|
||||
requests, nor will they be written to the cookiejar file set via
|
||||
:attr:`cookies_jar_file`.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet. The cookie files set by
|
||||
:func:`cookies_file_add` aren't loaded immediately, just
|
||||
when the request is started. Thus, if you ask to clear the session
|
||||
cookies, but has a file already set by that function, the session
|
||||
cookies will then be loaded and you will have old cookies set. In
|
||||
order to don't have any old session cookie set, you need to don't
|
||||
call :func:`cookies_file_add` ever on the :class:`Url` class, and
|
||||
call this function to clear any session cookie set by a previous
|
||||
request on this handler. An easier way to don't use old session
|
||||
cookies is by using the function
|
||||
:attr:`cookies_ignore_old_session`.
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_session_clear(self.obj2)
|
||||
|
||||
def cookies_file_add(self, file_name):
|
||||
"""Add a file to the list of files from which to load cookies.
|
||||
|
||||
Files must contain cookies defined according to two possible formats:
|
||||
* HTTP-style header ("Set-Cookie: ...").
|
||||
* Netscape/Mozilla cookie data format.
|
||||
|
||||
Cookies will only be read from this file. If you want to save cookies
|
||||
to a file, use :attr:`cookies_jar_file`. Also notice that
|
||||
this function supports the both types of cookie file cited above, while
|
||||
:attr:`cookies_jar_file` will save only in the Netscape/Mozilla's
|
||||
format.
|
||||
|
||||
Please notice that the file will not be read immediately, but rather
|
||||
added to a list of files that will be loaded and parsed at a later
|
||||
time.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
:param string file_name: Name of the file that will be added to the list.
|
||||
|
||||
"""
|
||||
if isinstance(file_name, unicode):
|
||||
file_name = PyUnicode_AsUTF8String(file_name)
|
||||
ecore_con_url_cookies_file_add(self.obj2,
|
||||
<const char *>file_name if file_name is not None else NULL)
|
||||
|
||||
property cookies_jar_file:
|
||||
"""The name of the file to which all current cookies will be written
|
||||
when either cookies are flushed or Ecore_Con is shut down.
|
||||
|
||||
Cookies are written following Netscape/Mozilla's data format, also
|
||||
known as cookie-jar.
|
||||
|
||||
Cookies will only be saved to this file. If you need to read cookies
|
||||
from a file, use ecore_con_url_cookies_file_add() instead.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
.. seealso:: :func:`cookies_jar_write`
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, cookiejar_file):
|
||||
if isinstance(cookiejar_file, unicode):
|
||||
cookiejar_file = PyUnicode_AsUTF8String(cookiejar_file)
|
||||
ecore_con_url_cookies_jar_file_set(self.obj2,
|
||||
<const char *>cookiejar_file if cookiejar_file is not None else NULL)
|
||||
if isinstance(cookiejar_file, unicode):
|
||||
cookiejar_file = PyUnicode_AsUTF8String(cookiejar_file)
|
||||
ecore_con_url_cookies_jar_file_set(self.obj2,
|
||||
<const char *>cookiejar_file if cookiejar_file is not None else NULL)
|
||||
|
||||
def cookies_jar_write(self):
|
||||
"""Write all current cookies to the cookie jar immediately.
|
||||
|
||||
A cookie-jar file must have been previously set by
|
||||
:attr:`cookies_jar_file`, otherwise nothing will be done.
|
||||
|
||||
.. note::
|
||||
This function will initialize the cookie engine if it has not been
|
||||
initialized yet.
|
||||
|
||||
.. seealso:: :attr:`cookies_jar_file`
|
||||
|
||||
"""
|
||||
ecore_con_url_cookies_jar_write(self.obj2)
|
||||
|
||||
property cookies_ignore_old_session:
|
||||
"""Control whether session cookies from previous sessions shall be loaded.
|
||||
|
||||
Session cookies are cookies with no expire date set, which usually
|
||||
means they are removed after the current session is closed.
|
||||
|
||||
By default, when Ecore_Con_Url loads cookies from a file, all cookies
|
||||
are loaded, including session cookies, which, most of the time, were
|
||||
supposed to be loaded and valid only for that session.
|
||||
|
||||
If ignore is set to ``True``, when Ecore_Con_Url loads cookies from
|
||||
the files passed to :func:`cookies_file_add`, session cookies
|
||||
will not be loaded.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint ignore):
|
||||
ecore_con_url_cookies_ignore_old_session_set(self.obj2, ignore)
|
||||
|
||||
property ssl_verify_peer:
|
||||
"""Toggle libcurl's verify peer's certificate option.
|
||||
|
||||
If this is ``True``, libcurl will verify the authenticity of the
|
||||
peer's certificate, otherwise it will not. Default behavior of libcurl
|
||||
is to check peer's certificate.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint verify):
|
||||
ecore_con_url_ssl_verify_peer_set(self.obj2, verify)
|
||||
|
||||
property ssl_ca:
|
||||
"""Set a custom CA to trust for SSL/TLS connections.
|
||||
|
||||
Specify the path of a file (in PEM format) containing one or more CA
|
||||
certificate(s) to use for the validation of the server certificate.
|
||||
|
||||
This can also disable CA validation if set to ``None``.
|
||||
However, the server certificate still needs to be valid for the
|
||||
connection to succeed (i.e., the certificate must concern the server
|
||||
the connection is made to).
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, ca_path):
|
||||
if isinstance(ca_path, unicode):
|
||||
ca_path = PyUnicode_AsUTF8String(ca_path)
|
||||
ecore_con_url_ssl_ca_set(self.obj2,
|
||||
<const char *>ca_path if ca_path is not None else NULL)
|
||||
|
||||
property proxy:
|
||||
"""Set the HTTP proxy to use.
|
||||
|
||||
The parameter is the host name or dotted IP address. To specify port
|
||||
number in this string, append :[port] to the end of the host name. The
|
||||
proxy string may be prefixed with [protocol]:// since any such prefix
|
||||
will be ignored. The proxy's port number may optionally be specified
|
||||
with the separate option. If not specified, libcurl will default to
|
||||
using port 1080 for proxies.
|
||||
|
||||
Set this to ``None`` to disable the usage of proxy.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, proxy):
|
||||
if isinstance(proxy, unicode): proxy = PyUnicode_AsUTF8String(proxy)
|
||||
ecore_con_url_proxy_set(self.obj2,
|
||||
<const char *>proxy if proxy is not None else NULL)
|
||||
|
||||
property proxy_username:
|
||||
"""Username to use for proxy.
|
||||
|
||||
If socks protocol is used for proxy, protocol should be socks5 and
|
||||
above.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, user):
|
||||
if isinstance(user, unicode): user = PyUnicode_AsUTF8String(user)
|
||||
ecore_con_url_proxy_username_set(self.obj2,
|
||||
<const char *>user if user is not None else NULL)
|
||||
|
||||
property proxy_password:
|
||||
"""Password to use for proxy.
|
||||
|
||||
If socks protocol is used for proxy, protocol should be socks5 and
|
||||
above.
|
||||
|
||||
:type: string (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, passwd):
|
||||
if isinstance(passwd, unicode): passwd = PyUnicode_AsUTF8String(passwd)
|
||||
ecore_con_url_proxy_username_set(self.obj2,
|
||||
<const char *>passwd if passwd is not None else NULL)
|
||||
|
||||
property timeout:
|
||||
"""transfer timeout in seconds.
|
||||
|
||||
The maximum time in seconds that you allow the :class:`Url` class
|
||||
transfer operation to take. Normally, name lookups can take a
|
||||
considerable time and limiting operations to less than a few minutes
|
||||
risk aborting perfectly normal operations.
|
||||
|
||||
:type: double (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, double timeout):
|
||||
ecore_con_url_timeout_set(self.obj2, timeout)
|
||||
|
||||
property http_version:
|
||||
"""The HTTP version used for the request.
|
||||
|
||||
Can be :data:`ECORE_CON_URL_HTTP_VERSION_1_0` or
|
||||
:data:`ECORE_CON_URL_HTTP_VERSION_1_1`
|
||||
|
||||
:type: :ref:`Ecore_Con_Url_Http_Version` (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, Ecore_Con_Url_Http_Version version):
|
||||
ecore_con_url_http_version_set(self.obj2, version)
|
||||
|
||||
property status_code:
|
||||
"""The returned HTTP STATUS code.
|
||||
|
||||
This is used to, at any time, try to return the status code for a
|
||||
transmission.
|
||||
|
||||
:type: int (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_con_url_status_code_get(self.obj2)
|
||||
|
||||
property url:
|
||||
"""Controls the URL to send the request to.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(ecore_con_url_url_get(self.obj2))
|
||||
|
||||
def __set__(self, url):
|
||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||
ecore_con_url_url_set(self.obj2, <const char *>url if url is not None else NULL)
|
||||
|
||||
property verbose:
|
||||
"""Toggle libcurl's verbose output.
|
||||
|
||||
If set to ``True``, libcurl will output a lot of verbose
|
||||
information about its operations, which is useful for debugging. The
|
||||
verbose information will be sent to stderr.
|
||||
|
||||
:type: bool (**writeonly**)
|
||||
|
||||
"""
|
||||
def __set__(self, bint verbose):
|
||||
ecore_con_url_verbose_set(self.obj2, verbose)
|
||||
|
||||
def additional_header_add(self, key, value):
|
||||
"""Add an additional header to the request connection object.
|
||||
|
||||
Add an additional header (User-Agent, Content-Type, etc.) to the
|
||||
request connection object. This addition will be valid for only one
|
||||
:func:`get` or :func:`post` call.
|
||||
|
||||
:param string key: Header key
|
||||
:param string value: Header value
|
||||
|
||||
Some functions like :func:`time` also add headers to the request.
|
||||
|
||||
"""
|
||||
if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
ecore_con_url_additional_header_add(self.obj2,
|
||||
<const char *>key if key is not None else NULL,
|
||||
<const char *>value if value is not None else NULL)
|
||||
|
||||
def additional_headers_clear(self):
|
||||
"""Clean additional headers.
|
||||
|
||||
Clean additional headers associated with a connection object
|
||||
(previously added with :func:additional_header_add`).
|
||||
|
||||
"""
|
||||
ecore_con_url_additional_headers_clear(self.obj2)
|
||||
|
||||
property response_headers:
|
||||
"""The headers from last request sent.
|
||||
|
||||
Retrieve a list containing the response headers. This function should
|
||||
be used after an :class:`EventUrlComplete` event (headers should
|
||||
normally be ready at that time).
|
||||
|
||||
:type: list of strings (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return eina_list_strings_to_python_list(
|
||||
ecore_con_url_response_headers_get(self.obj2))
|
||||
|
||||
property received_bytes:
|
||||
"""The number of bytes received.
|
||||
|
||||
Retrieve the number of bytes received on the last request of the
|
||||
:class:`Url` object.
|
||||
|
||||
:type: int (**readonly**)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return ecore_con_url_received_bytes_get(self.obj2)
|
||||
|
||||
def httpauth_set(self, username, password, bint safe):
|
||||
"""Set to use http auth, with given username and password
|
||||
|
||||
:param string username: Username to use in authentication
|
||||
:param string password: Password to use in authentication
|
||||
:param bool safe: Whether to use "safer" methods (eg, NOT http basic auth)
|
||||
|
||||
:return: ``True`` on success, ``False`` on error.
|
||||
:rtype: bool
|
||||
|
||||
.. warning:: Require libcurl >= 7.19.1 to work, otherwise will
|
||||
always return ``False``.
|
||||
|
||||
"""
|
||||
if isinstance(username, unicode):
|
||||
username = PyUnicode_AsUTF8String(username)
|
||||
if isinstance(password, unicode):
|
||||
password = PyUnicode_AsUTF8String(password)
|
||||
return bool(ecore_con_url_httpauth_set(self.obj2,
|
||||
<const char *>username if username is not None else NULL,
|
||||
<const char *>password if password is not None else NULL,
|
||||
safe))
|
||||
|
||||
def on_complete_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to know when the Url operation is completed.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlComplete` instance.
|
||||
|
||||
:see: :func:`on_complete_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_COMPLETE, self, func, args, kargs)
|
||||
|
||||
def on_complete_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_complete_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_COMPLETE, self, func, args, kargs)
|
||||
|
||||
def on_progress_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to know the operation status progress.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlProgress` instance.
|
||||
|
||||
:see: :func:`on_progress_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_PROGRESS, self, func, args, kargs)
|
||||
|
||||
def on_progress_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_progress_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_PROGRESS, self, func, args, kargs)
|
||||
|
||||
def on_data_event_add(self, func, *args, **kargs):
|
||||
"""Adds event listener to collect the data while they are received.
|
||||
|
||||
The given function will be called with the following signature::
|
||||
|
||||
func(event, *args, **kargs)
|
||||
|
||||
The ``event`` parameter is an :class:`EventUrlData` instance.
|
||||
|
||||
:see: :func:`on_data_event_del`
|
||||
|
||||
"""
|
||||
GEF.callback_add(ECORE_CON_EVENT_URL_DATA, self, func, args, kargs)
|
||||
|
||||
def on_data_event_del(self, func, *args, **kargs):
|
||||
"""Removes an event listener previously registered
|
||||
|
||||
Parameters must match exactly the ones given in the
|
||||
:func:`on_data_event_add` call
|
||||
|
||||
:raise ValueError: if parameters don't match an already
|
||||
registered callback.
|
||||
"""
|
||||
GEF.callback_del(ECORE_CON_EVENT_URL_DATA, self, func, args, kargs)
|
||||
|
||||
|
||||
def url_pipeline_set(bint enable):
|
||||
"""Enable or disable HTTP 1.1 pipelining.
|
||||
|
||||
Pipelining allows to send one request after another one, without having to
|
||||
wait for the reply of the first request. The respective replies are
|
||||
received in the order that the requests were sent.
|
||||
|
||||
.. warning:: Enabling this feature will be valid for all requests done
|
||||
using ecore_con_url.
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
ecore_con_url_pipeline_set(enable)
|
||||
|
||||
def url_pipeline_get():
|
||||
"""Is HTTP 1.1 pipelining enable ?
|
||||
|
||||
:return: ``True`` if enable
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
"""
|
||||
return bool(ecore_con_url_pipeline_get())
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
# Copyright (C) 2007-2022 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
:mod:`efl.ecore_input` Module
|
||||
#############################
|
||||
|
||||
.. versionadded:: 1.17
|
||||
|
||||
This module provide access to the low-level input events, you usually
|
||||
don't need to use this stuff, unless you need some sort of custom event
|
||||
handling.
|
||||
|
||||
To be informed about specific events just use one of the
|
||||
on_*_add(func, \*args, \**kargs) functions, the callback given will be fired
|
||||
when events occur.
|
||||
|
||||
Callback signature is::
|
||||
|
||||
func(event, *args, **kargs) → int
|
||||
|
||||
Where ``event`` will be a class relative to the specific event (such as
|
||||
:class:`EventKey`) All the additional arguments and keyword arguments passed
|
||||
in the \*_add function will be passed back in the callback.
|
||||
|
||||
In some events (EventKey at least) the callback function may return
|
||||
ecore.ECORE_CALLBACK_DONE or ecore.ECORE_CALLBACK_PASS_ON to block the
|
||||
event propagation down the chain or not.
|
||||
|
||||
To stop receiving event use :func:`efl.ecore.EventHandler.delete`
|
||||
|
||||
|
||||
Enumerations
|
||||
============
|
||||
|
||||
.. _Ecore_Event_Modifier:
|
||||
|
||||
Ecore_Event_Modifier
|
||||
--------------------
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_SHIFT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_CTRL
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_ALT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_WIN
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_SCROLL
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_NUM
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_CAPS
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_SCROLL
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_NUM
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_CAPS
|
||||
|
||||
.. data:: ECORE_EVENT_LOCK_SHIFT
|
||||
|
||||
.. data:: ECORE_EVENT_MODIFIER_ALTGR
|
||||
|
||||
|
||||
Classes and Functions
|
||||
=====================
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import atexit
|
||||
import traceback
|
||||
|
||||
cimport efl.ecore_input.enums as enums
|
||||
|
||||
def init():
|
||||
""" Initialize the Ecore Input library
|
||||
|
||||
.. note:: You never need to call this, it is automatically called at module
|
||||
import
|
||||
"""
|
||||
ecore_event_init()
|
||||
_ecore_input_events_register()
|
||||
|
||||
def shutdown():
|
||||
""" Shutdown the Ecore Input library.
|
||||
|
||||
.. note:: You never need to call this, it is automatically called at exit
|
||||
|
||||
"""
|
||||
ecore_event_shutdown()
|
||||
|
||||
|
||||
include "efl.ecore_input_events.pxi"
|
||||
|
||||
init()
|
||||
atexit.register(shutdown)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue