[Zope-dev] AttributeProvider and type information

2000-10-11 Thread John Eikenberry


I just want to ask a couple quick questions...

First, when using the AttributeProvider class you are pretty much required
to subclass it to add methods for altering the values of the attributes.
Basically I want to be sure I'm not missing something criticle as there
don't seem to be any methods on the default dataskin class for this (as
there are for propertysheets)... and it seems like there should be.

Related to this is dealing with typing information like PropertySheets used
(via the _properties attribute). Wouldn't make sense to keep the
AttributeProvider consistent with this... instead of the simple Attributes
list? Seems like the type information and other meta information would as 
useful for handling attributes on the dataskin as for propertysheets.

-- 

John Eikenberry
[[EMAIL PROTECTED] - http://zhar.net]
__
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
  --B. Franklin

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




[Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

The Xron product seems rather "fragile" in use.

That is, if things go wrong when an Xron DTML Method is triggered, that
method doesn't get rescheduled.

An example of this is that my intranet DNS server needed to be rebooted.
Xron couldn't look up the appropriate domain name, and stopped working.

--
2000-10-11T08:16:34 PROBLEM(100) Products.Xron.Loggerr 
Trigger event: http://my.development.server:4080/my_xron_method
Trigger time: 2000/10/11 09:14:00 GMT+1
Failed to trigger event.
Type=bci.NotAvailable
Val=host not found (File:
http://my.development.server/my_xron_method/trigger Line: [])
None None for None
--
2000-10-11T08:19:04 PROBLEM(100) Products.Xron.Loggerr Failed to disarm
event


Also, if something bad happens in the Dispatcher thread, the thread
dies.


Before I leap in and start patching Xron, I'd like to have a discussion
about how Xron should handle problems.

My first thought is that on errors in the dispatcher thread, Xron should
enter an "error state" where it probes every so often to see whether it
can resume normal operation. The length of time between probes could
increase with each probe, to give good performance with transient
problems whilst preventing Xron from choking resources. 

--
Steve Alexander
Software Enigneer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

Steve,

I am also interested in scheduling... though I haven't looked closely at
Xron.


 The Xron product seems rather "fragile" in use.

 That is, if things go wrong when an Xron DTML Method is triggered, that
 method doesn't get rescheduled.

Does Xron take an optimistic approach to repeating jobs?  In other words,
does it assume every job is a one-time job and that the last duty that a
repeating job performs is to reschedule itself?

 An example of this is that my intranet DNS server needed to be rebooted.
 Xron couldn't look up the appropriate domain name, and stopped working.

 --
 2000-10-11T08:16:34 PROBLEM(100) Products.Xron.Loggerr
 Trigger event: http://my.development.server:4080/my_xron_method
 Trigger time: 2000/10/11 09:14:00 GMT+1
 Failed to trigger event.
 Type=bci.NotAvailable
 Val=host not found (File:
 http://my.development.server/my_xron_method/trigger Line: [])
 None None for None
 --
 2000-10-11T08:19:04 PROBLEM(100) Products.Xron.Loggerr Failed to disarm
 event


 Also, if something bad happens in the Dispatcher thread, the thread
 dies.

What does the Dispatcher thread do?  Does it fire off worker threads?

 Before I leap in and start patching Xron, I'd like to have a discussion
 about how Xron should handle problems.

 My first thought is that on errors in the dispatcher thread, Xron should
 enter an "error state" where it probes every so often to see whether it
 can resume normal operation. The length of time between probes could
 increase with each probe, to give good performance with transient
 problems whilst preventing Xron from choking resources.

What are other threads in Xron doing while the Dispatcher thread is hosed?
What are the other threads?


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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

Chris McDonough wrote:
 
 Steve,
 
 I am also interested in scheduling... though I haven't looked closely at
 Xron.
 
  The Xron product seems rather "fragile" in use.
 
  That is, if things go wrong when an Xron DTML Method is triggered, that
  method doesn't get rescheduled.
 
 Does Xron take an optimistic approach to repeating jobs?  In other words,
 does it assume every job is a one-time job and that the last duty that a
 repeating job performs is to reschedule itself?

It is the Xron DTML Method's responsibility to reschedule itself.
It could be its first duty, however. Then again, as all the work happens
inside a ZODB transaction, it doesn't matter when the reschedule
happens.

 What does the Dispatcher thread do?  Does it fire off worker threads?

Xron has a single dispatcher thread. This thread knows how long to sleep
for until the next job needs to run. It uses Client.py to run a job.
Jobs are Xron DTML Methods. They have a "trigger" method that gets
called through the web from localhost, by the Dispatcher thread.

  Before I leap in and start patching Xron, I'd like to have a discussion
  about how Xron should handle problems.
 
  My first thought is that on errors in the dispatcher thread, Xron should
  enter an "error state" where it probes every so often to see whether it
  can resume normal operation. The length of time between probes could
  increase with each probe, to give good performance with transient
  problems whilst preventing Xron from choking resources.
 
 What are other threads in Xron doing while the Dispatcher thread is hosed?
 What are the other threads?

There are no other threads in Xron.
Xron creates a single thread to do all event dispatching. The work is
done in Zope ZODB threads (or whatever the correct terminology is). The
dispatcher thread communicates with a ZODB thread by using Client to
make a web request.

Xron usually makes requests as the anonymous user. However, I've patched
my Xron to make requests as XronUser by hardcoding (!) the username and
password for that in the RPC.py module of Xron. Then, I've manually
created a XronUser user in my root user folder. I give XronUser the
local roles needed to run methods I want to be scheduled via Xron.

This is not the ideal way to make Xron use authentication. I posted a
proposed design for that to zope-dev in August.

http://lists.zope.org/pipermail/zope-dev/2000-August/006548.html
http://lists.zope.org/pipermail/zope-dev/2000-August/006549.html
http://lists.zope.org/pipermail/zope-dev/2000-August/006550.html

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope-dev] Better user management: Usership vs. Membership

2000-10-11 Thread Michael Bernstein

Jonas Juselius wrote:
 
 Hello,
 
 I had a look at the Membership product, but I could not get it to work. It
 seems that the PortalMember ZClass in the PortalMembership Product inherits
 from _ZClass_for_LoginUser, which is no longer in the LoginManager...

Were you trying to use Membership with a CVS verson of
LoginManager? Membership 0.7.6 works with LM 0.8.7a and
ZPatterns 0.4.1snap1.

 But
 actually I don't care... I tried to contact Bill about the Membership Prod,
 but he seems to be unreachable because his mail address doesn't work.

Bill just got married, was in the middle of changing network
providers, and his old provider screwed up their IP
addressing (on his wedding day). He says that he'll be back
up Thursday or Friday.

 I found many nice ideas in the Membership product, and I think it would really
 be a good idea to develop it further. Does anybody know about any recent
 developments or what the current status is? Is there going to be a new
 release soon, is anyone even working on the Membership product?

Bill is currently working on re-integrating Membership with
the PTK. I recently found a way of integrating Membership+LM
with the local roles interface. I also modified my copy of
Membership to authenticate off of an NT PDC via SMB from a
Solaris box.

Most LoginManager and Membership discussion happens on the
Zope-PTK mailing list, not Zope-Dev.

Cheers,

Michael Bernstein.

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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

Chris McDonough wrote:
 
 As a side note, I do not like the fact that Xron requires you to use special
 DTML methods.  I suppose this is a requirement in this architecture due to
 the fact they need to be autocataloged, but I don't really like that feature
 either :-).

I think Xron could work with anything that has "trigger" and "disarm"
methods, that gets put into the Schedule catalog.


   What does the Dispatcher thread do?  Does it fire off worker threads?
 
  Xron has a single dispatcher thread. This thread knows how long to sleep
  for until the next job needs to run.
 
 Do you think this is this any more effective than having a producer thread
 do a lookup every minute to see what jobs are current, after which it should
 put the current jobs in a queue?

What if you want a small job to be done every 30 seconds?

  It uses Client.py to run a job.
 
 Why is this?  This doesn't make any sense to me on its face.  Why not just
 call the method from a separate thread?

Which separate thread? Do you create a new ZODB thread? That sounds as
if it might use quite a few resources.

Is there a Zope API for making ZODB threads call methods on objects, as
signalled by other threads? I'm guessing the easiest way to do that is
to use Client.py to make a new http request.

 I see... would it be naive if I were to say that I think that a scheduler
 should fire off threads of its own and not rely on an external facility to
 run the jobs?

I'd really like to see a scheduler as a standard part of Zope.
I think it would be good to have scheduled methods called from within
Zope, rather then going through http. I don't know enough about how
ZPublisher/ZODB works to know where to start this though.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

  As a side note, I do not like the fact that Xron requires you to use
special
  DTML methods.  I suppose this is a requirement in this architecture due
to
  the fact they need to be autocataloged, but I don't really like that
feature
  either :-).

 I think Xron could work with anything that has "trigger" and "disarm"
 methods, that gets put into the Schedule catalog.

I guess I'm not real real hot on the dependency on a catalog at all.  I'm
having a hard time imagining a situation where you have so many events that
you need to index them -- especially using a ZCatalog.  It just seems like
too many moving parts and overkill for the job.  :-)

   Xron has a single dispatcher thread. This thread knows how long to
