summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples/option.py: Port to GI and Python 3Martin Pitt2013-05-241-19/+19
|
* [API add] Add Signal class for adding and connecting custom signals.Simon Feltman2012-09-031-10/+24
| | | | | | | | | | | | | | | | | The Signal class provides easy creation of signals and removes the need for __gsignals__ in client code. The Signal class can also be used as a decorator for wrapping up the custom closure. As well as providing a "BoundSignal" when accessed on an instance for making connections without specifying a signal name string. Python3 annotations can also be used to supply closure argument and return types when Signal is used as a decorator. For example: class Eggs(GObject.GObject): @GObject.Signal def spam(self, count:int): pass https://bugzilla.gnome.org/show_bug.cgi?id=434924
* Drop git.mkDaniel Narvaez2012-07-241-3/+0
| | | | | | | | | The autogenerated gitignores was missing several files. So we was using a manual .gitignore at the root. But since it's enough to add a couple of entries to it to cover the whole tree, there is no much point in using git.mk at all. https://bugzilla.gnome.org/show_bug.cgi?id=678192
* PEP8: Fix indentationMartin Pitt2012-06-222-17/+15
| | | | Spotted by current pep8 checker.
* PEP8: Remaining whitespace fixesJohan Dahlin2012-03-221-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672627
* PEP8: Fix whitespace around operatorsJohan Dahlin2012-03-221-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672627
* PEP8: run via --fix from craigds forkJohan Dahlin2012-03-224-25/+38
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672627
* PEP8: Remove spaces around = for keyword argumentsJohan Dahlin2012-03-221-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672627
* Correct pyflakes warnings/errorsJohan Dahlin2012-03-211-1/+1
| | | | | | And add a target to make check that runs pyflakes. https://bugzilla.gnome.org/show_bug.cgi?id=672578
* Renamed "property" class to "Property"Simon Feltman2012-03-161-3/+3
| | | | | | | | | | | | Renamed to match the rest of the class names in GObject and also not clobber the builtin python property. Keep the old "property" identifier for backwards compatibility for now. https://bugzilla.gnome.org/show_bug.cgi?id=672168 Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
* Drop legacy __gobject_init__ method of GObject.Object.Steve Frécinaux2011-09-131-2/+0
| | | | | | | | This method was used in gobject initialization at some point, but now using GObject.__init__() is sufficient, so let's not keep this old method around and let people misuse it. https://bugzilla.gnome.org/show_bug.cgi?id=658032
* Examples: fix cairo-demo.py importsDieter Verfaillie2011-09-091-3/+3
|
* Updated signal example to use GObject introspectionTimo Vanwynsberghe2011-08-181-5/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=654162
* Updated properties example to use GObject introspectionTimo Vanwynsberghe2011-08-181-7/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=654162
* Fixed the cairo exampleTimo Vanwynsberghe2011-07-071-4/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=653844
* Remove last GIO-related bitsSimon van der Linden2011-02-112-110/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=638899
* Remove .gitignore files and use git.mkIgnacio Casal Quinteiro2011-01-271-0/+2
| | | | | git.mk is a script maintained in pango. From time to time we must check if it was updated and update it here.
* Make an example and a demo work out of the boxPaul Bolle2010-07-301-0/+2
| | | | | | | | | cairo-demo.py and gtk-demo.py need the two (kind of) magic lines regarding pygtk to work out of the box. So add those. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> https://bugzilla.gnome.org/show_bug.cgi?id=625638
* PyGI: properly quit cairo-demoPaul Bolle2010-07-301-1/+1
| | | | | | Signed-off-by: Paul Bolle <pebolle@tiscali.nl> https://bugzilla.gnome.org/show_bug.cgi?id=625619
* Merge back pygiJohan Dahlin2010-06-202-1/+122
| | | | | For reasons outlined at: http://mail.gnome.org/archives/python-hackers-list/2010-June/msg00009.html
* WhitespaceJohan Dahlin2008-07-291-0/+1
| | | | svn path=/trunk/; revision=900
* Take some creditJohan Dahlin2008-07-292-0/+3
| | | | svn path=/trunk/; revision=899
* Add gio.FILE_ATTRIBUTE_* constants and update the examples to use them.Johan Dahlin2008-07-291-2/+2
| | | | | | | | | | | 2008-07-29 Johan Dahlin <johan@gnome.org> * examples/gio/downloader.py: * gio/giomodule.c (init_gio): Add gio.FILE_ATTRIBUTE_* constants and update the examples to use them. svn path=/trunk/; revision=897
* Fetch the total and print percentageJohan Dahlin2008-07-291-3/+8
| | | | svn path=/trunk/; revision=896
* Remove unused importJohan Dahlin2008-07-291-1/+1
| | | | svn path=/trunk/; revision=895
* Refactor the example a bit, use start/stop to access loop so it's easier to ↵Johan Dahlin2008-07-291-12/+19
| | | | | | reuse it in a real application svn path=/trunk/; revision=894
* Handle errors from gfile.read() gracefullyJohan Dahlin2008-07-291-3/+6
| | | | svn path=/trunk/; revision=893
* Add a new exampleJohan Dahlin2008-07-281-0/+61
| | | | | | | | | | | | | | | 2008-07-29 Johan Dahlin <johan@gnome.org> * examples/gio/downloader.py: Add a new example * gio/ginputstream.override: Use a string internally instead of a PyStringObject when in read_async. Create a new python string in finish and honor the number of bytes read. svn path=/trunk/; revision=892
* Add a new API for registering exceptions for a GError domain. Register aJohan Dahlin2008-07-261-3/+3
| | | | | | | | | | | | | | | | | | 2008-07-26 Johan Dahlin <johan@gnome.org> * examples/gio/directory-async.py: * gio/Makefile.am: * gio/giomodule.c (init_gio): * glib/pyglib.c (pyglib_error_check), (pyglib_register_exception_for_domain): * glib/pyglib.h: * tests/test_gio.py: Add a new API for registering exceptions for a GError domain. Register a new exception for G_IO_ERROR, update tests and examples to use the new exception. svn path=/trunk/; revision=863
* Increase to 100 per goJohan Dahlin2008-07-181-1/+2
| | | | svn path=/trunk/; revision=834
* improve example: show error message and allow sys.argv[1] to be specifiedJohan Dahlin2008-07-181-3/+13
| | | | svn path=/trunk/; revision=833
* Wrap gio.FileEnumerator.next_files_async/next_files_done. Update theJohan Dahlin2008-07-181-3/+9
| | | | | | | | | | | | | | | 2008-07-19 Johan Dahlin <johan@gnome.org> * examples/gio/directory-async.py: * gio/gfileenumerator.override: * gio/gio.defs: * tests/test_gio.py: Wrap gio.FileEnumerator.next_files_async/next_files_done. Update the example to use them instead of the synchronous versions, add documentation and tests. svn path=/trunk/; revision=832
* Only fetch name, saves a couple of syscalls. Set name to gio._gio soJohan Dahlin2008-07-181-1/+1
| | | | | | | | | | | | 2008-07-19 Johan Dahlin <johan@gnome.org> * examples/gio/directory-async.py: Only fetch name, saves a couple of syscalls. * gio/gio.override: Set name to gio._gio so pychecker/pydoc works. svn path=/trunk/; revision=831
* Remove unused importJohan Dahlin2008-07-181-1/+0
| | | | svn path=/trunk/; revision=829
* Wrap gio.File.enumerate_children_async, add tests, docstring and anJohan Dahlin2008-07-181-0/+14
| | | | | | | | | | | | | | * examples/gio/directory-async.py: * gio/gfile.override: * gio/gfileenumerator.override: * gio/gio.defs: * tests/test_gio.py: Wrap gio.File.enumerate_children_async, add tests, docstring and an example. Also document gio.File.enumerate while we're at it. svn path=/trunk/; revision=828
* remove trailing whitespaceJohan Dahlin2007-11-061-7/+7
| | | | svn path=/trunk/; revision=716
* Add a property helper, fixes #338098Johan Dahlin2007-05-011-31/+19
| | | | | | | | | | | | | | | | | * examples/properties.py: * gobject/Makefile.am: * gobject/__init__.py: * gobject/constants.py.in: * gobject/generate-constants.c: (main): * gobject/propertyhelper.py: * tests/Makefile.am: * tests/test_enum.py: * tests/test_interface.py: * tests/test_properties.py: Add a property helper, fixes #338098 svn path=/trunk/; revision=662
* Remove .cvsignore archivesJohan Dahlin2007-01-161-2/+0
| | | | svn path=/trunk/; revision=636
* reviewed by: Johan Dahlin <jdahlin@async.com.br>Johannes Hölzl2006-04-292-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-04-29 Johannes Hölzl <johannes.hoelzl@gmx.de> reviewed by: Johan Dahlin <jdahlin@async.com.br> * examples/Makefile.am: * examples/option.py: * gobject/Makefile.am: * gobject/gobjectmodule.c: (init_gobject): * gobject/option.py: * gobject/pygobject-private.h: * gobject/pygoptioncontext.c: (pyg_option_context_init), (pyg_option_context_dealloc), (pyg_option_context_parse), (pyg_option_context_set_help_enabled), (pyg_option_context_get_help_enabled), (pyg_option_context_set_ignore_unknown_options), (pyg_option_context_get_ignore_unknown_options), (pyg_option_context_set_main_group), (pyg_option_context_get_main_group), (pyg_option_context_add_group), (pyg_option_context_compare), (pyg_option_context_new): * gobject/pygoptiongroup.c: (check_if_owned), (destroy_g_group), (pyg_option_group_init), (pyg_option_group_dealloc), (arg_func), (pyg_option_group_add_entries), (pyg_option_group_set_translation_domain), (pyg_option_group_compare), (pyg_option_group_transfer_group), (pyg_option_group_new): * tests/test_option.py: Add support for GOption, fixes #163645
* reindentJohan Dahlin2006-04-111-4/+4
|
* Split out PyGObject from PyGTK.Johan Dahlin2006-01-092-0/+3
|
* Bug 128765: GObject metaclassGustavo J. A. M. Carneiro2005-05-221-3/+1
|
* add new example to dist.James Henstridge2001-12-181-0/+43
| | | | | | | | | | | | | | | | | | | 2001-12-18 James Henstridge <james@daa.com.au> * Makefile.am (EXTRA_DIST): add new example to dist. * examples/gobject/properties.py: test program that implements a few properties. * gobjectmodule.c (add_properties): new function for parsing the __gproperties__ class attribute. (create_property): helper routine for creating and installing the new pspecs. (pyg_type_register): add code to call add_properties if a __gproperties__ attribute is found. (pyg_object_class_init): set set_property/get_property methods in vtable, and get rid of debug message. (initgobject): add G_PARAM_* constants.
* use __gsignals__ notation here.James Henstridge2001-12-141-3/+4
| | | | | | | | | | | 2001-12-14 James Henstridge <james@daa.com.au> * examples/gobject/signal.py: use __gsignals__ notation here. * gobjectmodule.c (create_signal, add_signals): helper routines for handling __gsignals__ attribute of classes. (pyg_type_register): add support for creating signals as part of type registration.
* 2001-05-06 James Henstridge <james@daa.com.au>James Henstridge2001-05-061-3/+5
| | | | | | | | | | | | | | | | | | | | 2001-05-07 James Henstridge <james@daa.com.au> * examples/gobject/signal.py: 2001-05-06 James Henstridge <james@daa.com.au> * gobjectmodule.c (pygobject__init__): make the __init__ function choose what GType to pass to g_object_new based on the __gtype__ attribute. (pygobject_methods): make __gobject_init__ an alias for GObject.__init__. (pyg_type_register): new function for registering new GTypes. (pyg_type_register): register the type as "module+class" rather than "module.class", as the second form is considered bad (would like to use the second form though. * configure.in: require 1.3.5 versions of glib and gtk+.
* moved rewritten testgtk demo hereJames Henstridge2001-03-301-1/+8
| | | | | | | | | | | | | | | | | | | | 2001-03-30 James Henstridge <james@daa.com.au> * examples/pygtk-demo: moved rewritten testgtk demo here * gobjectmodule.c (pygobject_set_property): initialise the GValue to { 0, }, so set_property actually works. (pygobject_get_property): same here. * gtk/gtk.defs: updated enum/flag defs. * gtk/gdk.defs: updated enum/flag defs. * examples/gobject/signal.py (D.do_my_signal): add small example of overriding class closure for a signal introduced from python code. * codegen/h2def.py: add --onlyenums flag to only output enum defs.
* simple example program that adds a signal to a class, connects a handlerJames Henstridge2001-03-271-0/+20
2001-03-27 James Henstridge <james@daa.com.au> * examples/gobject/signal.py: simple example program that adds a signal to a class, connects a handler to an instance of that class, and finally emits that signal. Messages are printed by both the signal handler and class method closure. * gobjectmodule.c (pyg_signal_class_closure_marshal): convert dashes in signal name to underscores. Why does g_siganl_name use dashes? (pyg_signal_class_closure_marshal): fix off by one error when setting up the python argument tuple. The first element was getting left uninitialised. Signals introduced in python now work. * gtk/gtk.defs (GtkFileSelection.get_filename): return value is const. * gtk/gtk.override (_wrap_gtk_list_store_set_value): change name. (_wrap_gtk_tree_store_insert): change name. * gtk/gtk.defs (GtkListStore.set_value): change from set_cell to set_value. (GtkListStore.set_value): same here.