[Zope-dev] Re: [ZODB-Dev] ZODB 3.2 release plan posted

2002-11-05 Thread Christian Reis
On Tue, Nov 05, 2002 at 02:04:35PM -0500, Jeremy Hylton wrote:
> I have posted a tenative release plan for ZODB 3.2 in the ZODB Wiki at
> http://www.zope.org/Wikis/ZODB/ZODB%203.2%20Release
> 
> There are a small set of proposed features centering around better
> configuration and management of ZEO and ZODB.

I'm happy to see SecureZEO listed, and me and Johan can put up some good
time to work on this for 3.2. Do we have a plan on what needs to be
done, or should we draw one up? 

The main issues I can see are: offering plaintext versus a CHAP-like
implementation, and how to store the passwords on the server-side.
Anybody see anything else that needs catering?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL

___
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] Using Zope from a console script

2002-11-05 Thread Gilles Lenfant
> >
> > Leonardo,
> >
> > Thanks for that fast answer.
> >
> > But it's buggy for me (Zope 2.5.1/Python 2.1.3/FreeBSD) :
> >
> > bash-2.05a$ python ZServer/medusa/monitor_client.py localhost 8099
> > /usr/local/lib/python2.1/regsub.py:15: DeprecationWarning: the regsub
module
> > is deprecated; please use re.sub()
> >   DeprecationWarning)
> > Enter Password:
> > Traceback (most recent call last):
> >   File "ZServer/medusa/monitor_client.py", line 114, in ?
> > stdin = stdin_channel (0)
> >   File "/usr/src/Zope-2.5.1-src/ZServer/medusa/asyncore.py", line 551,
in
> > __init__
> > flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
> > AttributeError: 'fcntl' module has no attribute 'F_GETFL'
> >
> > Do you think I should record this in the collector or did I miss
something ?
>
> It's probably not your fault. Not many people use the monitor port, and
> it's possible it's been broken by recent zope versions. By the looks of
> the error message, it doesn't look like it should be difficult to fix. A
> Collector issue might be in order.

I'm not a fcntl guru bu I didn't see any "fcntl.F_GETFL" in the doc of
Python 2.1.3. Probably a really deprecated stuff. But I'm not capable of
fixing this correctly by myself.
It will go to the Collector tomorrow (if not already recorded)

>
> > > You can also use ZEO and do your debugging in a separate Zope (ZEO
> > > Client) instance.
> > > http://www.zope.org/Products/ZEO
> >
> > But just want to run a console application, not running it from another
Zope
> > instance.
>
> A Zope instance that is a ZEO client sees the same objects as other Zope
> instances. For all intents and purposes, it is as if you're talking to a
> single Zope instance. Since you described that you could use Zope from
> python console if you didn't start it, using a ZEO instance the same way
> looks like it's exactly what you need. You might not understand what I'm
> talking about until you try and install ZEO for yourself
>
> Cheers, Leo

The fact is that my script works when Zope server is down and crashes when
it is up (Data.fs doesn't seem to be usable concurrently by two different
processes)
I didn't get exactly what's ZEO. I'm gonna dive into this.

Many thanks again

--Gilles




___
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] Using Zope from a console script

2002-11-05 Thread Gilles Lenfant
- Original Message -
From: "Jerome Alet" <[EMAIL PROTECTED]>
To: "Gilles Lenfant" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 10:21 PM
Subject: Re: [Zope-dev] Using Zope from a console script


> On Tue, Nov 05, 2002 at 10:25:23PM +0100, Gilles Lenfant wrote:
> >
> > That's the way I started to do the stuff but this requires too many Zope
> > side xmlrpc handlers I should not need if accessing directly to the Zope
> > objects.
>
> 
>
> Did you try to manipulate your ZODB with ZShell ?
>
> You can also do it in a limited way through xml-rpc with the help
> of Andy McKay's ZShellCLI, but ZShell commands can manipulate
> several (**many**) objects at a time, so the slowdown would be
> minimal.
>
> depending on what you want to achieve this may be useful.
>
> get it from http://www.librelogiciel.com/software/
>
> upcoming versions of ZShellScripts will provide easier xml-rpc
> access to ZShell functionnalities.
>
> 
>
> hth
>
> 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 )
>
>

Bonjour Jérôme.

ZShell is great but this is not really suited to what I'm doing.
The console script (that works perfectly when the server is down) indexes in
a ZCatalog a big amount of "fake" objects that are not stored in the ZODB.
This is an (almost successful) attempt to use a ZCatalog for a search engine
that targets non Zope documents repositories.

