<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">shapelib still didn't work for me.. help</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I've being trying different things for the pass day</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">1. I put the shapefile directly in the Extensions with the external method and it work fine</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import shapelib, dbflib</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def readshp():<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shp = shapelib.ShapeFile(<FONT color=#ff0000>'taiwan1.shp'</FONT>)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return shp.info()</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and in zope</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dtml-var expr="readshp()&gt;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">2. but when I save the shapefiles (taiwan1.shp, taiwan1.shx, taiwan1.dbf)&nbsp;into zope and call it using dtml it return the same error message. </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import shapelib, dbflib</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def readshp(<FONT color=#ff0000>filename</FONT>):<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shp = shapelib.ShapeFile(<FONT color=#ff0000>filename</FONT>)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return shp.info()</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; and in zope</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dtml-var expr="readshp(<FONT color=#ff0000>taiwan1.shp</FONT>)"&gt;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; or</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dtml-var expr="readshp(<FONT color=#ff0000>'http://localhost/pytest/taiwan1.shp'</FONT>)"&gt;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">The error message are</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>1. in "Run Zope in Console"</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Exception exceptions.AttributeError:"ShapeFile instance has no attribute 'thisown'" in&nbsp;&nbsp; &nbsp;&nbsp;ignored</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. in web browser</DIV>
<DIV>
<P>&nbsp;&nbsp;&nbsp; Site Error</P>
<P>&nbsp;&nbsp;&nbsp; An error was encountered while publishing this resource. </P>
<P><STRONG>&nbsp;&nbsp;&nbsp; Error Type: IOError</STRONG><BR><STRONG>&nbsp;&nbsp;&nbsp; Error Value: new_ShapeFile failed</STRONG><BR></P></DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">is there something wrong with&nbsp;how I constructed it?&nbsp;Do I need to do something before hand?</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">3. in error_log</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><PRE>Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module OFS.DTMLMethod, line 143, in __call__
   - &lt;DTMLMethod at /testPython/test&gt;
   - URL: http://localhost/testPython/test/manage_main
   - Physical Path: /testPython/test
  Module DocumentTemplate.DT_String, line 476, in __call__
  Module DocumentTemplate.DT_Util, line 196, in eval
   - __traceback_info__: readshp
  Module &lt;string&gt;, line 1, in &lt;expression&gt;
  Module Products.ExternalMethod.ExternalMethod, line 231, in __call__
   - __traceback_info__: (('http://localhost/testPython/taiwan1.shp',), {}, None)
  Module C:\web\ZopeInstance\Extensions\shapetools.py, line 4, in readshp
  Module shapelib, line 44, in __init__
IOError: new_ShapeFile failed
</PRE></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Forwarded Message ----<BR>From: Dieter Maurer &lt;dieter@handshake.de&gt;<BR>To: Allen Huang &lt;swapp0@yahoo.com&gt;<BR>Cc: Zope &lt;zope@zope.org&gt;<BR>Sent: Saturday, December 23, 2006 3:52:53 AM<BR>Subject: Re: [Zope] problem with the shapelib module.. help<BR><BR>
<DIV>Allen Huang wrote at 2006-12-21 23:23 -0800:<BR>&gt;I want to do some mapping application with zope.. but I have run into this problem over and over..<BR>&gt;<BR>&gt;in "Run Zope in Console"<BR>&gt;Exception exceptions.AttributeError:"ShapeFile instance has no attribute 'thisown'" in&nbsp;&nbsp;&nbsp;&nbsp; ignored<BR><BR>Hmm. I doubt that you have really seen this text. There should be something<BR>in between the "in" and the "ignored". It is *vital* that you<BR>are as precise as possible in your problem reports...<BR><BR><BR>Python emits messages of the kind above in some (rare) situations,<BR>e.g. when exceptions occur in destructors.<BR><BR><BR>The exception above seems to have been raised in such a situation.<BR>The missing thing betwenn "in" and "ignored" should tell us which situation<BR>this was.<BR><BR>It tells you that something tries to access the attribute "thisown"<BR>on a "ShapeFile" instance but this does not have the attribute.<BR><BR>&gt;<BR>&gt;in web
 browser<BR>&gt;Site Error<BR>&gt;An error was encountered while publishing this resource. <BR>&gt;Error Type: IOError<BR>&gt;Error Value: new_ShapeFile failed<BR><BR><BR>Another tip for the future. When you report problems, you need<BR>to include full error information. Beside the "Error Type" and<BR>"Error Value" above, this also includes the traceback.<BR>You find all this information in the "error_log" object in<BR>Zope's "Root Folder" (Management Interface).<BR><BR><BR><BR>-- <BR>Dieter</DIV></DIV><BR></DIV></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </body></html>