[Zope-dev] The future of ZPatterns and LoginManager

2002-03-10 Thread Johan Carlsson [Torped]

Hi everybody,
(I did ask this question to the ZPatterns list, but without any answer. So 
I hope one better luck here.)

I finally got the opportunity to use ZPatterns in a project
and am quite please with the result (after the mandatory wrestling :)
Anyway, I would like to use both ZPatterns again, as well as LoginManager,
but I feel somewhat of a doubt what they will be around in the future and 
in Zope 3.
So, are they?
Or what I really want to know, is it safe to base my applications on ZP 
and/or LM or is it
something I'm going to regret?
Best Regards,
Johan Carlsson




torped strategi och kommunikation ab
johan carlsson
[EMAIL PROTECTED]
birkagatan 9
113 36 stockholm
västmannagatan 67
http://www.torped.se
http://easypublisher.torped.se


___
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] RFC : AnyScripts

2002-03-10 Thread Adrian Hungate

This sounds like a security acident waiting to happen. I wouldn't want to be
the one to have to ensure there were no security holes in the surrounding
code that might allow the script to get rewritten.

Adrian...

--
The difficulty of tactical maneuvering consists in turning the devious into
the direct, and misfortune into gain.
- Sun Tzu


- Original Message -
From: "Jerome Alet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 08, 2002 7:27 PM
Subject: [Zope-dev] RFC : AnyScripts


> Hi,
>
> I'm finally toying, after having stalled a too long time,
> with the creation of ZShellScripts, which would be for ZShell
> commands what PythonScripts are for Python...
>
> The current, not yet available, incarnation is very highly
> based on PythonScripts, however I wondered if something
> better couldn't be done, because it seems to me to be an
> unneeded repetition of most of the PythonScripts' code :
>
> AnyScripts
>
> AnyScripts would have a mandatory first line similar to the one
> of any Unix shell script. By unix shell script I mean any script
> which can be launched directly under Unix, not only bash or csh scripts,
> but also perl, tcl, etc...
>
> So an AnyScript would contain a first line like :
>
> #! /scripts/interpreter
>
> And the execution of this script in the context on which it
> is applied would be delegated to another object present in
> the path which was set on this very first line, i.e.
> /scripts/interpreter
>
> So you could put any interpreter object of your choice in
> for example the /scripts folder (no path would mean
> search the interpreter object within the acquisition path)
>
> For example PythonScripts would contain something like :
>
> #! /builtins/python
>
> or something like that.
>
> Out of my mind I can already think of a ZShell interpreter
> object, but why not other types of interpreter objects :
>
> perl
> tcl
> C (the language ! Why not after all)
> etc...
>
>
> Each interpreter object would have at least two methods :
>
> compile() => returns a code object from source code, if meaningful
>  (otherwise returns the source unchanged), to be
>  stored in the AnyScript object which calls the
>  compile() method.
>
> execute() => executes the above code object. This method of the
>  Interpreter object would be called by the AnyScript
>  object at run time, passing it the code object
>  obtained with compile()
>
> Of course all of this come straight out of my mind, and there would
> probably be some problems I'm not able to understand yet...
>
> Bound variables would be like for PythonScripts, with the exception of
their
> content would be the best format for the Interpreter in question, so
> each Interpreter object would probably also have a bind() method which
> would bind vars in the preferred format for the AnyScript object which
> calls this method, and would be accessible using the
> preferred syntax of the langage in question, e.g. :
>
> for PythonScripts, vars like context would be Zope Objects, like they
> currently are.
>
> for ZShell AnyScripts, vars like context, would be paths to Zope
> Objects, and accessible with names like $context for example.
>
> for C AnyScripts, vars would probably be something like PyObjects
> pointers.
>
> etc...
>
> So AnyScripts objects would interact with their interpreter object of
> choice to compile their source code, bind their vars, then finally
> execute the code and get the result back.
>
> What do you all think about this idea ?
>
> Are any of you interested ?
>
> I admit I don't know anything about the feasability of such a project
> with other languages than ZShell, however if a single implementation
> could be done, then anyone could add his own interpreter later...
>
> PS : I'll do ZShellScripts anyway...
>
> bye,
>
> Jerome Alet
>
>
>
>
>
> ___
> 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 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] Error removing NT Service

2002-03-10 Thread Adrian Hungate

Two points about deleting services (Well one really, just looked at from two
angles):
1) Services must have fully stopped before you delete them, or they get
marked for deletion on the next reboot (Good, solid server software:
expecting frequent reboots!)
2) The service must have had all the SCM handles closed otherwise the same
happens

What is probably happening is that the SCM handle from the service shutdown
has been deleted, but python or something still has a reference to it that
has not been garbage collected yet.

Just a guess. Without seeing your code, it's hard to know for certain.

Adrian...

--
The difficulty of tactical maneuvering consists in turning the devious into
the direct, and misfortune into gain.
- Sun Tzu


- Original Message -
From: "Dean@work (E-mail)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 08, 2002 2:39 PM
Subject: [Zope-dev] Error removing NT Service