* Word docs in a samba FS
* Other (non Zope) sites
* ...

I just try to have it working when the Zope server is up because the script
may work some dozen of minutes (fetching visible text of web pages,
transforming word docs to plain text...) in real (production) situation.

Cheers

--Gilles




___
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] Non Bloating Page Counter

2002-11-05 Thread Casey Duncan
A solution that I've employed in the past is to keep the counters in RAM 
(perhaps in a dict stored as a module global keyed by object path) and write 
the values that have changed persistently every 5-10 minutes.

The drawback to this is that you can loose some counts if the server goes 
down, plus the count won't be accurate across ZEO app servers sharing the 
same storage (but they'll be close). I generally deal with this by reading 
the commited values rather than the volatile ones.

-Casey

On Tuesday 05 November 2002 03:55 pm, Brian R Brinegar wrote:
> Hello,
> 
> We've had requests from several of our users for the ability to have a
> drop in page counter within zope. However creating a page counter python
> script which increments some value in zope will bloat the ZODB.
> 
> Solutions exist where values are stored on the file system or in a
> database. Unfortunately our users don't have file system access and it is
> unacceptable to expect them to request a database account and setup
> database connections and methods just to create a page counter.
> 
> I would like to create a Page Counter product that doesn't bloat. If a
> product is created that doesn't subclass History or UndoSupport does it
> still bloat?
> 
> Zope is transactional, but products like ZLDAPConnection have the ability
> to be "non-transactional" what does this mean? Could I use this in my
> counter?
> 
> -Brian

___
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] Non Bloating Page Counter

2002-11-05 Thread Jens Vagelpohl
I would like to create a Page Counter product that doesn't bloat. If a
product is created that doesn't subclass History or UndoSupport does it
still bloat?


those have nothing to do with the fact that every time that hit counter 
fires some object will get updated and thus saved again.


Zope is transactional, but products like ZLDAPConnection have the 
ability
to be "non-transactional" what does this mean? Could I use this in my
counter?

the meaning of transactional as employed by the ZLDAPConnection has 
nothing to do with your concern about ZODB bloat. the ZLDAPConnection 
tried (it never got successfully finished) to hook into the ZODB 
transaction machinery to make sure writes to LDAP only happen if the 
whole transaction was indeed successful.

i personally don't see a way to completely avoid ZODB bloat with a 
counter product stored in the ZODB itself. IMHO it is inherently bad to 
use ZODB-based hit counters in general for that very reason.

jens


___
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] Using Zope from a console script

2002-11-05 Thread Martijn Pieters
On Tue, Nov 05, 2002 at 09:46:03PM +0100, Gilles Lenfant wrote:
> > You can also use ZEO and do your debugging in a separate Zope (ZEO
> > Client) instance.
> > http://www.zope.org/Products/ZEO
> 
> But just want to run a console application, not running it from another Zope
> instance.

ZEO gives you a connection to the ZODB, sharing it with any Zope instances.
ZEO makes database access distributed, and thus is *exactly* what you want.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@;zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
-

___
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] Using Zope from a console script

2002-11-05 Thread Leonardo Rochael Almeida
On Tue, 2002-11-05 at 18:46, Gilles Lenfant wrote:
> - Original Message -
> From: "Leonardo Rochael Almeida" <[EMAIL PROTECTED]>
> 
> > On Tue, 2002-11-05 at 17:27, Gilles Lenfant wrote:
> > > I tried (successfully) to play with Zope objects with console scripts
> using
> > > the hints in $ZOPEROOT/doc/ZODB.txt
> > > Unfortunately, it works only if the Zope server is down.
> > > I need to run this script on a running server, and I'd prefer not using
> > > xmlrpc stuffs for a better efficiency.
> > >
> > > Any hint, config, examples ?
> >
> > You can use the monitor port, see z2.py help and
> > http://www.zope.org/Documentation/Misc/DEBUGGING.txt
> >
> 
> Leonardo,
> 
> Thanks for that fast answer.
> 
> But it's buggy for me (Zope 2.5.1/Python 2.1.3/FreeBSD) :
> 
> bash-2.05a$ python ZServer/medusa/monitor_client.py localhost 8099
> /usr/local/lib/python2.1/regsub.py:15: DeprecationWarning: the regsub module
> is deprecated; please use re.sub()
>   DeprecationWarning)
> Enter Password:
> Traceback (most recent call last):
>   File "ZServer/medusa/monitor_client.py", line 114, in ?
> stdin = stdin_channel (0)
>   File "/usr/src/Zope-2.5.1-src/ZServer/medusa/asyncore.py", line 551, in
> __init__
> flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
> AttributeError: 'fcntl' module has no attribute 'F_GETFL'
> 
> Do you think I should record this in the collector or did I miss something ?