sleep
   for until the next job needs to run.
 
  Do you think this is this any more effective than having a producer
thread
  do a lookup every minute to see what jobs are current, after which it
should
  put the current jobs in a queue?

 What if you want a small job to be done every 30 seconds?

I generally don't... I'm satisfied with cron granularity, although others
might not be.  Do you have this requirement?

   It uses Client.py to run a job.
 
  Why is this?  This doesn't make any sense to me on its face.  Why not
just
  call the method from a separate thread?

 Which separate thread? Do you create a new ZODB thread? That sounds as
 if it might use quite a few resources.

 Is there a Zope API for making ZODB threads call methods on objects, as
 signalled by other threads? I'm guessing the easiest way to do that is
 to use Client.py to make a new http request.

Well... AFAIK, there is no such thing as a ZODB thread... there are a number
of Python threads used by Zope.  We'd just fire off another one to perform a
task as part of the thing that takes an event off the queue.  This might be
naive.  I need to try it.

 I'd really like to see a scheduler as a standard part of Zope.
 I think it would be good to have scheduled methods called from within
 Zope, rather then going through http. I don't know enough about how
 ZPublisher/ZODB works to know where to start this though.

I'll need to try to call get_transaction().commit() from a
manually-constructed Python thread fired off from Zope and see what happens.
I think it'll just work.  I'll find out in a few minutes.  :-)



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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

 I'll need to try to call get_transaction().commit() from a
 manually-constructed Python thread fired off from Zope and see what
happens.
 I think it'll just work.  I'll find out in a few minutes.  :-)

Yes, it just works.  :-)



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




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

  Do you think this is this any more effective than having a producer
thread
  do a lookup every minute to see what jobs are current, after which it
should
  put the current jobs in a queue?  E.g., as the "run" method of a
separate
  producer thread:

 the same problem applies, a solution might be a timer and a signal
 handler to catch a signal event when a new job is entered into the
 system. events could be managed as some sort of collection of linked
 lists (or whatever ds).

I think this problem is solved by:

- polling for "current" events every 60 seconds *exactly on the 0th second
of the
  minute* (this ensures that stopping and starting the scheduler won't
accidently
  cause a "current" repeating event to fire twice).

- allowing one-time events (which are most likely to need to be executed
immediately)
  to be "current" for the minute implied by the event's timestamp as well as
the minute
  just before that one.  This ensures that an event that has a timestamp
that was "current"
  when entered, but has subsequently been passed due to event polling
overhead
  will be executed (even if it is entered at hh:mm:59.999 or similar).  It
also assumes
  that the scheduling poller will never take more than 60 seconds to poll
all events,
  which is a fairly safe assumption.

