Re: [Zope-dev] Re: Deprecating Zope 2 interfaces?

2006-02-22 Thread Chris Withers

yuppie wrote:

Philipp von Weitershausen wrote:

I don't think it will make much sense to keep Zope 2 interfaces around
for more than one year from now. In other words, I'm suggesting to
deprecate them for Zope 2.10.


+10


Me too ;-)

1.) WriteLock: Objects are only lockable if their class has 
WriteLockInterface in its __implements__ list.


2.) PluggableIndex: Indexes for ZCatalog have to be registered in 
Products.meta_types with PluggableIndexInterface.


3.) IFAwareObjectManager and the 'interfaces' argument of 
ObjectManager.all_meta_types: The mechanism used for pluggable indexes 
has a generic implementation in ObjectManager and can be used by any 
subclass of IFAwareObjectManager.


I think these can safely swapped... ie: no non-zope-core code actually 
does anything with these interfaces...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ImageFile weirdness?

2006-02-22 Thread Jürgen Herrmann
hi all!

i have a class ImageContainer in a python product, that has an ImageFile
attached, it's named 1.gif:
   ...
   image = ImageFile('1.gif', '/some/where')
   setattr(self.__class__, '1.gif', image)
   ...
i have an ImageContainer instance in my zope root.

if i point my browser to http://localhost/ImageContainer/1.gif ,
i can see the image in the browser, everything seems fine, image is
displayed.

if however the image is named 1 only, e.g.
   ...
   image = ImageFile('1', '/some/where')
   setattr(self.__class__, '1', image)
   ...
i notice a difference when viewing http://localhost/ImageContainer/1 .
the browser pops up a download window, showing the content type is
application/octet-stream. using firefox' livehttpheaders extension i found
out that the content-type header is missing. if i view
http://localhost/ImageContainer/1/ everything is fine however.

now i peeked into App.ImageFile, where i can find a index_html() method,
where the content-type header is set.
viewing http://localhost/ImageContainer/1 never calls the index_html
method though, http://localhost/ImageContainer/1/ obviously does.
that's where i'm stuck now, who handles the ImageFile's invokation, if
called like http://localhost/ImageContainer/1 ? ImageFile inherits from
Acquisition.Explicit, nothing else...

thanks for your attention,
regards, juergen herrmann
___

 XLhost.de - eXperts in Linux hosting 

Jürgen Herrmann
Bruderwöhrdstraße 15b, DE-93051 Regensburg

Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027
WEB:  http://www.XLhost.de
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ImageFile weirdness?

2006-02-22 Thread Jürgen Herrmann
hi all!

i have a class ImageContainer in a python product, that has an ImageFile
attached, it's named 1.gif:
   ...
   image = ImageFile('1.gif', '/some/where')
   setattr(self.__class__, '1.gif', image)
   ...
i have an ImageContainer instance in my zope root.

if i point my browser to http://localhost/ImageContainer/1.gif ,
i can see the image in the browser, everything seems fine, image is
displayed.

if however the image is named 1 only, e.g.
   ...
   image = ImageFile('1', '/some/where')
   setattr(self.__class__, '1', image)
   ...
i notice a difference when viewing http://localhost/ImageContainer/1 . the
browser pops up a download window, showing the content type is
application/octet-stream. using firefox' livehttpheaders extension i found
out that the content-type header is missing. if i view
http://localhost/ImageContainer/1/ everything is fine however.

now i peeked into App.ImageFile, where i can find a index_html() method,
where the content-type header is set.
viewing http://localhost/ImageContainer/1 never calls the index_html
method though, http://localhost/ImageContainer/1/ obviously does.
that's where i'm stuck now, who handles the ImageFile's invokation, if
called like http://localhost/ImageContainer/1 ? ImageFile inherits from
Acquisition.Explicit, nothing else...

thanks for your attention,
regards, juergen herrmann
___

 XLhost.de - eXperts in Linux hosting 

Jürgen Herrmann
Bruderwöhrdstraße 15b, DE-93051 Regensburg

Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027
WEB:  http://www.XLhost.de

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ImageFile weirdness?

2006-02-22 Thread Jürgen Herrmann
hi all!

i have a class ImageContainer in a python product, that has an ImageFile
attached, it's named 1.gif:
   ...
   image = ImageFile('1.gif', '/some/where')
   setattr(self.__class__, '1.gif', image)
   ...
i have an ImageContainer instance in my zope root.

if i point my browser to http://localhost/ImageContainer/1.gif ,
i can see the image in the browser, everything seems fine, image is
displayed.