It's probably not your fault. Not many people use the monitor port, and
it's possible it's been broken by recent zope versions. By the looks of
the error message, it doesn't look like it should be difficult to fix. A
Collector issue might be in order.

> > You can also use ZEO and do your debugging in a separate Zope (ZEO
> > Client) instance.
> > http://www.zope.org/Products/ZEO
> 
> But just want to run a console application, not running it from another Zope
> instance.

A Zope instance that is a ZEO client sees the same objects as other Zope
instances. For all intents and purposes, it is as if you're talking to a
single Zope instance. Since you described that you could use Zope from
python console if you didn't start it, using a ZEO instance the same way
looks like it's exactly what you need. You might not understand what I'm
talking about until you try and install ZEO for yourself

Cheers, Leo

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.


___
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] Using Zope from a console script

2002-11-05 Thread Jerome Alet
On Tue, Nov 05, 2002 at 10:25:23PM +0100, Gilles Lenfant wrote:
> 
> That's the way I started to do the stuff but this requires too many Zope
> side xmlrpc handlers I should not need if accessing directly to the Zope
> objects.



Did you try to manipulate your ZODB with ZShell ?

You can also do it in a limited way through xml-rpc with the help
of Andy McKay's ZShellCLI, but ZShell commands can manipulate 
several (**many**) objects at a time, so the slowdown would be
minimal.

depending on what you want to achieve this may be useful.

get it from http://www.librelogiciel.com/software/

upcoming versions of ZShellScripts will provide easier xml-rpc
access to ZShell functionnalities.



hth

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 )



Re: [Zope-dev] Using Zope from a console script

2002-11-05 Thread Gilles Lenfant
- Original Message -
From: "Jerome Alet" <[EMAIL PROTECTED]>
To: "Gilles Lenfant" <[EMAIL PROTECTED]>
Cc: "Leonardo Rochael Almeida" <[EMAIL PROTECTED]>; "Zope Developers list"
<[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 9:40 PM
Subject: Re: [Zope-dev] Using Zope from a console script


> On Tue, Nov 05, 2002 at 09:46:03PM +0100, Gilles Lenfant wrote:
> >
> > But just want to run a console application, not running it from another
Zope
> > instance.
>
> xml-rpc should be the way to go.

Yes,

That's the way I started to do the stuff but this requires too many Zope
side xmlrpc handlers I should not need if accessing directly to the Zope
objects.
In addition, running through xmlrpc slows down dramatically the stuff.
xmlrpc is the good solution when you need few transactions with the server,
that is not my case where I use lots of arbitrary methods on objects.

Please don't cross-post this problem to a PHP/MySQL mailing list, they would
laught out loudly :)

Cheers

--Gilles




___
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] Non Bloating Page Counter

2002-11-05 Thread Brian R Brinegar
Hello,

We've had requests from several of our users for the ability to have a
drop in page counter within zope. However creating a page counter python
script which increments some value in zope will bloat the ZODB.

Solutions exist where values are stored on the file system or in a
database. Unfortunately our users don't have file system access and it is
unacceptable to expect them to request a database account and setup
database connections and methods just to create a page counter.

I would like to create a Page Counter product that doesn't bloat. If a
product is created that doesn't subclass History or UndoSupport does it
still bloat?

Zope is transactional, but products like ZLDAPConnection have the ability
to be "non-transactional" what does this mean? Could I use this in my
counter?

-Brian


___
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 overflowerror "long int too large to convert"

2002-11-05 Thread Dieter Maurer
Tobias Herp writes:
 > we have a Zope-based (v2.5.0) editorial system running on a server of our
 > customer's; it uses a ZUserFolder to store eMail addresses of the top-level
 > users. Last week, an error turned up whenever the system tried to
 > automatically send a notification eMail, which said:
 > 
 > Error Type: OverflowError
 > Error Value: long int too large to convert
 > ...
 > (Object: /opt/zope/var/Data.fs)
 >   File /data/opt/Zope-2.5.0-linux2-x86/lib/python/ZODB/FileStorage.py, line
 > 1902, in _loadBack