- the executor of the event is required to invalidate one-time events once
they've
  been executed (or before they're executed) so they don't get fired twice.

I don't believe there is any need for a signal handler or anything of the
sort, the problem seems to just require careful synchronization.

 i played around with this in a monitor thread and you just can't achieve
 the proper semantics to execute an arbitray zope method. you have to
 recreate the request, response as well as have all the required support
 modules (DTML, tracebacks, etc) to successfully call a method, you are
 in essence reduplicating the publishing machinery. i tried to think of a
 way to get around this but i came up short. you can still access
 variables and simple methods.

This would need to be thought through...  the same problem exists for unit
testing.  :-(

  I see... would it be naive if I were to say that I think that a
scheduler
  should fire off threads of its own and not rely on an external facility
to
  run the jobs?

 the dispatcher thread itself has a connection to the ZODB, its using
 client as RPC to invoke the methods on Publishing threads. Since there
 is a hardcoded limit to ZODB connections firing off more connections
 does not seem like a good idea.

AFAIK, threads will block if they can't get a DB connection.  What risks
does that imply?  Is it a problem?




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




Re: [Zope-dev] Strange permissions in the (built-in) API reference

2000-10-11 Thread Michel Pelletier

Dieter Maurer wrote:
 
 Recently, I read the "Interface Wiki". It covers most of
 the methods contained in the API and its permission descriptions
 made a very solid impression. Maybe, you can start from these
 descriptions.

The Interfaces Wiki is actually where all the API documention did come
from.  Are there inconsistencies?
 
 It might also not be optimal wrt. maintainability
 that the modules, their classes and their methods with
 the respective docstrings have been recreated
 just for API documentation purposes.
 Probably, it would be preferable to use the docstrings
 and the method prototypes from the source directly.
 You might still want to control with methods are described
 in the API and in which order.
 Personally, I would control this, too, inside the source
 documentation (a la javadoc), but I can imagine that an
 external configuration might be advantageous.

Yes, there are pros and cons on both sides, and Amos, Jim and I had some
long converstations about this very subject.  We decided to go with
seperate documentation instead of autogenerating it because:

1. An interface should be a contract, not just an artifact of the code.

2. Python, being without first class support for interfaces, has no
clear way of spelling an interface of a class.

3. Jim is working on formal interface support for python and he's
thinking hard about it, we definatly didn't want to think hard about it
and then turn out we came up with a bad answer, the existing API docs
are just that, docs, not interfaces.  When format interfaces come about,
API docs will probably be converted to that format.

Thanks for the comments!

-Michel

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




[Zope-dev] Inheritable properties(sheets)? Anyone? Anyone? Bueller?

2000-10-11 Thread Alexander Schonfeld
I want to inherit the properties of one zclass in another zclass, but
it seems to cause some namespace clashing... shouldn't this be possible?
Working with the instance of the class is fine, but inter-zclass
inheritance (acquisition?) would be nice...

Am I missing something?
Thanks,

Alex.
 
1010011010101001101010100110101010011010
0  Digital Garage$B!!%G%8%?%k

[Zope] Stupid questions

2000-10-11 Thread Manuel Amador (Rudd-O)


Am i supposed to get "XMLmethods" and "Python methods" in the add
product drop down?
I'm baffled.
Thanks =)
PD: the subject says it all. Please don't flame me. I think we
need a little bit more organization, some kind of comprehensive index instead
of looking for documentation in several places.
--
Manuel Amador (Rudd-O)



Re: [Zope] Zope.org Feature Request - Product Download Counter

2000-10-11 Thread Toby Dickenson

On Tue, 10 Oct 2000 16:15:44 -0400, mindlace [EMAIL PROTECTED]
wrote:

Andy McKay wrote:
 
 Of course the only problem with a hit counter is that high traffic requests
 mean continually writing the object into the ZODB each time it gets hit /
 downloaded, whatever. Thats why I release FSCounter which uses the file
 system. I would like to expand this to cover multiple objects...

The problem is slightly more complicated than this:  We have Apache
cache file and image objects.  This is a good thing, because they are
static, and Apache will *always* be better than Zope at serving static
content. This is a bad thing, because direct requests for files don't
ever make it to Zope.

FYI, there is a (mostly successful) way around this if you dont worry
about Zope having to serve up a 304 response for this request. set
the following header.

Cache-Control: public, s-maxage=0, proxy-revalidate

Caches will cache the content, but always revalidate it before using
the cached reply. 


Toby Dickenson
[EMAIL PROTECTED]

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




[Zope] Programmatically: zclasses and images

2000-10-11 Thread brocken22

Hallo,
I've got two problems cutting my nerves:
The site-structure is organized in a way that zclasses can be added
programmatically(the user decides by clicking on a tree-list where to add the
classes)
The 1. problem is that I can't manage to pass the URL of the selected
object to add the zclass in the requested place.
Therefore I'm not using one script for adding the instances, but every
zclass is holding the constructormethod(you're clicking on the tree and the
selected zclass is responding with the addFormular and later with the
addConstructor).
This way is working.I'm not very happy about it because every zclass is
created with methods that I think can be avoided.
My biggest problem is that I can't manage to add images in the new zclass.
That's the script:
dtml- with "manage_addProduct['Zzzz']"
   dtml-call "ZZZsite_add(_.None, _, NoRedir=1)"
   dtml-call "manage_addImage(pictureName,picture)"
/dtml-with

This is a zclassMethod and the formMethod(also inside the zclass)passes
the 'picture' and 'picturename' variables!
The ZZZsite_add method is the usual-one.
I think it's an acquisition problem. 

-- 
Sent through GMX FreeMail - http://www.gmx.net


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




[Zope] Problem with Zope 2.2.0 and Z SQL Method : NO MODULE NAMED ZDBASE...

2000-10-11 Thread Frederic Quin

Hi all,


I have some problem using Z SQL Method on Zope 2.2.0. I have a Zope
error clicking on the item "Advanced". I have the same error when trying
to find an object... Here is the error :


Thanks
Fred


Error

 Zope has encountered an error while publishing this
resource. See below for details. 

 Error Type: ImportError
 Error Value: No module named ZDBase



 Troubleshooting Suggestions

  The URL may be incorrect. 
  The parameters passed to this resource may be
incorrect. 
  A resource that this resource relies on may be
encountering an error. 

 For more detailed information about the error, please refer
to the HTML source for this page. 

 If the error persists please contact the site maintainer.
Thank you for your patience. 


   Version 2.0.3 -- © 2000 Profile
For You -- Internal use only.

Traceback (innermost last):
  File
/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
222, in publish_module
  File
/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/local/Zope-2.2.0-linux2-x86/lib/python/Zope/__init__.py,
line 221, in zpublisher_exception_hook
(Object: essai)
  File
/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_advancedForm)
  File
/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Publish.py, line
112, in call_object
(Object: manage_advancedForm)
  File /Zope2/lib/python/App/special_dtml.py, line 120, in __call__
(Object: manage_advancedForm)
(Info: /Zope/lib/python/Shared/DC/ZRDB/advanced.dtml)
  File /Zope2/lib/python/DocumentTemplate/DT_String.py, line 528, in
__call__
(Object: manage_advancedForm)
  File /Zope2/lib/python/Shared/DC/ZRDB/DA.py, line 508, in
manage_product_zclass_info
(Object: essai)
  File /Zope2/lib/python/ZODB/Connection.py, line 447, in setstate
ImportError: (see above)

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




RE: [Zope] Re: Upload just file headers?

2000-10-11 Thread Seb Bacon

Hmm, well you certainly can't do it at the browser side.

A well-formed HTTP header should contain a content-length attribute which
you can examine.  However, deciding whether to accept the file or not would
I imagine not be possible inside zope since the whole POST operation is
handled by ZServer, so you probably have to write a cgi script to do it.
For example, if you wanted to stick with python, you could use the cgi
module.  You'd examine the header, and if you were happy, you could pass on
the data in a new POST to zope.  If you were unhappy, you could return a
value from the cgi.

