GNOME Bugzilla – Bug 744534
Support CamelCase symbols
Last modified: 2015-04-20 20:48:56 UTC
In CoreFoundation, etc, we don't use lowercase underscore-separated names, but use names like CFStringCreateByCombiningStrings(). Because of it, g-i cannot associate methods for those types back to the type. Any way you can add --symbol-filter-cmd in the same spirit as --identifier-filter-cmd?
Created attachment 296843 [details] [review] scanner: Add --symbol-filter-cmd Add the command line flag --symbol-filter-cmd to g-ir-scanner which allows running symbol names through a filtering shell command. The symbol is sent as stdin to the filter command and expects a filtered result written to stdout.
This is blocking GObject-Introspection's use by third-parties.
Review of attachment 296843 [details] [review]: Since identifier-filter-command was already added, this does seem logical. I didn't review the earlier patch, but I would have preferred to avoid `shell=True`. Oh well. Otherwise looks quite straightforward. Just one minor comment. ::: tests/scanner/symbolfilter.py @@ +35,3 @@ + +if __name__ == '__main__': + text = ensure_snake_case(sys.stdin.read()) This isn't very efficient, is there a reason not to do this line by line?
(In reply to Colin Walters from comment #3) > Review of attachment 296843 [details] [review] [review]: > > Since identifier-filter-command was already added, this does seem logical. > I didn't review the earlier patch, but I would have preferred to avoid > `shell=True`. Oh well. > > Otherwise looks quite straightforward. Just one minor comment. > > ::: tests/scanner/symbolfilter.py > @@ +35,3 @@ > + > +if __name__ == '__main__': > + text = ensure_snake_case(sys.stdin.read()) > > This isn't very efficient, is there a reason not to do this line by line? This is copied from identfilter.py: https://git.gnome.org/browse/gobject-introspection/tree/tests/scanner/identfilter.py#n48
Ping?
Attachment 296843 [details] pushed as 7e5a553 - scanner: Add --symbol-filter-cmd
Sorry for the delay, pushed, thanks for the patch! (BTW, what CoreFoundation project are you using this for?)