Look at line 1902 in "FileStorage.py".

  There, something tries to convert a long int, but its value is too large.


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] Using Zope from a console script

2002-11-05 Thread Jerome Alet
On Tue, Nov 05, 2002 at 09:46:03PM +0100, Gilles Lenfant wrote:
> 
> But just want to run a console application, not running it from another Zope
> instance.

xml-rpc should be the way to go.

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 )



Re: [Zope-dev] Using Zope from a console script

2002-11-05 Thread Gilles Lenfant
- Original Message -
From: "Leonardo Rochael Almeida" <[EMAIL PROTECTED]>
To: "Gilles Lenfant" <[EMAIL PROTECTED]>
Cc: "Zope Developers list" <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 8:34 PM
Subject: Re: [Zope-dev] Using Zope from a console script


> On Tue, 2002-11-05 at 17:27, Gilles Lenfant wrote:
> > I tried (successfully) to play with Zope objects with console scripts
using
> > the hints in $ZOPEROOT/doc/ZODB.txt
> > Unfortunately, it works only if the Zope server is down.
> > I need to run this script on a running server, and I'd prefer not using
> > xmlrpc stuffs for a better efficiency.
> >
> > Any hint, config, examples ?
>
> You can use the monitor port, see z2.py help and
> http://www.zope.org/Documentation/Misc/DEBUGGING.txt
>

Leonardo,

Thanks for that fast answer.

But it's buggy for me (Zope 2.5.1/Python 2.1.3/FreeBSD) :

bash-2.05a$ python ZServer/medusa/monitor_client.py localhost 8099
/usr/local/lib/python2.1/regsub.py:15: DeprecationWarning: the regsub module
is deprecated; please use re.sub()
  DeprecationWarning)
Enter Password:
Traceback (most recent call last):
  File "ZServer/medusa/monitor_client.py", line 114, in ?
stdin = stdin_channel (0)
  File "/usr/src/Zope-2.5.1-src/ZServer/medusa/asyncore.py", line 551, in
__init__
flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
AttributeError: 'fcntl' module has no attribute 'F_GETFL'

Do you think I should record this in the collector or did I miss something ?

> You can also use ZEO and do your debugging in a separate Zope (ZEO
> Client) instance.
> http://www.zope.org/Products/ZEO

But just want to run a console application, not running it from another Zope
instance.

Cheers

--Gilles




___
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: Antwort: [Zope-dev] strange overflowerror "long int too large to convert"

2002-11-05 Thread Dieter Maurer
Tobias Herp writes:
 > >> By the way, You could try:
 > >>  utilities/ZODBTools/fstest.py
 > >> to check, if Your ZODB is corrupted for some reason.
 > 
 > The result of this command was:
 > 
 > 2380190 object serialno 0x0343a7a27062f819 does not matchtransaction id
 > 0x0343aee3616a8c22
 > 
 > But what to do now with this info? §:-|
Maybe, you clean your "Data.fs" up with "fsrecover" (in the ZODB folder).


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] Using restricted code from within a python product

2002-11-05 Thread Jerome Alet
On Tue, Nov 05, 2002 at 12:19:06PM -0600, Brent Hendricks wrote:
> I have a method in a python Product that I'd like to have run as 
> restricted code.  Is there an easy way to do this?  I was hoping for a 
> PythonScriptFile() along the lines of PageTemplateFile(), but such a 
> thing doesn't seem to exist.

Why not use PythonScripts ?

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 )



Re: [Zope-dev] Using Zope from a console script

2002-11-05 Thread Leonardo Rochael Almeida
On Tue, 2002-11-05 at 17:27, Gilles Lenfant wrote:
> I tried (successfully) to play with Zope objects with console scripts using
> the hints in $ZOPEROOT/doc/ZODB.txt
> Unfortunately, it works only if the Zope server is down.
> I need to run this script on a running server, and I'd prefer not using
> xmlrpc stuffs for a better efficiency.
> 
> Any hint, config, examples ?

You can use the monitor port, see z2.py help and
http://www.zope.org/Documentation/Misc/DEBUGGING.txt

You can also use ZEO and do your debugging in a separate Zope (ZEO
Client) instance.
http://www.zope.org/Products/ZEO

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.


___
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] Using Zope from a console script