This is all off the top of my head, and I'm sure there must be a nicer way
of doing it than that.  It's not nice having it all outside zope.  but it
should be a start, at least.

seb

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Paul Winkler
 Sent: 11 October 2000 06:52
 To: Zope mailing list
 Subject: [Zope] Re: Upload just file headers?


 Still haven't found an answer, after 4 hours searching the
 egroups archive.

 Just to clarify:
 I need to read the headers of the files BEFORE I upload the
 entire file, because the files may be very large and I need
 to be able to give a warning if the file does not meet
 certain criteria. Example: a jpeg file of 500x400 pixels,
 approx. 200 kb when the application, to be used in an
 application that needs much higher resolution in order to
 look good. I want to avoid wasting 50 seconds or so
 uploading this file just to find out that it's no good.

 If I could upload the first bit of the file (1k should be
 plenty), I could open it with PIL and check the size
 attribute. (I've verified this by doing head --bytes 500
 foo.jpeg  test.jpeg and then opening test.jpeg in python -
 it works even though the file has been truncated.)


 I wrote:
 
  I'd like to make a form that looks like the typical file
  upload form, but will upload ONLY the header of the chosen
  file.
  Anyone know how / if this can be done?


 --
 .paul winkler..
 slinkP arts:   music, sound, illustration, design, etc.
web page:  http://www.slinkp.com
   A member of ARMS:   http://www.reacharms.com

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




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




[Zope] ZMySqlDA Binary version

2000-10-11 Thread Agus Setiawan

Hi all, 

Does anyone have a binary version of ZMySqlDA product?
Because I'm running it on my Win 2000 Professional,
and with the non-binary version, it give me message
like this:

2000-10-11T12:26:25 ERROR(200) Zope Couldn't import
Products.ZMySQLDA
Traceback (innermost last):
  File D:\WEBSITE\lib\python\OFS\Application.py, line
397, in import_products
(Object: string)
  File
D:\WebSite\lib\python\Products\ZMySQLDA\__init__.py,
line 106, in ?
  File D:\WebSite\lib\python\Products\ZMySQLDA\DA.py,
line 108, in ?
  File D:\WebSite\lib\python\Products\ZMySQLDA\db.py,
line 106, in ?
ImportError: No module named _mysql

and if anyone have the product, could you please help
me by sending it through my e-mail?

Thanks very much

__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

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




Re: [Zope] Medusa Monitor

2000-10-11 Thread Jens Vagelpohl

terry,

you forgot the step of actually connecting to the monitor :) there is a very
short howto on using the correct client program to log into the monitor at:

http://www.zope.org/Members/teyc/howtoMonitorClient

and similar info at:

http://www.zope.org/Documentation/Misc/DEBUGGING.txt


jens




on 10/10/00 18:48, Terry Kerr at [EMAIL PROTECTED] wrote:

 Use it for debugging sometimes.
 
 Is very easy to use.  Basically
 
 import Zope
 z = Zope.app()
 
 then z is the root of your zope tree so you can do anything.  You will need
 to import any other python modules you need too.
 
 terry
 
 Hung Jung Lu wrote:
 
 Hi,
 
 Zope comes with the Medusa monitor (port 8099 by default) which is kind of
 cute and allows one to get into the guts of Zope. But do people really use
 it? How do people use it? Is there any document describing the usages of
 this monitor? Are there some features of this monitor that makes debugging
 easier?
 
 regards,
 
 Hung Jung


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




[Zope] Easiest way to turn X-Forwarded-For to Remote-IP?

2000-10-11 Thread Marcin Kasperski

I use Zope via Apache proxy, what causes some trouble (all remote IPs
for Zope are equal to 127.0.0.1).

As I finally installed mod_proxy_add_forward, I get original address in
X-Forwarded-For header (REQUEST['HTTP_X_FORWARDED_FOR']).

The question is: can I do something easy to automatically perform
if(remote_ip = 127.0.0.1 and X-Forwarded-For exists) then
  set remote_ip = whatever is in X-Forwarded-For
logic? In particular, I would like changed IP to be used by Zope access
control and Zope log.

Regards

--
http://www.mk.w.pl /
 Marcin.Kasperski | O kredytach mieszkaniowych:   
   @softax.com.pl |   http://www.kupmieszkanie.w.pl/mieszkanie_kredyt 
 @bigfoot.com  \

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




[Zope] Login

2000-10-11 Thread Joaldo Junior

 ... It will be that somebody knows to inform me as I obtain to catch
the 0 variable that informs the user name login.


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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Chris McDonough

Paul,

I'm sorry if I'm dropping context here, but I'm not sure what you mean when
you say "headers of files".

Do you just want to check the size of files before you put them in the ZODB?


- Original Message -
From: "Paul Winkler" [EMAIL PROTECTED]
To: "Zope mailing list" [EMAIL PROTECTED]
Sent: Wednesday, October 11, 2000 1:51 AM
Subject: [Zope] Re: Upload just file headers?


 Still haven't found an answer, after 4 hours searching the
 egroups archive.

 Just to clarify:
 I need to read the headers of the files BEFORE I upload the
 entire file, because the files may be very large and I need
 to be able to give a warning if the file does not meet
 certain criteria. Example: a jpeg file of 500x400 pixels,
 approx. 200 kb when the application, to be used in an
 application that needs much higher resolution in order to
 look good. I want to avoid wasting 50 seconds or so
 uploading this file just to find out that it's no good.

 If I could upload the first bit of the file (1k should be
 plenty), I could open it with PIL and check the size
 attribute. (I've verified this by doing head --bytes 500
 foo.jpeg  test.jpeg and then opening test.jpeg in python -
 it works even though the file has been truncated.)


 I wrote:
 
  I'd like to make a form that looks like the typical file
  upload form, but will upload ONLY the header of the chosen
  file.
  Anyone know how / if this can be done?


 --
 .paul winkler..
 slinkP arts:   music, sound, illustration, design, etc.
web page:  http://www.slinkp.com
   A member of ARMS:   http://www.reacharms.com

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




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




[Zope] acl_user and parent directory

2000-10-11 Thread Stephan Goeldi

When I create a user in a subfolder, he can view the files in the parent 
folders:

/www/folder1
/www/folder2

The manager of folder1 can not only view the content of /www but the content 
and the files of /www/folder2 too.

This is BAD security IMHO.

I don't want the user of folder1 let to know, that there exists a folder2!
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




[Zope] Re: [Stackless] Stackless Zope

