After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 140035 - Unable to find the GNOME_FILE_DOMAIN_APP_HELP domain error
Unable to find the GNOME_FILE_DOMAIN_APP_HELP domain error
Status: RESOLVED FIXED
Product: gnome-python
Classification: Deprecated
Component: gnome
CVS HEAD
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 140059
Blocks:
 
 
Reported: 2004-04-14 13:03 UTC by Patanjali
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix for bug #140035 (1.95 KB, patch)
2004-04-14 13:05 UTC, Patanjali
none Details | Review

Description Patanjali 2004-04-14 13:03:47 UTC
if gnome.help_display () is used in a program, the following output is observed - 
gobject.GError: Unable to find the GNOME_FILE_DOMAIN_APP_HELP domain 

Fix: 
This is occuring because gnome_program_init () is not called with
GNOME_PROGRAM_STANDARD_PROPERTIES_MACRO, and the following defines   
    -DDATADIR=\""$(datadir)"\" \
    -DLIBDIR=\""$(libdir)"\"   \
    -DSYSCONFDIR=\""$(sysconfdir)"\" \
    -DPREFIX=\""$(prefix)"\"
Comment 1 Patanjali 2004-04-14 13:05:28 UTC
Created attachment 26653 [details] [review]
fix for bug #140035

ok to commit ?
Comment 2 Johan (not receiving bugmail) Dahlin 2004-04-14 14:15:51 UTC
I'm not sure it's a good idea to hardcode the datadir and friends to the
directories used by pygtk. Say that you'd like to have your program installed in
a different prefix from pygtk? Or if the end user wants to change it.
Comment 3 Patanjali 2004-04-14 14:33:51 UTC
well, its not hardcoded, they are picked up from the $(datadir) etc. Also -
these are where Gnome expects files to be found so shouldn't that be part of the
gnome install ?
Comment 4 Patanjali 2004-04-14 14:47:42 UTC
The bug observed in pygtk that i also encountered:
http://www.mail-archive.com/pygtk@daa.com.au/msg05827.html

The bug i got the fix from: 
http://mail.gnome.org/archives/desktop-devel-list/2003-January/msg00265.html

and the response i got from mark mcloughlin:

Hi,	
Those defines are used by GNOME_PROGRAM_STANDARD_PROPERTIES macro which you can
use with gnome_program_init. So, if the Mono/Python bindings call
gnome_program_init they shoulddefine those pre-processor defines and use the
macro withgnome_program_init().

Comment 5 Gustavo Carneiro 2004-04-14 15:24:42 UTC
There are many gnome_program_init() properties to specify datadir, libdir, etc.
 The real problem is that gnome.init() does not handle properties yet.
Comment 6 Gustavo Carneiro 2004-04-20 22:35:30 UTC
OK, so we're not going to have generic property support in gnome.init any time
soon, due to problems in the C API.
In the mean time, we should support at least a specific list of properties.  I'm
thinking about adding support for an additional optional argument containing a
dictionary of properties.  Example:
gnome.init("foo", "bar", sys.argv, properties={ 'prefix': '/opt', 'gnome-path':
'/opt:/usr' })

  Unfortunately, each of those properties have to be supported specifically in
the code, and we need to come up with sane defaults for all of them.  For that
reason, we should not support properties that can be specified from the command
line, such as "enable-sound" vs --enable-sound, otherwise we risk that our
default will override the command-line option.

  I'll get to work on this next saturday, if no one beast me to it.
Comment 7 James Henstridge 2004-04-21 04:24:40 UTC
If all we care about are string arguments, I had an idea about how this could be
done.

gnome_program_init() is a vararg function, and stops processing its arguments
when it hits a NULL argument that should represent a property name.  There is
nothing to stop us passing it more arguments.  Here is some pseudo code that
might help:

char *propnames[] = { "prefix", "gnome-path", ...}
char* propargs[20] = { NULL, }; /* length >= len(propnames)*2 + 1 */
int index = 0;

for (i = 0; i < G_N_ELEMENTS(propnames); i++) {
  if (PyDict_HasAttrString(kwargs, propnames[i])) {
    propargs[index++] = propnames[i];
    propargs[index++] = PyString_AsString(PyDict_GetAttrString(kwargs,
                                                               propnames[i]));
  }
}
...
gnome_program_init(..., propargs[0], propargs[1], ..., propargs[19]);

This gives a level of type safety, since it would only support certain known
property names, and should hopefully be enough.

I still hate GnomeProgram though ...
Comment 8 Gustavo Carneiro 2004-04-21 21:13:59 UTC
Funny that I was talking to kiko today (in real life!) and he suggested the
exact same thing.
To decided whether or not supporting only string properties, here is the full
list that GnomeProgram currently supports:

popt-table: pointer (construct)
popt-flags: int (construct)
popt-context: pointer (read)
human-readable-name: string (construct, read)
gnome-path: string (construct, read)
app-id: string (read)
app-version: string (read)
gnome-prefix: string (construct, read)
gnome-libdir: string (construct, read)
gnome-datadir: string (construct, read)
gnome-sysconfdir: string (construct, read)
app-prefix: string (write, read)
app-libdir: string (write, read)
app-datadir: string (write, read)
app-sysconfdir: string (write, read)
create-directories: boolean (construct, read)
enable-sound: boolean (construct, read)
espeaker: string (construct, read)

The popt-arguments alread have custom support.  That leaves us with string and
boolean arguments.  But I have some doubts on the usefulness of the boolean
arguments, so I'm planning on following James' (and kiko's) strategy and support
only the string properties.  Support for boolean properties can be added at a
later stage if anyone cares.

BTW, according to Havoc's plan, libgnome* should become deprecated in gnome 2.8
and disappear in gnome 2.10.
Comment 9 James Henstridge 2004-04-22 03:39:15 UTC
The boolean and int arguments would be difficult.  gboolean is a synonym for
"int", which is not necessarily the same size as a pointer (it won't be on any
LP64 platforms such as IA64 or x86-64, for instance).

Passing a popt table should be doable though since a (char *) pointer is going
to be the same size as any other pointer, so it could be handled like this
pretty easily.

I don't think libgnome will be going away any time soon, unfortunately. 
Remember that libbonoboui depends on it.  I think the plan was to make
libgnomeui obsolete though.
Comment 10 Gustavo Carneiro 2004-06-20 16:24:43 UTC
Fixed in HEAD, using James' (and Kiko's) suggestion.