2002-11-05 Thread Gilles Lenfant
I tried (successfully) to play with Zope objects with console scripts using
the hints in $ZOPEROOT/doc/ZODB.txt
Unfortunately, it works only if the Zope server is down.
I need to run this script on a running server, and I'd prefer not using
xmlrpc stuffs for a better efficiency.

Any hint, config, examples ?

Thanks in advance

--Gilles




___
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 3.2 release plan posted

2002-11-05 Thread Jeremy Hylton
I have posted a tenative release plan for ZODB 3.2 in the ZODB Wiki at
http://www.zope.org/Wikis/ZODB/ZODB%203.2%20Release

There are a small set of proposed features centering around better
configuration and management of ZEO and ZODB.

Feedback is welcome.

Jeremy



___
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] Getting Zope root object without object context.

2002-11-05 Thread Gilles Lenfant
Hi,

I know I can get the root object using self.getPhysicalRoot()
But I'm in a situation where I can't get that "self" or any other Zope
object.

Any hint ?

Thanks in advance.

--Gilles





___
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] Using restricted code from within a python product

2002-11-05 Thread Brent Hendricks
I have a method in a python Product that I'd like to have run as 
restricted code.  Is there an easy way to do this?  I was hoping for a 
PythonScriptFile() along the lines of PageTemplateFile(), but such a 
thing doesn't seem to exist.

Thanks
-- Brent

-

"The programmer, like the poet, works only slightly removed from pure
 thought-stuff.  He builds his castles in the air, from air, creating
 by exertion of the imagination.  Few media of creation are so
 flexible, so easy to polish and rework, so readily capable of
 realizing grand conceptual structures."
-- Frederick Brooks, Jr., The Mythical Man Month


___
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] Unicode Support in 2.6 -- background infos?

2002-11-05 Thread Florent Guillaume
Toby Dickenson  <[EMAIL PROTECTED]> wrote:
> Yes, its a PITA that the changes to the book were not available at the
> same time as the software.
>
> This bug report is for a problem which is different to yours, but the
> comments will probably answer your questions too.
> 
> http://collector.zope.org/Zope/633
> 
> > I know that I can force Unicode mode by having some unicode string on the
> > page. But can I also do the reverse?
> 
> Yes, by explicity encoding the unicode objects into the character encoding 
> that you want. If dtml only sees plain string objects then it behaves the 
> same as in all earlier versions of Zope.

Which is hardly helful for the end-user... I mean, the point of having
computers is to simplify things...

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@;nuxeo.com

___
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] Re: bug in mapply.py?

2002-11-05 Thread Evan Simpson
Tim Hicks wrote:

Given a call signature like:

def method(self, *args, **kw)

In this way, mapply.py seems to ignore the fact that I want my method to
accept an arbitrary number of arguments (line 69).


When mapply was written, its only purpose was to map explicit method 
parameters to request variables.  There was no concept of RPC of any 
kind, so neither '*args' nor '**kwargs' had any kind of sensible 
interpretation.

So, yes, mapply does ignore what you want :-)

Unfortunately, given the way that XML-RPC and WebDAV have been piled on 
top of the initial implementation, I'm not sure how this could be fixed 
properly in Zope 2.x.

Sorry,

Evan @ 4-am


___
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] bug in mapply.py?

2002-11-05 Thread Tim Hicks
Thanks for the reply Steve,

Steve Alexander said:
>
>> I must admit to not understanding why this should only break over
>> xmlrpc and not directly from Zope.  The problem appears to be that my
>> method is defined something like:
>>
>> def method(self, *args, **kw)
>
> mapply doesn't put things into **kw arguments of methods.

Yeah, that's what I understood to be the case.  However, coming in over
xmlrpc, I don't have any keyword arguments - I say that because that's
explicitly what I'm doing, but I'm not sure xmlrpc handles keyword args
anyway.  The **kw is just there for easier use when the method is called
directly from zope.

> I wanted this once for a product in Zope 3, looked deeply into mapply,
> and talked to Jim Fulton about it.
>
> IIRC, Jim said that mapply shouldn't put things into **kw arguments
> because it isn't at all explicit, and would end up implicitly putting in
>  a whole bunch of things that you generally wouldn't want in a lot of
> cases.
>
>
> Can you make up a simple python module to demonstrate your case, just
> using a method, and mapply?

I guess I could try, but I'm not convinced this is my problem at the moment.

> It may be that there's a way to achieve what you want, while still
> keeping things reasonably explicit.

