Revision: 4695
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4695&view=rev
Author:   jswhit
Date:     2007-12-10 12:32:26 -0800 (Mon, 10 Dec 2007)

Log Message:
-----------
updated from pydap svn

Modified Paths:
--------------
    trunk/toolkits/basemap/lib/dap/lib.py
    trunk/toolkits/basemap/lib/dap/parsers/das.py

Modified: trunk/toolkits/basemap/lib/dap/lib.py
===================================================================
--- trunk/toolkits/basemap/lib/dap/lib.py       2007-12-10 19:53:12 UTC (rev 
4694)
+++ trunk/toolkits/basemap/lib/dap/lib.py       2007-12-10 20:32:26 UTC (rev 
4695)
@@ -8,7 +8,7 @@
 from urllib import quote as _quote
 
 __author__ = 'Roberto De Almeida <[EMAIL PROTECTED]>'
-__version__ = (2,2,6,1)  # module version
+__version__ = (2,2,6,2)  # module version
 __dap__ = (2,0)        # protocol version
 
 # Constants that used to live in __init__.py but had to be moved

Modified: trunk/toolkits/basemap/lib/dap/parsers/das.py
===================================================================
--- trunk/toolkits/basemap/lib/dap/parsers/das.py       2007-12-10 19:53:12 UTC 
(rev 4694)
+++ trunk/toolkits/basemap/lib/dap/parsers/das.py       2007-12-10 20:32:26 UTC 
(rev 4695)
@@ -222,7 +222,7 @@
 
             if type_.lower() in ['string', 'url']:
                 value = expr_eval(repr(value))
-                value = value[1:-1]  # strip ""
+                value = value.strip('"')
             elif type_.lower() == 'alias':
                 # Support for Alias is not documented in the DAP spec. I based
                 # this on the Java documentation from the OPeNDAP website at:
@@ -241,24 +241,15 @@
                         break
                     else:
                         value = value.attributes
-            else:
-                dtype = {'float64': 'd',
-                         'float32': 'f',
-                         'int32'  : 'l',
-                         'int16'  : 'h',
-                         'uint32' : 'L',
-                         'uint16' : 'H',
-                         'byte'   : 'B',
-                        }[type_.lower()]
+            elif type_.lower() == 'float32':
                 # Convert to right precision; otherwise floats 
                 # are converted to Float64 automatically by 
                 # Python.
-                # B. Granger 5/17/07 - This line is giving a DeprecationWarning
-                # when dtype = 'l'.  It looks like it doesn't like getting a 
float
-                # when a long int is expected.  Because this is in a critical
-                # code path that I don't know well, and it seems to work OK 
for now
-                # I didn't change anything.  Should be looked into though.
-                value = array.array(dtype, [float(value)])[0]
+                value = array.array('f', [float(value)])[0]
+            elif type_.lower() == 'float64':
+                value = array.array('d', [float(value)])[0]
+            else:
+                value = int(value)
             values.append(value)
             
             if self._check(','): self._consume(',')


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to