if however the image is named 1 only, e.g.
   ...
   image = ImageFile('1', '/some/where')
   setattr(self.__class__, '1', image)
   ...
i notice a difference when viewing http://localhost/ImageContainer/1 . the
browser pops up a download window, showing the content type is
application/octet-stream. using firefox' livehttpheaders extension i found
out that the content-type header is missing. if i view
http://localhost/ImageContainer/1/ everything is fine however.

now i peeked into App.ImageFile, where i can find a index_html() method,
where the content-type header is set.
viewing http://localhost/ImageContainer/1 never calls the index_html
method though, http://localhost/ImageContainer/1/ obviously does.
that's where i'm stuck now, who handles the ImageFile's invokation, if
called like http://localhost/ImageContainer/1 ? ImageFile inherits from
Acquisition.Explicit, nothing else...

thanks for your attention,
regards, juergen herrmann
___

 XLhost.de - eXperts in Linux hosting 

Jürgen Herrmann
Bruderwöhrdstraße 15b, DE-93051 Regensburg

Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027
WEB:  http://www.XLhost.de
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Deprecating Zope 2 interfaces?

2006-02-22 Thread Philipp von Weitershausen
Chris Withers wrote:
 yuppie wrote:
 
 Philipp von Weitershausen wrote:

 I don't think it will make much sense to keep Zope 2 interfaces around
 for more than one year from now. In other words, I'm suggesting to
 deprecate them for Zope 2.10.


 +10
 
 
 Me too ;-)

Great. There don't seem to be any objections, they would have been
communicated by now otherwise. I take the silence so far as assent or
indifference. All in all it means I think we can go a head and really do
deprecate Zope 2 interfaces.

 1.) WriteLock: Objects are only lockable if their class has
 WriteLockInterface in its __implements__ list.

 2.) PluggableIndex: Indexes for ZCatalog have to be registered in
 Products.meta_types with PluggableIndexInterface.

 3.) IFAwareObjectManager and the 'interfaces' argument of
 ObjectManager.all_meta_types: The mechanism used for pluggable indexes
 has a generic implementation in ObjectManager and can be used by any
 subclass of IFAwareObjectManager.
 
 I think these can safely swapped... ie: no non-zope-core code actually
 does anything with these interfaces...

That's a bold assumption. I'm not willing to take the risk, especially
if the BBB-aware code is pretty straight-forward.

Philipp
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] CMFExternalFile and huge ZODB pickles

2006-02-22 Thread Pawel Lewicki

Hi,
I have a problem with one Zope application and have no clue what's going 
on. The problem is with one ControlledPage that creates 
CMFExternalFiles. It seems that each file is somehow included in ZODB 
pickle so Data.fs grows very fast. Only packing helps. The side effect 
is that transaction takes quite a long time so conflicts are very common.
I tried to recreate the environment on the other machine and everything 
was fine despite the fact that I used all the same products. The only 
difference was that original app was running on Linux and I did it on 
Windows.

Any clues?
Products used:
- ExternalFile 1.2.0
- CMFExternalFile 0.5
- Plone 2.0.5
- Zope 2.7.6

BTW, how do you distinct read and write conflicts in event.log? I only have
INFO(0) ZODB conflict error at...

Pawel

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] change ATImage metadata

2006-02-22 Thread MIlos Prudek
Hi,

how can I programatically change the Language attribute in Standard Resource 
Metadata of ATImage?

I tried:

for item in context.objectValues('ATImage'):
  print item.Language()

This works perfectly. How do I assign value to Language?

-- 
Milos Prudek
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] optional arguments to zsql methods

2006-02-22 Thread garry

I am importing a large data set via Zope into a Postgres database. Data
items may or may not exist so I am using the optional argument in the
zsql methods. What I want is that if the data is missing the database
inserts default values.
However,

if type=string, the absent data item is rendered as ''

if type=nb, the absent data item is rendered as 'Null'

In either case this does not allow default values to be inserted. I can
insert the defaults by doing this:
.ZSQL.
snip.
dtml-if surnamefirst
 dtml-sqlvar  surnamefirst   type=string ,
dtml-else
DEFAULT,
/dtml-if

With 20 or so inserts in one query this gets messy and could be slow? if
this method has to be called many times on one import cycle.
My question is therefore is there a cleaner way of doing this or am I on
the right track?
Regards
Garry

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: CMFExternalFile and huge ZODB pickles

2006-02-22 Thread Florent Guillaume

Pawel Lewicki wrote:

Hi,
I have a problem with one Zope application and have no clue what's going 
on. The problem is with one ControlledPage that creates 
CMFExternalFiles. It seems that each file is somehow included in ZODB 
pickle so Data.fs grows very fast. Only packing helps. The side effect 
is that transaction takes quite a long time so conflicts are very common.
I tried to recreate the environment on the other machine and everything 
was fine despite the fact that I used all the same products. The only 
difference was that original app was running on Linux and I did it on 
Windows.

Any clues?
Products used:
- ExternalFile 1.2.0
- CMFExternalFile 0.5
- Plone 2.0.5
- Zope 2.7.6

BTW, how do you distinct read and write conflicts in event.log? I only have
INFO(0) ZODB conflict error at...


Read conflicts say ReadConflict somewhere. Write conflicts do not.
Probably only in recent Zopes though, I doubt 2.7 has that detail.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: The Zope Software Certification Program and Common Repository Proposal

2006-02-22 Thread Maik Ihde
Hi Stephan

after having quickly read your Proposal I think there are some nice ideas in it.
A central Zope(3) Software Repository with certified components would make life
a lot simpler for many of us. And this could also be used for marketing purposes
as well.

However I doubt that it is possible to to do all that Certification Stuff -
afaik the core developers are all very busy people, and judgement of code
quality doesn't seem that simple to me.

But thats just my 2c

Kind Regards
Maik


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Possible to run Zope on a shared host?

2006-02-22 Thread Marty McFly
Hello,

I've just tried to install zope on a shared host which is run by an Apache 
server. I have seen on the net, that there are 3 possibilities to run Zope 
together with Apache: rewrite_rules, ProxyPass and FastCGI. As far as I've 
seen, all of these 3 modules are already installed on the server. However, I 
think that you need to have root/superuser/...-privileges in order to use one 
of these methods, right?

Unfortunately, I don't have any of those privileges... I only have write-access 
to my personal home-directory. Do you have an idea what I could do instead?

Thanks, Martin

Schnell und einfach ohne Anschlusswechsel zur Lycos DSL Flatrate wechseln und 3 
Monate kostenlos ab effektiven 5,21 EUR pro Monat im ersten Jahr surfen.
http://www.lycos.de/startseite/online/dsl/index.html?prod=DSLtrackingID=email_footertxt___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] change ATImage metadata

2006-02-22 Thread Martijn Pieters
On 2/22/06, MIlos Prudek [EMAIL PROTECTED] wrote:
 how can I programatically change the Language attribute in Standard Resource
 Metadata of ATImage?

(First of al:l this is a Plone question and would have drawn a quicker
response on the plone mailinglists)

The language attribute is a standard Archetypes field, and as such you
can ask such fields what it's accesor and mutator are:

   field = item.Schema().get('language')
   field.accessor, field.mutator
  ('Language', 'setLanguage')

So item.setLanguage will mutate the language field.

--
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can Zope 2.9 Coexist With Zope 2.6 Using Different Ports?

2006-02-22 Thread Martijn Pieters
On 2/22/06, Mark, Jonathan (Integic) [EMAIL PROTECTED] wrote:
 Does Zope 2 support running two separate instances of two versions of Zope
 on different ports? I have been able to run Zope 3 concurrently with Zope
 2.6 without problem.

Absolutely, we run quite a few more than 2 Zope instances on one machine here.

 When I run bin/runzope in my Zope 2.9 home directory I get the following
 error on lock_file.py line 60:

 IOError: [Errno 13] Permission denied: '.../Data.fs.lock'

This is a different problem altogether. The Zope process does not have
the rights to create the Data.fs.lock file. Without the whole
traceback (always include the whole traceback!) I cannot tell you what
exactly went wrong though.

--
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] CMFExternalFile and huge ZODB pickles

2006-02-22 Thread Chris Withers

Pawel Lewicki wrote:

Any clues?
Products used:
- ExternalFile 1.2.0
- CMFExternalFile 0.5
- Plone 2.0.5


None of these are products I'd trust. Use a ZODB analysis tool to find 
out the types of objects you have in your database and see which product 
is causing the issues..



- Zope 2.7.6

BTW, how do you distinct read and write conflicts in event.log? I only have
INFO(0) ZODB conflict error at...


Upgrade to Zope 2.8

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Granting access by reading http headers (Consulting opportunity)

2006-02-22 Thread Chris Withers

Marc Schnapp wrote:


Did I ask if it accepted cookie? No, I asked if it accepts http basic 
auth. Care to answer my question? ;-)

Yes. The Google Mini accepts http basic auth.


Right, so why don't you do what I originally suggested and use that?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Poskey Errors and BTreeFolder

2006-02-22 Thread Chris Withers