> Hi
>
> I have an application built with Zope which can install, control and
remove
> NT services. The actual code is in an external python script.  The
services
> can be installed and controlled but if you try and remove the service it
get
> marked as 'disabled' and can not be reinstalled or remove manually
(without
> using the registry).  However if Zope is restarted the service is then
> removed.
>
> Does anyone have any ideas about resolving this problem ??
>
> thanks in advance
>
> Dean Houghton
>
>
>
>
>
> ___
> 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 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] Unauthorized users can writelock helpfiles in /Control_Panel/Products

2002-03-10 Thread Chris McDonough

> Chris McDonough writes:
>  > ... HelpSystem problems ...
>  > It then proceeds to do writes to the database when it 
>  > appears that all you're doing is reading a
> pre-existing page.
> What does it write to the database?
> I do not see a reason for this behaviour...

I don't know.  IMHO, there is no reason that the contents of
the help system need to live in the ZODB at all.  Can you
think of any good reason other than searching? :-(

- C

___
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] Unauthorized users can writelock helpfiles in /Control_Panel/Products

2002-03-10 Thread Dieter Maurer

Chris McDonough writes:
 > ... HelpSystem problems ...
 > It then proceeds to do writes to the database when it 
 > appears that all you're doing is reading a pre-existing page.
What does it write to the database?
I do not see a reason for this behaviour...


Dieter

___
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] ZODB thread safety issue.

2002-03-10 Thread Dieter Maurer

Romain Slootmaekers writes:
 > Is there a way we can share the access to the objects, or do we have to
 > create a global lock ? And if we have to create a global lock, what's the
 > desired/standard approach in doing so.
You may have a look at "SharedResource" at

  



Dieter

___
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] Usage of try: .. except: .. in zope

2002-03-10 Thread Dieter Maurer

Ivo van der Wijk writes:
 > ...
 > It this Exception-type-less
 > try/except construct used elsewhere in Zope (I think I've seen it before)? 
Yes, unfortunately.
 > Should I put a request in the collector? 
Yes, please.


Dieter

___
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: SV: [Zope-dev] Small Alert - Temp Solution - more...

2002-03-10 Thread Jean-Paul Smets

Le Samedi 9 Mars 2002 23:04, Dieter Maurer a écrit :
> Jean-Paul Smets writes:
>  > ... TCPWatch dumps demonstrating cookie problem for "__ac" cookie ...
>
> When I read the dumps correct then *ALL* Apache + "__ac" dumps
> lack the "__ac" cookie whether or nor VHM is used.
> Thus, I would say, VHM is out of suspicion.


I agree.

> Now, Apache + Zope via "mod_proxy" is Zope via Medusa.
> I do not expect Zope to behave differently when Apache is there.
> As Zope (+ medusa) alone has the "__ac" cookie, this may indicate
> an Apache problem.
> You can verify that by using TCPWatch between Apache und Zope
> (rather than between your browser and Apache).
>

OK. I'll test this.


>
>
> Dieter
>
> ___
> 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 )

-- 
Jean-Paul Smets-Solanes <[EMAIL PROTECTED]> - Nexedi (CEO)
GPG Fingerprint: 40FF FA78 75AA 680D 8BB4  EEF9 539A 79CC CB8E 5F01 

___
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] Usage of try: .. except: .. in zope

2002-03-10 Thread Ivo van der Wijk

Hi All,

I'm currently implementing a QuotaFolder for Zope, i.e. a Folder 
that restricts the number of objects, their sizes and their total
size (and in the future: the installabe meta types).

Things look very promising (if anyone feels like testing, please mail
me), but it took me quite a while to fix one bug:

When creating a ZopeTutorial in a QuotaFolder, I always got

Error Type: Bad Request
Error Value: The id "examples" is invalid--it is already in use.

I couldn't really figure out why my QuotaFolder would cause ZopeTutorial
to be installed (or actually imported) twice. Until I studied its code:

In addTutorial in TutorialTopic.py, there's the following piece of
importing code:

# work around old Zope bug in importing
try:
folder.manage_importObject(tutorialExamplesFile)
except:
folder._p_jar=self.Destination()._p_jar
folder.manage_importObject(tutorialExamplesFile)
 
Basically, anything can go wrong in the first manage_importObject (and
in my case it was the raising of a QuotaExceeded exception), causing
the code to try to import the file *again*

Isn't there a better/cleaner way to do this? It this Exception-type-less
try/except construct used elsewhere in Zope (I think I've seen it before)? 
Should I put a request in the collector? 

Cheers,

Ivo

-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL   -=-
Tel: +31-20-4688336   Linux/Web/Zope/SQL/MMBase
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [EMAIL PROTECTED]   -=-

___
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] ZODB thread safety issue.

2002-03-10 Thread Romain Slootmaekers

Yo,
I read on the doc's :
"""
A key feature of Zope 2 (ZODB 3) is that (a copy of) a persistent object
is never accessed by more than one thread (unless the programmer goes way
out of thier way). Each thread uses it's own database connection(s). Each
connection has it's own copies of persistent objects. This feature
provides a major simplification for application developers.
"""

This explains the problems we have with our system:
we have a multithreaded system where each thread iteratese over a set of
objects in the ZODB, and sees of something needs to be done... if so the
thread does it. Now since each thread gets its own version of the object.
our actions occur multiple times... 


This is not the desired behaviour.
Is there a way we can share the access to the objects, or do we have to
create a global lock ? And if we have to create a global lock, what's the
desired/standard approach in doing so.

TIA,

Sloot.





___
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 )