Commit Graph

14 Commits

Author SHA1 Message Date
Philip Withnall
f300e883e7 codegen: Reformat parser.py according to black
This fixes the `style-check-diff` CI job.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-18 01:45:10 +00:00
Emmanuele Bassi
128ae2b5f5 codegen: Fix whitespace
This is Python, not C.
2022-02-15 11:48:28 +00:00
Emmanuele Bassi
5013d08315 codegen: Do not add extra paragraph elements while parsing
When parsing a comment we're adding <para> elements ourselves, but the
DocBook generator already wraps any block of text that does not start
with a <para> element with one.
2022-01-22 01:30:16 +00:00
Philip Withnall
d270b6c3db py: Various flake8 cleanups
None of these are particularly significant, but they do get the CI
output clean.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
905b22a17e py: Reformat all Python files consistently
This commit is the unmodified results of running
```
black $(git ls-files '*.py')
```
with black version 19.10b0. See #2046.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
e3f80b9254 gdbus-codegen: Emit GUnixFDLists if an arg has type h w/ min-version
This is a reimplementation of commit
4aba03562b from Will Thompson, but
conditional on the caller passing `--glib-min-version 2.64` to
`gdbus-codegen` to explicitly opt-in to the new behaviour.

From the commit message for that commit:

Previously, if a method was not annotated with org.gtk.GDBus.C.UnixFD
then the generated code would never contain GUnixFDList parameters, even
if the method has 'h' (file descriptor) parameters. However, in this
case, the generated code is essentially useless: the method cannot be
called or handled except in degenerate cases where the file descriptors
are missing or ignored.

Check the argument types for 'h', and if present, generate code as if
org.gtk.GDBus.C.UnixFD annotation were specified.

Includes a unit test too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1726
2019-12-11 10:40:07 +00:00
Iñigo Martínez
dcc1fe09d0 gdbus-codegen: Use Color's print_* methods
`glib-genmarshal` and `glib-mkenums` use a `Color` class which
implements a number of print_* methods to print colored messages
to the standard error output.

In order to be consistent with those programs' output,
`gdbus-codegen` has also started using that same class and methods.

https://bugzilla.gnome.org/show_bug.cgi?id=791015
2018-01-15 16:03:03 +01:00
Sébastien Wilmet
0fedc90fac gio/gdbus-2.0/codegen/: LGPLv2+ -> LGPLv2.1+
https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
Philip Withnall
097f70828f gdbus-codegen: Strip @since parameters before comparison
People might put more extraneous whitespace in a @since line in a
documentation comment, which should not affect the ordering of
methods/signals/etc. in the generated output.

https://bugzilla.gnome.org/show_bug.cgi?id=770372
2016-08-25 10:27:22 +01:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Jasper St. Pierre
0c87f71521 codegen: direction defaults to "in" 2013-12-31 15:39:02 -05:00
Simon Feltman
03611f7c06 Updated codegen to work with python3.
Most changes were just replacing usage of "has_key" with "in".
Also updated the sorting function which was simplified and
changed to a "key" function instead of "cmp" (which is no longer
supported in python3. Verified everything builds with
python 2.7 and 3.

https://bugzilla.gnome.org/show_bug.cgi?id=678066
2012-07-01 11:14:54 -04:00
Dieter Verfaillie
5dc3c2efc8 Use relative imports for the gdbus/codegen package
But not yet for the config module (but is taken care
of in a followup patch).

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:47 -04:00
Dieter Verfaillie
0eaec4e59a Avoid using - (hyphen) in gdbus-codegen directory name
It's an invalid character in Python module names and prevents us from
being able to import it.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:46 -04:00