Anton Stonor wrote:

   v = self.storage.modifiedInVersion(oid)
 File /var/www/zope/2.7.8/lib/python/ZODB/FileStorage.py, line 743, in 
modifiedInVersion

   raise POSKeyError(oid)
POSKeyError: 0x04b364

The traceback pattern is the same in all the zeo.log poskeyerror 
messages--just different oids.


Wow, genuine data corruption :-S

Have you tried checking the hardware that this Zope instance is running 
on for failures?


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] image processing site quidance...

2006-02-22 Thread Chris Withers

Nicolas Georgakopoulos wrote:


I don't have any experience writing external products... should be easy 
if I finish the python programming part as a simple traditional python 
release and then to implement it as a Zope product ?


Yeah, sure be easy enough... and we're to help if you run into problems :-)

For what part of my needs should I read about ZODB ? Can't understand  
the not to read whole image objects at once


Where are you storing your image data?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZODB Could not import class 'myAdMan' from module '*OEpEfZxd1Zzml/FOi4fDrA=='

2006-02-22 Thread Chris Withers

How about contacting myBannerProduct's authors?

Personally, I wouldn't trust any product that uses ZClasses...

Chris

Irek M. wrote:

Haj,
myBannerProduct 1.0 won´t install properly on Zope
2.7.4/SuSE9.3.
After untar and Restart of Zope there is only an empty
myBannerProduct Folder in Installed Products.

Additionally at de-install of the corrupt Product i
get this:
ZODB Could not import class 'myAdMan' from module
'*OEpEfZxd1Zzml/FOi4fDrA=='

TIA for any Hints and Suggestions

im






___ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )



--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can Zope 2.9 Coexist With Zope 2.6 Using Different Ports?

2006-02-22 Thread J Cameron Cooper

Mark, Jonathan (Integic) wrote:

My website GoodbyeJim.com currently runs Zope 2.6 on Red Hat 7.3. I 
have installed Zope 2.9 to use port 3200 instead of 80.


Does Zope 2 support running two separate instances of two versions of 
Zope on different ports? I have been able to run Zope 3 concurrently 
with Zope 2.6 without problem.


When I run bin/runzope in my Zope 2.9 home directory I get the 
following error on lock_file.py line 60:


IOError: [Errno 13] Permission denied: '.../Data.fs.lock'