2000-10-11 Thread entropia

Sorry. The last phrase is: And C extensions? I don't look the monitor when
I write.

entropia escribió:

 Have someone tried Zope with Stackless. Is that stable? I don't know to
 much about Stackless internals.  Which modules are incompatible with
 Stackless? Anc D extensions?

 ___
 Stackless mailing list
 [EMAIL PROTECTED]
 http://starship.python.net/mailman/listinfo/stackless


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




Re: [Zope] Zope in Windows is faster than Linux ???

2000-10-11 Thread Riku Voipio

On Mon, Oct 09, 2000 at 01:39:41PM +0100, Toby Dickenson wrote:
 We have been stress testing our Zope application on NT and Linux. Our
 conclusion is that OS is not a factor in Zope performance.

 Its all application-specific, and theres nothing I can release at the
 moment. Essentially the timings were all within a 15% band after a
 little tweaking.

 Personally I don't think this result is at all suprising: In a loaded
 Zope system the processor spends all its time executing the python VM,
 not OS code.

...which takes us to the obvious question - howto make python faster?
Has anyone tried diffrent compiler flags for python etc. to make it 
faster?

-- 
Riku Voipio
[EMAIL PROTECTED]
09-862 60764


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




Re: [Zope] Black Magic

2000-10-11 Thread Robin Becker

In article 00e801c032ea$50b15970$[EMAIL PROTECTED], Evan Simpson
[EMAIL PROTECTED] writes
From: Fred Yankowski [EMAIL PROTECTED]
 The information you just provided about the DTML Method "call
 signature" and the like is very useful.  Is this kind of reference
 material written down somewhere in a guide/how-to/wiki/...?

The only thing I could find offhand is
http://www.zope.org//Wikis/DevSite/Projects/PythonMethods/NamespaceObjectInterfa
ce, which I wrote.
I don't know if ZDP or someone else has documented it.

Cheers,

Evan @ digicool  4-am
OK so I have a similar but still to me confusing problem

I have a Product P containing two folderish ZClasses A and B. A and B
both have class specific methods A_init and B_init to initialise
specific bits of each. The product P has some methods eg M defined which
are useful to both A and B.

1) How do I make the add methods behave identically whether I invoke
as /dir/manage_addProduct/P/A_add or when I invoke from the manage add
interface. I want to know the meta_type of the actual location where the
product will appear not the factory's meta_type.

2) When I attempt to call B_add from inside A's private method A_init
I seem to see a completely different context from when I call B_add
directly on an instance of A.

3) I suppose this is related to the fact that inside A_init (the private
method) I don't seem to see the same context as in A_add, ie the method
M is visible in A_add, but not in A_init.

How do ZClass contexts and the product context relate?
-- 
Robin Becker

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




[Zope] Restart button corrupted data.fs.index file

2000-10-11 Thread Kit O'Connell

After installing two new Products (ZCounter the first time,and FSCounter
the next time), I hit the Restart button in the Zope Control Panel. Zope
did not come up. I tried a manual stop/start. The start resulted in this
error message:

 Traceback (innermost last):
   File "/usr/home/txpn/Zope/z2.py", line 554, in ?
 exec "import "+MODULE in {}
   File "string", line 1, in ?
   File "/usr/home/txpn/Zope/lib/python/Zope/__init__.py", line 110, in ?
 DB=ZODB.FileStorage.FileStorage(Globals.BobobaseName)
   File "/usr/home/txpn/Zope/lib/python/ZODB/FileStorage.py", line 292,
in
+__init__
 r=self._restore_index()
   File "/usr/home/txpn/Zope/lib/python/ZODB/FileStorage.py", line 427,
in
+_restore_index
 info=p.load()
 cPickle.UnpicklingError: pickle data was truncated

The data.fs.index file was then corrupt. If I renamed it, and tried
another start, Zope would start fine. I did this twice w/ the same
results.

I'm using Zope 2.2.2. 

Stevea on #zope suggested Jim might be interested in this, and that I
should also send it to a Zope mailing list -- since I'm not on Zope Dev
yet, I'm sending it here. I have a copy of the old index files if anyone
needs to see them.

Cheers,
Kit


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




[Zope] How to see if two objects are the same

2000-10-11 Thread Ron Bickers


I want to see if an object is the one aqcuired from the root, but I'm
hitting walls.

  dtml-var "myObject"
  dtml-var "PARENTS[-1].myObject"
  dtml-var "PARENTS[-1].myObject is myObject"

This returns the following when in the root folder context:

  TinyTable instance at 8684ad8
  TinyTable instance at 8684ad8
  0

It returns the following in a folder where there is another myObject:

  TinyTable instance at 8684ad8
  TinyTable instance at 86709f8
  0

What am I missing in the comparison?

Thanks!

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


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




[Zope] How to see if two objects are the same (minor fix)

2000-10-11 Thread Ron Bickers

 From my previous post, it looked like the parent was changing.  I had
the first two lines swapped.  Fixed below.



I want to see if an object is the one aqcuired from the root, but I'm
hitting walls.

  dtml-var "PARENTS[-1].myObject"
  dtml-var "myObject"
  dtml-var "PARENTS[-1].myObject is myObject"

This returns the following when in the root folder context:

  TinyTable instance at 8684ad8
  TinyTable instance at 8684ad8
  0

It returns the following in a folder where there is another myObject:

  TinyTable instance at 8684ad8
  TinyTable instance at 86709f8
  0

What am I missing in the comparison?

Thanks!

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


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




[Zope] Zope Hotfix: ObjectManager subscripting

2000-10-11 Thread ethan mindlace fremen

This hotfix addresses an important security issue that affects Zope
versions up to and including Zope 2.2.2. 

The issue involves the fact that the 'subscript notation' that can be
used to access items of ObjectManagers (Folders) did not correctly
restrict return values to only actual sub items. This made it possible
to access names that should be private from DTML (objects with names
beginning with the underscore '_' character). This could allow DTML
authors to see private implementation data structures and in certain
cases possibly call methods that they shouldn't have access to from
DTML. 

While we know of no instances of this issue being used to exploit a
site, we recommend that any Zope 2.2.x site that allows DTML to be
edited by untrusted  users apply this Hotfix. 

http://www.zope.org/Products/Zope/Hotfix_2000-10-11/Hotfix_2000-10-11.tgz 

The hotfix will work for all versions of Zope 2.2.0 and higher. A future
version of Zope will contain the fix for this issue, and you will be
able to uninstall the hot fix after upgrading.

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




Re: [Zope] Acquisiton Wrappers bite ;-)

2000-10-11 Thread Chris Withers

