Re: Bug in 1.3.0b pyniopath_ncarg()

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 9 Dec 2008 10:16:59 +0100

Hi David,

Thanks for taking the time to report this.

I know we made some changes to this function, but I can't remember if
this was before or after the release of 1.3.0b1.

I'll double-check that we don't have a similar problem at the PyNGL
level.

--Mary

On Dec 6, 2008, at 7:46 AM, David Brodrick wrote:

> Sincere apologies if this comes through more than once, I had some
> delays subscribing to the list, so I am not sure if my earlier
> posts were accepted:
>
> I am upgrading from PyNGL 1.2 to PyNGL/NIO 1.3.0b. I encountered
> problems when trying to open a GRIB2 file.
>
> The new machinery for finding the codetables seems to do the wrong
> thing on my machine. PyNIO is installed under /usr/lib/python2.4/
> site-packages/ but pyniopath_ncarg() is incorrectly selecting the
> empty directory /usr/local/lib/python2.4/site-packages/ instead,
> because it preceeds /usr/lib/ is sys.path.
>
> I believe the following implementation of pyniopath_ncarg() fixes
> this problem and also fixes the error where os.path.exists is
> called with a None argument if NCARG_ROOT is not defined:
>
> #####
> def pyniopath_ncarg():
> import sys
> pynio_ncarg = None
> for path in sys.path:
> trypath = os.path.join(path,"PyNIO","ncarg")
> if os.path.exists(trypath):
> pynio_ncarg = trypath
> break
>
> if pynio_ncarg==None:
> ncarg_dir = os.environ.get("NCARG_ROOT")
> if ncarg_dir==None or not os.path.exists(ncarg_dir) \
> or not os.path.exists(os.path.join(ncarg_dir,"lib","ncarg")):
> print "No usable NCARG installation found"
> sys.exit()
> else:
> pynio_ncarg = os.path.join(ncarg_dir,"lib","ncarg")
>
> return pynio_ncarg
> #####
>
> I still haven't got everything working yet but I thought I'd report
> this issue for your consideration.
>
> The libraries are awesome, thanks so much for all your great work!
> Cheers,
> David
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Dec 09 2008 - 02:16:59 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 01 2009 - 08:39:20 MST