On Wed, Dec 26, 2012 at 7:29 PM, Nick Hall <nick__hall@hotmail.com> wrote:
On 26/12/12 07:05, John Ralls wrote:
> Right. The current code setting PREFIXDIR assumes that LOCALEDIR is `pwd`/../.., and is left over from the ancien regime where $GRAMPSHOME was $PREFIX/share/gramps.
> ISTM sys.prefix is a lot more reliable, and will give the right answer almost always -- and users can use $GRAMPSI18N for the cases when it's wrong.
> Does that make sense to you?

As it happens sys.prefix is the default location for both the code and
data directories with distutils.  If the user chooses a different
location for the code and data directories, then sys.prefix will most
likely point to the code directory rather than the data directory (where
the locale files are installed).  Perhaps we can assume that any user
doing so will understand the consequences and be able to set GRAMPSI18N.

If distutils is used for installation then setting PREFIXDIR correctly
will obviously be correct 100% of the time.

Problems are more likely to occur for packagers though.  If Gramps is
stored in a temporary location for packaging, then PREFIXDIR may well be
set incorrectly.  I think that this is what Benny was trying to fix by
specifying the PREFIXDIR relative __file__.

It would be convenient not to generate const.py in the build, and we are
close to this.  SYSCONFDIR is not used, and if we decide to handle
PREFIXDIR differently, then we only set the version variables from
within the setup script.

Didn't Doug write a utility function to return the version string?

I didn't write it, but I did add a version from Django that deals with SVN numbering:


Benny suggested that it be moved or copied to someplace that didn't bring in much of anything else like it would in utils. I think moving it to gramps/gen/ would make it easily available.




Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
Gramps-devel mailing list