Ron Bickers wrote:
 This returns the following when in the root folder context:
 
   TinyTable instance at 8684ad8
   TinyTable instance at 8684ad8
   0

the above is a bit misleading ;-)

The two objects aren't actually at the same address 'cos your comparison
is actually of the acquisiton wrappers that are wrapping your TinyTable
object...

 dtml-var "PARENTS[-1].myObject is myObject"

This comparison will never return true for that reason...

 dtml-var "PARENTS[-1].myObject == myObject"

...this one will return true in the next version of Zope, in the above
example...

To do comparisons like this, though, you really need to be in an
external method or other unrestricted python so you can get access to
.aq_base, which is the real object you're dealing with...

have fun,

Chris :-)

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




Re: [Zope] Stupid questions

2000-10-11 Thread mindlace

"Manuel Amador (Rudd-O)" wrote:
 
 Am i supposed to get "XML methods" and "Python methods" in the add
 product drop down?

Only if you've added those products to your zope installation. Both XML
methods and Python methods are considered "content objects" in the
Products organization:

http://www.zope.org/Products/content_object?query_start=21

 PD: the subject says it all. Please don't flame me.  I think we need a
 little bit more organization, some kind of comprehensive index instead
 of looking for documentation in several places.

I'm working on categorizing some of the documentation now: we should
have something (more) useful soon.

Thanks,
~ethan
Zopatista COmmunity Liason

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




[Zope] Building DCOracle on AIX 4.3.2 for use with python 1.52

2000-10-11 Thread Turney, James


 Hello,
 Are there any tips to getting DCOracle 1.32 built on AIX 4.3.2.  I have
 built python successfully on AIX but cannot seem to get DCOracle to build
 without getting undefined symbols which appear to be python related.
 
 Any suggestions? 

[EMAIL PROTECTED]


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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Paul Winkler

Another way to look at it:
I want to start uploading the file, but stop the upload
almost immediately - after I've got enough to read the file
header, but long before the upload would normally finish.

Chris McDonough wrote:
 
 Paul,
 
 I'm sorry if I'm dropping context here, but I'm not sure what you mean when
 you say "headers of files".
 
 Do you just want to check the size of files before you put them in the ZODB?

That would be useful, but I need more information than that.
I need to read some of the file's description of itself
that's commonly kept in a header at the beginning of a file.

For example, take a .gif or .jpeg file and throw away all
but the first (let's say) 1 kb of the file.
If you try to open this truncated file with an image editor
(gimp, photoshop, whatever) you'll have problems. But useful
information is still stored in that first part of the file,
as we can see using python and PIL.
Example, on linux:

head --bytes 1000 foo.gif  foo_truncated.gif
python
...
 import Image
 test = Image.open('foo_truncated.gif', 'r')
 test.size
(210, 210)

So in this case, we can find out that foo.gif is 210 x 210
pixels even if we only have access to the first 1 kb of the
12 kb file.

If the file in question is 1 MB or so, this trick becomes
really useful.
Suppose your web application needs an image about 1000 x
1000 pixels. You could warn the user if their image is too
small to look good, or so big it's a waste of their time.

So basically what I want to do is start uploading the file,
but stop quickly.

Now then, does anyone know how to do it?

Thanks again,

Paul

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] Stupid questions

2000-10-11 Thread Rik Hoekstra

Am i supposed to get "XML methods" and "Python methods" in the add product
drop down?
I'm baffled.

Not unless you add them ;-)
The XML Document (presume you meant that) and Python Methods are both
Products, that is the Zope name for components

XML Document can be downloaded from http://www.zope.org/Products/XMLDocument
Python Methods from http://www.zope.org/Members/4am/PythonMethod


PD: the subject says it all. Please don't flame me.  I think we need a
little bit more organization, some kind of comprehensive index instead of
looking for documentation in several places.

this is not a documentation question I think, but the documentation is being
worked on.

hth
Rik

--
Manuel Amador (Rudd-O)



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




[Zope] help!- version locked up site

2000-10-11 Thread sean

I cannot view my site...the version has locked it up with the following 
message (I cannot even delete the version- which is not currently open):
Error Type: VersionLockError
Error Value: ("'\\000\\000\\000\\000\\000\\002\\303\\007'", 
'h101Latest')
and the traceback:
Traceback (innermost last): File /home/kelley/Zope-2.1.6-
src/lib/python/ZPublisher/Publish.py, line 214, in publish_module File 
/home/kelley/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py, line 179, 
in publish File /home/kelley/Zope-2.1.6-src/lib/python/Zope/__init__.py, 
line 202, in zpublisher_exception_hook (Object: 
ApplicationDefaultPermissions) File /home/kelley/Zope-2.1.6-
src/lib/python/ZPublisher/Publish.py, line 169, in publish File 
/home/kelley/Zope-2.1.6-src/lib/python/ZODB/Transaction.py, line 237, 
in commit File /home/kelley/Zope-2.1.6-
src/lib/python/ZODB/Connection.py, line 327, in commit (Info: 
(('*1n1CFDve1bzI6hmDV5avDQ==', 'BannerClass'), 
'\000\000\000\000\000\002\303\007', '')) File /home/kelley/Zope-2.1.6-
src/lib/python/ZODB/FileStorage.py, line 623, in store (Object: 
/home/kelley/Zope-2.1.6-src/var/Data.fs) VersionLockError: (see 
above) 





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




[Zope] If/And statements?

2000-10-11 Thread J. Atwood

Ok.. a very simple question.

How do you do a if statement with an 'and'. If this, and that..

Was just asked of me and I had really not come up against it in Zope.

(must be Wednesday)

Thanks,
J


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




[Zope] Any limit on number of users?

2000-10-11 Thread Paul Winkler

Hi,

Has anyone run up against a limitation on the number of
users that can be in
one acl_users folder? Either a hard limit or a practical
limit? 

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




Re: [Zope] If/And statements?

2000-10-11 Thread Phil Harris

dtml-if "this==1 and that==0"


- Original Message - 
From: "J. Atwood" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 11, 2000 10:15 PM
Subject: [Zope] If/And statements?


 Ok.. a very simple question.
 
 How do you do a if statement with an 'and'. If this, and that..
 
 Was just asked of me and I had really not come up against it in Zope.
 
 (must be Wednesday)
 
 Thanks,
 J
 
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 


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




Re: [Zope] If/And statements?

2000-10-11 Thread J. Atwood

That was the stuff...