I don't know if this is your problem, but you can't run two instances of 
the same ZODB unless you use ZEO. (That's my guess, but it depends on 
how you've installed things.) But it's certainly possible. I have at 
least three different versions of Zope and at least a dozen different 
instances on this machine right now.


   --jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope on a shared host behind Apache?

2006-02-22 Thread Marty McFly
Hello,

I've just tried to install zope on a shared host which is run by an Apache 
server. I have seen on the net, that there are 3 possibilities to run Zope 
together with Apache: rewrite_rules, ProxyPass and FastCGI. As far as I've 
seen, all of these 3 modules are already installed on the server. However, I 
think that you need to have root/superuser/...-privileges in order to use one 
of these methods, right?

Unfortunately, I don't have any of those privileges... I only have write-access 
to my personal home-directory. Do you have an idea what Icould do instead?

Thanks, Martin

P.S.: I'm having problems with my mail-provider. I hope this won't be a 
double-post again.

Schnell und einfach ohne Anschlusswechsel zur Lycos DSL Flatrate wechseln und 3 
Monate kostenlos ab effektiven 5,21 EUR pro Monat im ersten Jahr surfen.
http://www.lycos.de/startseite/online/dsl/index.html?prod=DSLtrackingID=email_footertxt___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope-DB] DCOracle2: lib vs lib64: make fails on SuSE SLES 9

2006-02-22 Thread Jet Wilda
Hi Christian,

I actually already got it to work.  I had to compile and install
python and then use that one instead of the system one and it worked for
me.  I'm guessing that your instructions are to get it to work on the
system python.   Thanks for the reply


Thanks


Jet

 -Original Message-
 From: Christian Long [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 22, 2006 12:12 AM
 To: Jet Wilda
 Subject: RE: [Zope-DB] DCOracle2: lib vs lib64: make fails on 
 SuSE SLES 9
 
 
 Yes, it's working fine.  Here are the steps I followed.  Let 
 me know how you do, and we can post back to the list
 
 Christian
 
 
 
 
 
 Download latest tarball here 
 http://cvs.zope.org/Products/DCOracle2/DCOracle2.tar.gz?tarball=1
 
 
 
 tar -zxvf DCOracle2.tar.gz
 cd DCOracle2
 
 vi src/Makefile.pre.in
 
 To fix this error:
   make[2]: *** No rule to make target 
 `/usr/lib/python2.3/config/Makefile', needed by `sedscript'.  
 Stop. Change (line 156)
 
 LIBP= $(exec_installdir)/lib/python$(VERSION)
 
 to
 
 LIBP=   $(exec_installdir)/lib64/python$(VERSION)
 
 To fix this error:
   gcc: cannot specify -o with -c or -S and multiple 
 compilations Change (line 121)
 
 DEFS= @DEFS@
 
 to
 
 DEFS=
 
 Write changes and quit vi: first, press Escape, then type   :wq,
 then press Enter.
 
 su
 make
 
 Don't worry about these gcc warnings
 dco2.c:: warning: cast to pointer from integer of different size
 dco2.c:: warning: dereferencing type-punned pointer will 
 break strict-aliasing rules
 
 
 Copy INNERMOST DCOracle2 folder to site-packages
 cp -a /home/mra_admn/downloads/DCOracle2/DCOracle2/
 /usr/lib64/python2.3/site-packages/
 
 exit
 
 
 
 Make sure the permissions in 
 /usr/lib64/python2.3/site-packages/DCOracle2 match the following
 
 cd /usr/lib64/python2.3/site-packages/DCOracle2
 ls -al
 
 total 268
 drwxr-xr-x  2 root root264 2005-11-29 16:10 .
 drwxr-xr-x  8 root root256 2005-11-29 18:06 ..
 -rwxr-xr-x  1 root root 139643 2005-11-29 16:06 dco2.so
 -rw-r--r--  1 root root  64543 2003-10-30 09:30 DCOracle2.py
 -rw-r--r--  1 root root  48361 2005-11-29 16:10 DCOracle2.pyc
 -rw-r--r--  1 root root   1725 2001-01-24 07:37 __init__.py
 -rw-r--r--  1 root root133 2005-11-29 16:10 __init__.pyc
 -rw-r--r--  1 root root102 2002-05-16 21:31 version.py
 -rw-r--r--  1 root root162 2005-11-29 16:10 version.pyc
 
 
 
 If the permissions do not match, fix them
 
 su
 cd /usr/lib64/python2.3/site-packages/DCOracle2
 chmod 755 dco2.so
 chown root:root *.py*
 
 
 
 -Original Message-
 From: Jet Wilda [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 14, 2006 9:15 AM
 To: [EMAIL PROTECTED]
 Subject: [Zope-DB] DCOracle2: lib vs lib64: make fails on SuSE SLES 9
 
 
 Hi,
 
   I was wondering if you ever got DCOracle2 to work on 
 64bit Suse? I have the same issue on 64bit Redhat ES 4.
 
 
 TIA
 
 Jet
 
 __ NOD32 1.1407 (20060213) Information __
 
 This message was checked by NOD32 antivirus system. 
http://www.eset.com


___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] optional arguments to zsql methods

2006-02-22 Thread garry

Charlie Clark wrote:


On 2006-02-22 at 22:10:20 [+0100], garry [EMAIL PROTECTED] wrote:
 


I am importing a large data set via Zope into a Postgres database. Data
items may or may not exist so I am using the optional argument in the
zsql methods. What I want is that if the data is missing the database
inserts default values.
However,

if type=string, the absent data item is rendered as ''

if type=nb, the absent data item is rendered as 'Null'

In either case this does not allow default values to be inserted. I can
insert the defaults by doing this:
.ZSQL.
snip.
dtml-if surnamefirst
 dtml-sqlvar  surnamefirst   type=string ,
dtml-else
DEFAULT,
/dtml-if

With 20 or so inserts in one query this gets messy and could be slow? if
this method has to be called many times on one import cycle.
My question is therefore is there a cleaner way of doing this or am I on
the right track?
   



If you really are doing a simple import then you might be better of doing 
this in a straight script which will allow you to extend your head and 
params dynamically depending on what you are inserting.


Here's a skeleton script

db = db.connect()
c = db.cursor()
sql_head = INSERT (%s) INTO %s 
paras = ['name', 'address', 'etc']
sql_tail = VALUES (%s)
sql_paras = ,. join(['%s'] * len(paras))

c.execute(sql_head % (paras) + sql_tail % sql_paras, 
values_you_want_to_insert)



Otherwise you might want to look at something like SimpleTemplates as 
replacement for ZSQL Methods as I agree too many dtml-if s can make a man 
go mad. There is the possibility of using the dmtl-group stuff but I find 
this worse than a bundle of ifs.


 

Thanks, this gives me an idea of how to proceed. I am transforming an 
xml file into a python script, so I may as well do the whole thing in 
python rather than using zsql.

Regards
Garry
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db