>From what I can tell, the problem seems to be at line 58 (mapply.py):

names=c.co_varnames[1:c.co_argcount]

Given a call signature like:

def method(self, *args, **kw)

c.co_argcount == 1
c.co_varnames == ('self', 'args', 'kw')

Now, 'names' (the variable) becomes only 'self' (the string) on line 58. 
In this way, mapply.py seems to ignore the fact that I want my method to
accept an arbitrary number of arguments (line 69).

I don't know if there's a good reason for this, or whether I'm doing
things wrong.  I also don't know why this only crops up over xmlrpc, as I
presume mapply.py is used (in some way) from within zope as well.

Any ideas?

tim



___
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] bug in mapply.py?

2002-11-05 Thread Steve Alexander


I must admit to not understanding why this should only break over
xmlrpc and not directly from Zope.  The problem appears to be that my
method is defined something like:

def method(self, *args, **kw)


mapply doesn't put things into **kw arguments of methods.

I wanted this once for a product in Zope 3, looked deeply into mapply, 
and talked to Jim Fulton about it.

IIRC, Jim said that mapply shouldn't put things into **kw arguments 
because it isn't at all explicit, and would end up implicitly putting in 
a whole bunch of things that you generally wouldn't want in a lot of cases.


Can you make up a simple python module to demonstrate your case, just 
using a method, and mapply?

It may be that there's a way to achieve what you want, while still 
keeping things reasonably explicit.

--
Steve Alexander



___
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] bug in mapply.py?

2002-11-05 Thread Tim Hicks
Hi all,

I've been trying to track down the problem outlined here *:
http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/B9323F6D666D3D5C

I got a traceback (see below), that indicates that the problem occurs when
mapply.py inspects my method.

I must admit to not understanding why this should only break over xmlrpc
and not directly from Zope.  The problem appears to be that my method is
defined something like:

def method(self, *args, **kw)

As far as I can tell, this means that co_argcount is 1, which makes
'names' == [self,].  Passing in positional arguments to the method then
fails as len(positional) > len(names).  (All this is taken from around
line 54 of mapply.py)

Well, that seems to be why my code fails.  Can anyone tell me either what
I'm doing wrong or tell me I've found a bug.  The latter seems pretty
unlikely I would think - I'm assuming this code has been around and
working for quite a while now.

cheers,

tim

'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 150,
in publish_module\nresponse = publish(request, module_name,
after_list, debug=debug)',
'File "D:\\Zlave\\zope251\\lib\\python\\Products\\Localizer\\__init__.py",
line 65, in new_publish\nmapply)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 114,
in publish\nsys.exc_info()[2],',
'File "D:\\Zlave\\zope251\\lib\\python\\Zope\\__init__.py", line 159, in
zpublisher_exception_hook\nf(client, REQUEST, t, v, traceback)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 98,
in publish\nrequest, bind=1)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\mapply.py", line 69,
in mapply\nif len(positional) > nargs: raise TypeError, \'too many
arguments\'

* One final unrelated point.  I was only able to get this far by hacking
at ZPublisher/xmlrpc.py so that def exception(self...) appended the
'server-side' traceback to the faultString that is returned to the client.
 This seems like a *very* useful feature.  Any chance of this getting
implemented?



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



Antwort: [Zope-dev] strange overflowerror "long int too large to convert"

2002-11-05 Thread Tobias Herp

Hi, Clemens,

thanks for answering.

>> By the way, You could try:
>>  utilities/ZODBTools/fstest.py
>> to check, if Your ZODB is corrupted for some reason.

The result of this command was:

2380190 object serialno 0x0343a7a27062f819 does not matchtransaction id
0x0343aee3616a8c22

But what to do now with this info? §:-|

Cheers,

Tobias
--



___
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 overflowerror "long int too large to convert"

2002-11-05 Thread Chris Withers
Tobias Herp wrote:

Hi,

we have a Zope-based (v2.5.0) editorial system running on a server of our
customer's; it uses a ZUserFolder to store eMail addresses of the top-level
users. Last week, an error turned up whenever the system tried to
automatically send a notification eMail, which said:

Error Type: OverflowError
Error Value: long int too large to convert


This reminds me of a thread taking place on [EMAIL PROTECTED] right now, maybe 
join there having read the archives?

cheers,

Chris - http://lists.zope.org/pipermail/zodb-dev/2002-November/003511.html


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