Thanks,
J

 From: Daniel Rusch [EMAIL PROTECTED]
 Date: Wed, 11 Oct 2000 16:29:52 -0500
 To: "J. Atwood" [EMAIL PROTECTED]
 Subject: Re: [Zope] If/And statements?
 
 dtml-if "a==b and c==d"
 blah
 dtml-elif "e==f"
 blah blah
 dtml-else
 blah blah blah
 /dtml-if
 
 "J. Atwood" wrote:
 
 Ok.. a very simple question.
 
 How do you do a if statement with an 'and'. If this, and that..
 
 Was just asked of me and I had really not come up against it in Zope.
 
 (must be Wednesday)
 
 Thanks,
 J
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )
 


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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread knight

Here's an idea for you. I use some of the code below in my FileBase
product to receive uploads, although, I've added some "code" I think might
help you for grabbing just the header.

Although I'm not sure if the file descriptor that infile claims from the
form has already been loaded into either a StringIO or some other
"buffer" (i.e. already received in full from client), it's possible that
this is reading directly from the http stream coming from the client.

infilename = REQUEST.form['attached_file'].filename  # Get filename
infile = REQUEST.form['attached_file'] # Get the file descriptor
myheader = infile.read(500)# Read up to 500 bytes
infile.close() # Close the stream

This should be in an external method or product.

I haven't tested whether or not this will only let the client upload the
first 500 bytes, it's very possible zope takes in the entire file, and
puts it into a buffer that is like a file descriptor (hence StringIO).

Knight
[EMAIL PROTECTED]

On Wed, 11 Oct 2000, Paul Winkler wrote:

 Another way to look at it:
 I want to start uploading the file, but stop the upload
 almost immediately - after I've got enough to read the file
 header, but long before the upload would normally finish.
 
 Chris McDonough wrote:
  
  Paul,
  
  I'm sorry if I'm dropping context here, but I'm not sure what you mean when
  you say "headers of files".
  
  Do you just want to check the size of files before you put them in the ZODB?
 
 That would be useful, but I need more information than that.
 I need to read some of the file's description of itself
 that's commonly kept in a header at the beginning of a file.
 
 For example, take a .gif or .jpeg file and throw away all
 but the first (let's say) 1 kb of the file.
 If you try to open this truncated file with an image editor
 (gimp, photoshop, whatever) you'll have problems. But useful
 information is still stored in that first part of the file,
 as we can see using python and PIL.
 Example, on linux:
 
 head --bytes 1000 foo.gif  foo_truncated.gif
 python
 ...
  import Image
  test = Image.open('foo_truncated.gif', 'r')
  test.size
 (210, 210)
 
 So in this case, we can find out that foo.gif is 210 x 210
 pixels even if we only have access to the first 1 kb of the
 12 kb file.
 
 If the file in question is 1 MB or so, this trick becomes
 really useful.
 Suppose your web application needs an image about 1000 x
 1000 pixels. You could warn the user if their image is too
 small to look good, or so big it's a waste of their time.
 
 So basically what I want to do is start uploading the file,
 but stop quickly.
 
 Now then, does anyone know how to do it?
 
 Thanks again,
 
 Paul
 
 -- 
 .paul winkler..
 slinkP arts:   music, sound, illustration, design, etc.
web page:  http://www.slinkp.com
   A member of ARMS:   http://www.reacharms.com
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 
 


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




[Zope] (no subject)

2000-10-11 Thread Robert Joseph Roos

I tried to delete a product from the Control Panel.  The particular
prodcut in question is the Demo Portal from ZopePTK, version 0.8,
which I mistakenly imported into Zope 2.1.something.

In any case, I get the following error:

  Zope Error

  Zope has encountered an error while publishing this resource. 

  Error Type: ImportError
  Error Value: No module named PropertiesTool

What exactly is going on here?  Why the heck does Zope try to 'publish'
something before deleting it anyway?

Thanks for your help, from an aspiring newbie!

=Rob==
J=
=Roos=

If I don't know I don't know, I think I know. 
If I don't know I know, I think I don't know.

R.D. Laing


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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Paul Winkler

Much thanks to Knight and to Peter Bengtsson (who replied
off-list), I know have at least two possible avenues to
explore.

If I ever get this to work, I'll post it!

-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.com

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




[Zope] dtml-let ?

2000-10-11 Thread Mark Twiddy

hi all
Sorry fro the dumb question.
Im totaling columns returned from a zsql thingy is there an easy way to do
this in dtml.

thanks
mark


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




[Zope] Need preferred 'import' format for ReportLab Image module

2000-10-11 Thread Tony McDonald

Hi all,
This is of interest to those people using the (excellent) PDF generator,

ReportLab http://www.reportlab.com/ under Zope. 

As you may know, there is an import conflict with the 'Image' module from PIL

and the built in Zope 'Image' module when using ReportLab. The snippet below

is from the main ReportLab developer, Andy Robinson.

 If it's not too much trouble, that would be very useful for 
 those of 
 us using Zope (the number is growing all the time).
 

We will try to do this.  But which import format 
does Zope require? 'import Image'
of 'import PIL.Image'?  And is this some sort of
packaged 'PIL-for-Zope'?  If it was just PIL on your
hard disk, you would have 100% control over the
problem just by adding the right directory to your
path.

Sorry, I'm working all hours and don't have time to
download and play with Zope this month.

- Andy

--

So, can anyone with a higher 'import' Zope Zen please give me a clue as to how

to reply to Andy? In my own reportlab distribution I changed;
import Image
to
from PIL import Image
and that seemed ok, but I'd like a 'definitive' answer on this from some bods

with Nirvana-level Zen

BTW, If you're not a reportlab user (open source, free download), then you're

missing out - this is terrific software...we have it connected to ZSQL methods

and are churning out PDF documents *very* quickly.

cheers,
Tone


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




Re: [Zope] date comparison

2000-10-11 Thread Kapil Thangavelu

michael angelo ruberto wrote:
 
 i want to create an index page that displays whether or not a page has been
 updated in the past 7 days or the past 20 days. however, i can't figure out
 how to get the bobobase_modification_date to compare with ZopeTime. can
 someone give me a clue before i rush blindly down Zope's undocumented dark
 alleys.
 
 mike

untested

ul
dtml-in "objectValues['DTMLDocument']"
dtml-if "ZopeTime()-7  bobo_base_modifcation_time"
libNew/bdtml-var absolute_url/li
dtml-elif "ZopeTime()-20  bobo_base_modifcation_time"
libSomewhat New/bdtml-var absolute_url/li
dtml-else
libOld/bdtml-var absolute_url/li
/dtml-if
/dtml-in
/ul

kapil

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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread Tony McDonald

Much thanks to Knight and to Peter Bengtsson (who replied
off-list), I know have at least two possible avenues to
explore.

If I ever get this to work, I'll post it!


Please do - we've got people uploading PowerPoints of up to 25-30 Megabytes

(record was an attempt at 170 Mb) and we'd like to offer a software solution

before we have to 'send the lads round'.

Cheers
Tone.


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




Re: [Zope] Re: Upload just file headers?

2000-10-11 Thread knight

Actually, I replied on list, but the phenomina of receiving your CC
before the list replicated my original reply occured. ;]

Knight
[EMAIL PROTECTED]

On Wed, 11 Oct 2000, Paul Winkler wrote:

 Much thanks to Knight and to Peter Bengtsson (who replied
 off-list), I know have at least two possible avenues to
 explore.
 
 If I ever get this to work, I'll post it!
 
 -- 
 .paul winkler..
 slinkP arts:   music, sound, illustration, design, etc.
web page:  http://www.slinkp.com
   A member of ARMS:   http://www.reacharms.com
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 
 


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




[Zope] Using ProxyPass and SiteRoot

2000-10-11 Thread Timothy Wilson

Hi everyone,

I've read the "Using Apache with ZServer (NOT Zope.cgi)" How-To and I find
that my situation is different enough from the ones described that I'm not
having any luck setting it up. I'd appreciate any suggestions on the
following:

My current Zope site is at http://www.isd197.k12.mn.us/ which uses
Zope.cgi. There are a number of other static, non-Zope virtual hosts running
on that same machine representing a number of our elementary schools.

I've been developing a new Zope site on a separate machine at
http://206.131.108.103:8080/ using just ZServer and I would like to use
ProxyPass to pass a request for www.isd197.k12.mn.us through to this new
site.

Can someone suggest ProxyPass and SiteRoot settings that will make this
work?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




Re: [Zope] Using ProxyPass and SiteRoot

2000-10-11 Thread knight

 Hi everyone,
 
 I've read the "Using Apache with ZServer (NOT Zope.cgi)" How-To and I find
 that my situation is different enough from the ones described that I'm not
 having any luck setting it up. I'd appreciate any suggestions on the
 following:
 
 My current Zope site is at http://www.isd197.k12.mn.us/ which uses
 Zope.cgi. There are a number of other static, non-Zope virtual hosts running
 on that same machine representing a number of our elementary schools.
 
 I've been developing a new Zope site on a separate machine at
 http://206.131.108.103:8080/ using just ZServer and I would like to use
 ProxyPass to pass a request for www.isd197.k12.mn.us through to this new
 site.
 
 Can someone suggest ProxyPass and SiteRoot settings that will make this
 work?
 
 -Tim

Timothy,

Without going into too much detail, you are going to want to set up a
virtual host in apache for the hostname www.isd197.k12.mn.us, and inside
that virtual host you will want to add your ProxyPass lines similar to my
example:

VirtualHost 63.193.78.22
 ServerAdmin [EMAIL PROTECTED]
 DocumentRoot /home/knight/www/phunc/html
 ServerName www.phunc.com
 ErrorLog /home/knight/www/phunc/logs/error_log
 CustomLog /home/knight/www/phunc/logs/access_log combined
 ScriptAlias /cgi-bin/ "/home/knight/www/cgi-bin/"

IfModule mod_rewrite.c
 RewriteEngine On
 RewriteLog "/home/knight/www/phunc/logs/rewrite_log"
 RewriteLogLevel 2
 RewriteRule ^/cgi-bin/ - [L]
 RewriteRule ^/local/(.*) http://www.phunc.com/$1 [L]
 RewriteRule ^/(.*) http://www.phunc.com:8080/$1 [P]
 ProxyVia on
/IfModule

/VirtualHost

Where I've used Rewrite, you will want to replace it with your ProxyPass
lines. Keep in mind that _any_ requests for www.isd197.k12.mn.us will get
passed to your zope site, and you will need to add "local" entries for
directories you want to stay on the apache system for that FQDN.

For the other non-Zope virtual hosts, just have them set up the same way
they are most likely.

Knight
[EMAIL PROTECTED]


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




[Zope] How to use standard html headers and footers properly (was: Re: [Zope]Namespace problems...)Namespace problems...)

2000-10-11 Thread Manuel Amador (Rudd-O)


dtml-with pub>
 dtml-let titel="_.string.join(['This is the website
of ',
enterpriseName])">
 dtml-var standard_html_header>
 /dtml-let>
on your document, WILLwork fine.
But I suggest recreating standard_html_header as a METHODand calling
dtml-with pub>
dtml-var standard..>
/dtml-with>
Since methods don't have properties, they will use calling object's
properties. Read again. Do NOTuse DTMLdocuments
for headers and footers. Use METHODS.
Lars Heber wrote:
Hi there,
I've still got to build a bigger website.
So I stored my headers and footers and many other things in root/pub.
All the other documents are stored in root/Intra and below.
I've got my standard_html_header, with which I can display user-defined
titles which may also contain values of global properties. The
user-defined title is being built in the document before the header
is
called, e. g. something like:
dtml-with pub>
 dtml-let titel="_.string.join(['This is the website
of ',
enterpriseName])">
 dtml-var standard_html_header>
 /dtml-let>
In the standard_html_header method I'm checking whether there is a titel
attribute or not.
This works fine.
But for general use I want to keep the possibility of displaying the
title_or_id of the document when I don't introduce a user-defined title.
This would be no problem if s_h_h wasn't situated in root/pub, so I
have
to call it within the dtml-with pub>.
But doing this, pub is on the top of my namespace, so that calling
title_or_id returns the title_or_id of the container of s_h_h, i. e.
pub!
How can I nevertheless access within the s_h_h to the title_or_id of
my
original document?
Thanks.
Lars
___
Zope maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev
)

--
Manuel Amador (Rudd-O)



[Zope] SybaseDA and ASA

2000-10-11 Thread Manuel Amador (Rudd-O)


Hey everyone,
first, let me thank you for all the help you've provided. Every
reply was fast, efficient and right to the point.
Second:
I've installed zope 2.2.2, and compiled sy_occ.so for SybaseDAagainst
sybase-common-cantrememberversion.rpm from Sybase. (I assume it's
the latest one). Loading python and importing sy_occ works perfectly.
BUT, I can't create a SybaseDA SQLconnection object . Specifically,
trying to create it sez connection failed. I've tried EVERYPOSSIBLE
parameter combination on the creation form. None worked.
By the way, I'm using Adaptive Server Anywhere for linux, 6.0.3.
It is NOTASE. It is ASA.
Does sy_occ work with ASA, or only with ASE? Any experiences?
--
Manuel Amador (Rudd-O)