Re: [Zope-dev] TALES idea: tuple unpacking

2003-07-23 Thread Gilles Lenfant
Yes, this would be more comfortable, some of my templates would be cleaner
with this feature.
You may work this around like this...

stuff tal:define=packed python: someScript(stuff, foo, bar);
 item1 python: packed[0];
 item2 python: packed[1]

with someScript ending with...

return foo, bar

I'm interrested into adding some other wishes for the next ZPT versions.
Where could those wishes be posted  ?

Cheers

--Gilles



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


[Zope-dev] TALES wish : the thistemplate variable

2003-07-23 Thread Gilles Lenfant
What's behind this ?

Actually, we get the template variable available in the TALES namespace.
template, when used in a macro, refers to the template that uses the
macro, and not to the template that contains the macro.

The future (if you wish it with me) thistemplate variable will refer to
the template that contains it, whatever that template is being refered or
executed.

Example of use : nested macros in a widgets collection template

metal:widget metal:define-macro=basicwidget
...
/metal:widget
...
metal:widget metal:define-macro=extendedwidget
...
 metal:inner metal:use-macro=thistemplate/macros/basicwidget
/metal:widget
...
/metal:widget

Actually, if you need nested macros in the same template, you need to refer
that nested macro with...

...metal:use-macro=here/thistemplateid/macros/basicwiget

1/ using directly thistemplate is more legible and maintainable.

2/ you can rename more safely the templates.

3/ you can put and use attributes in templates that contains only macros.

4/ accessing thistemplate would not involve the acquisition machinery to
find inner resource. Thus provide the invoked resource (other macro) much
faster.

Any comment ?

Cheers

--Gilles



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


[Zope-dev] Documenting products with epydoc

2003-03-27 Thread Gilles Lenfant
Hi,

I use to document my (non Zope) python packages using epydoc that's (IMHO)
the best python documentation tool (javadoc like great features).

http://epydoc.sourceforge.net/

Unfortunately, this does not work with Zope products (usual pydoc doesn't
too).

How can I make a fixure to get it working ? Did any of you succeed
documenting Zope products with epydoc ?

Thanks in advance

--Gilles



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


Re: [Zope-dev] Documenting products with epydoc

2003-03-27 Thread Gilles Lenfant
- Original Message -
From: Encolpe DEGOUTE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 4:57 PM
Subject: Re: [Zope-dev] Documenting products with epydoc


On Thu, 27 Mar 2003 16:40:49 +0100
Gilles Lenfant [EMAIL PROTECTED] wrote:

 Hi,

 I use to document my (non Zope) python packages using epydoc that's
 (IMHO) the best python documentation tool (javadoc like great
 features).

 http://epydoc.sourceforge.net/

 Unfortunately, this does not work with Zope products (usual pydoc
 doesn't too).

 How can I make a fixure to get it working ? Did any of you succeed
 documenting Zope products with epydoc ?

I Use HappyDoc, and i have patch it.
I wait for the maintener apply the pacth in the cvs.
Amelioration: Dia, DocBook output.

Does HappyDoc import the packages/modules it builds the doc ?
In that case, can you please describe briefly the fix you made to make it
work with Zope products ?
Is it something similar to the fixure for unittests ?

Thanks in advance

--Gilles



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


[Zope-dev] zope

2003-02-16 Thread Gilles Lenfant
Hi,

I'm pretty familiar with the usual unittest package I use successfully with
my non-Zope python projects, but I haven't get enough enlightenment for
playing unit tests on my Zope products.

* The tips from the Zope developer guide don't work (did I miss something ?)
* I did'nt understand how to use testrunner.py and framework.py
* I tried desperately to use the ZopeTestCase with no success

Is there somewhere a hello world product using a ZopeTestCase test suite
to help me to get the enlightenment ?

Thanks in advance.

--Gilles




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



Re: [Zope-dev] Making private documents viewable by members in CMF

2003-02-06 Thread Gilles Lenfant
(Untested but should work)

Make your own workflow with DCWorkflow (search and install that CMF extra
product)
DC Workflow comes with a pre-built workflow that acts like the CMF default
workflow
Edit the private state of the workflow in the permissions tab.
Grant the View permission to Members.
Associate this workflow to the appropriate content types.

HTH

--Gilles Lenfant

- Original Message -
From: David Cain [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 7:53 PM
Subject: [Zope-dev] Making private documents viewable by members in CMF


| CMF comes with a default workflow with three states: private, pending,
| and published. When an object is in the private state, only the user who
| created it and site managers can view and change it.
|
| How do I change the roles or security to allow Members to view each
| others private documents without making them managers?
|
| David Cain
| Senior Web Developer, Information Systems Department
| Syracuse University Library
| Syracuse, New York 13244-2010
| (315) 443-5923
| mailto:[EMAIL PROTECTED]
| mailto:[EMAIL PROTECTED]
|
|
| ___
| Zope-Dev maillist  -  [EMAIL PROTECTED]
| http://mail.zope.org/mailman/listinfo/zope-dev
| **  No cross posts or HTML encoding!  **
| (Related lists -
|  http://mail.zope.org/mailman/listinfo/zope-announce
|  http://mail.zope.org/mailman/listinfo/zope )
|
|



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



[Zope-dev] XMLRPC client and Zope 2.6.0

2003-01-24 Thread Gilles Lenfant
Hi,

Is there something wrong with XML-RPC client and Zope 2.6.0 ?
Things that worked perfectly with Zope 2.5.1 don't work any more !

Even when I make a hello world Python script handler like
## Script (Python) xtest
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
return 'Hello world'

And from a console :

$ cd /zope/root/lib/python (using xmlrpclib provided with Zope 2.6.0)

 from xmlrpclib import Server
 s = Server('http://localhost')
 s.xtest()
Traceback (most recent call last):
  File stdin, line 1, in ?
  File /usr/home/zope/Zope-2.6.0-src/lib/python/xmlrpclib.py, line 829, in
__call__
return self.__send(self.__name, args)
  File /usr/home/zope/Zope-2.6.0-src/lib/python/xmlrpclib.py, line 983, in
__request
verbose=self.__verbose
  File /usr/home/zope/Zope-2.6.0-src/lib/python/xmlrpclib.py, line 861, in
request
return self.parse_response(h.getfile())
  File /usr/home/zope/Zope-2.6.0-src/lib/python/xmlrpclib.py, line 904, in
parse_response
return u.close()
  File /usr/home/zope/Zope-2.6.0-src/lib/python/xmlrpclib.py, line 579, in
close
raise apply(Fault, (), self._stack[0])
xmlrpclib.Fault: Fault -2: 'Unexpected Zope error value: \nTraceback (most
recent call last):\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/ZPublisher/Publish.py, line 150,
in publish_module\nresponse = publish(request, module_name, after_list,
debug=debug)\n  File
/usr/home/zope/Zope-2.6.0-src/Products/Localizer/__init__.py, line 58, in
new_publish\nx = Publish.old_publish(request, module_name, after_list,
debug)\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/ZPublisher/Publish.py, line 114,
in publish\nsys.exc_info()[2],\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/ZPublisher/Publish.py, line 89,
in publish\nobject=request.traverse(path,
validated_hook=validated_hook)\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/ZPublisher/BaseRequest.py, line
299, in traverse\n
subobject=object.__bobo_traverse__(request,entry_name)\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/OFS/Application.py, line 106, in
__bobo_traverse__\ntry: REQUEST.RESPONSE.notFoundError(%s\\n%s %
(name, method))\n  File
/usr/home/zope/Zope-2.6.0-src/lib/python/ZPublisher/HTTPResponse.py, line
606, in notFoundError\nSorry, the requested resource does not exist.
+\nNotFound:  \n \n\n \n \n \n\n \n   Site Error \n   An error was
encountered while publishing this resource.\n   \nResource not found
\n\n  Sorry, the requested resource does not exist. Check the URL and try
again.   Resource:  RPC2\nPOST \n   \n\n   Troubleshooting Suggestions \n\n
\n   The URL may be incorrect. \n   The parameters passed to this resource
may be incorrect. \n   A resource that this resource relies on may be\n
encountering an error. \n   \n\n   For more detailed information about the
error, please\n  refer to the HTML source for this page.\n   \n\n   If the
error persists please contact the site maintainer.\n  Thank you for your
patience.\n   \n  \n \n'

(sorry for this long traceback...)

Did I miss something ?

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



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: [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.

 shamelessplug mode=again_and_again

 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.

 /shamelessplug

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



[Zope-dev] Calling a Python script from a

2002-08-02 Thread Gilles Lenfant

Hi,

I'm searching a way to execute a ZODB untrusted python script with parameters and 
appropriate bindings (context, container...) from a file system Zope product.
Where can I find some 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] Removing the acquisition wrapper from an object (Python script)

2002-08-01 Thread Gilles Lenfant

Hi,

aq_base(someObject) doesn't work in a python script. I need to get an object without 
its acquisition wrapper.

Any hint ?

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



Re: [Zope-dev] Removing the acquisition wrapper from an object (Python script)

2002-08-01 Thread Gilles Lenfant

- Original Message - 
From: Toby Dickenson [EMAIL PROTECTED]
To: Gilles Lenfant [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 1:46 PM
Subject: Re: [Zope-dev] Removing the acquisition wrapper from an object (Python script)


On Thursday 01 Aug 2002 12:49 pm, Gilles Lenfant wrote:
 Hi,

 aq_base(someObject) doesn't work in a python script. I need to get an
 object without its acquisition wrapper.

 It cant be done in untrusted code, because it would let you strip away its 
 security settings.

 You could write an external method, or similar trusted code.

Thanks Toby

I can't understand that reason because it's also easy to strip away an object's 
security settings in an untrusted python script that has a Manager proxy.
Well, I'm gonna make my 2 or 3 lines External method :(

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] Removing the acquisition wrapper from an object (Python script)

2002-08-01 Thread Gilles Lenfant

- Original Message - 
From: Toby Dickenson [EMAIL PROTECTED]
To: Gilles Lenfant [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 3:51 PM
Subject: Re: [Zope-dev] Removing the acquisition wrapper from an object (Python script)


On Thursday 01 Aug 2002 2:44 pm, Gilles Lenfant wrote:

 I can't understand that reason because it's also easy to strip away an
 object's security settings in an untrusted python script that has a Manager
 proxy. Well, I'm gonna make my 2 or 3 lines External method :(

If thats true, its a bug. a serious one too. Please file an example in the 
collector

Toby,

It's definitively *NOT* a bug but a feature that's completely documented.
Most Zope objects inherit of RoleManager class. This class has (among others) this 
method :

manage_permission(self, permission_to_manage, roles=[], acquire=0, REQUEST=None)

Just use this method in an untrusted python script on any Zope object, add to it 
Manager proxy, and you're done.

--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] Removing the acquisition wrapper from an object (Python script)

2002-08-01 Thread Gilles Lenfant

- Original Message - 
From: Chris Withers [EMAIL PROTECTED]
To: Gilles Lenfant [EMAIL PROTECTED]
Cc: Toby Dickenson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 6:18 PM
Subject: Re: [Zope-dev] Removing the acquisition wrapper from an object (Python script)


 Gilles Lenfant wrote:
  manage_permission(self, permission_to_manage, roles=[], acquire=0, REQUEST=None)
  
  Just use this method in an untrusted python script on any Zope object, add to it 
Manager proxy, and you're done.
 
 That method just tweaks the permissions settings. It certainly doesn't let you 
 strip off the acquisition wrappers (and hence security settings).
 
 Please give examples :-)
 
 cheers,
 
 Chris
 

Chris,

There's some misunderstanding:

I was formerly looking for a way to get rid of the acquisition wraper of an object 
from an untrusted python script.
Toby Dickenson replied me that aq_base (as opposite to aq_parent) is not part of the 
acquisition utilities available from an untrusted python script because it enables to 
tweak the object's security settings.
I replied there are ways to tweak permission settings of an object from a python 
script with a Manager proxy. I didn't say in any way that it's possible to remove the 
acquisition wrapper of an object with obj.manage_permission(...) of course :))
That's all !
Now I'm always looking for an alternate way to get rid of the acquisition wrapper and 
access only the objects own props.

TIA

--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] Removing the acquisition wrapper from an object(Python script)

2002-08-01 Thread Gilles Lenfant


- Original Message - 
From: Leonardo Rochael Almeida [EMAIL PROTECTED]
To: Zope Developers list [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 11:37 PM
Subject: Re: [Zope-dev] Removing the acquisition wrapper from an object(Python script)


 On Thu, 2002-08-01 at 14:38, Gilles Lenfant wrote:
  [...]
  Now I'm always looking for an alternate way to get rid of the acquisition wrapper 
and access only the objects own props.
 
 To access an object's own props (and get an error if it doesn't find
 them instead of looking up the aq-chain) you don't need to remove it's
 acquisition wrappers, you just need to tell him not to use acquisition
 implicitly. The way you do that is to ask the object for a
 non-implicit-acquisition version of itself, that is, an explicit
 acquisition object:
 
 non_implicit_obj = obj.aq_explicit
 
 obj.some_attr
 
 or just:
 
 obj.aq_explicit.some_attr
 

Leo,

Many thanks, exactly what I needed !

I didn't find much doc about these aq_xxx methods/functions. Where can I find this ?

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] Uploading an object's content via FTP

2002-07-05 Thread Gilles Lenfant

Hi,

I made a CMF portal_type class based on python product.
This contains a Photoshop file and some dedicated related services.
Users may upload Photoshop files via HTTP.
This works with small files but when a user uploads a big file (8 Mb and more) through 
HTTP, this stalls the server.

So I need to provide the user an alternate way to upload the object's content with an 
FTP client.

Where should I start to get this working ? Examples somewhere ?

How can I programmatically know the port number for Zope FTP ?

How can I catch FTP upload complete event ?

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] Zope developer guide (up to Zope 2.3.3)

2002-05-28 Thread Gilles Lenfant

Hi,

It seems that the Zope developer guide at http://www.zope.org/Documentation/ZDG is 
suited for Zope 2.4.x +.
I need the one that's suited to Zope 2.3.3 and did not find it.

Any clue ?

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 )



Re: [Zope-dev] Zope-2.3.3 Python 2.1.3 ? possible or mission impossible

2002-04-25 Thread Gilles Lenfant

Hi,

It worked perfectly for me. I just got a couple of deprecation warnings when starting 
zope (should use re and not - unmaintained - regexp module).
As far as I can follow the traceback, the BTree problem is off topic for your issue.
I suspect you did not install Python 2.1.3 from source, or you did a python 2.1.3 
binary install without the python-dev kit.
It seems that error is raised because the proper Makefile.pre.in has not been found.

HTH

--Gilles

- Original Message - 
From: Dirk Datzert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 9:57 AM
Subject: [Zope-dev] Zope-2.3.3  Python 2.1.3 ? possible or mission impossible


Hi all,

I currently need to build Zope-2.3.3. yeah this is not the latest stable one.
I have to build it with Python 2.1.3.

Is this possible ?

I got and traceback on 'python wo_pcgi.py'

Traceback (most recent call last):
  File /usr/src/packages/BUILD/Zope-2.3.3-src/w_pcgi.py, line 111, in ?
if __name__=='__main__': main(sys.argv[0])
  File /usr/src/packages/BUILD/Zope-2.3.3-src/w_pcgi.py, line 109, in main
import wo_pcgi; wo_pcgi.main(me)
  File /usr/src/packages/BUILD/Zope-2.3.3-src/wo_pcgi.py, line 104, in main
import build_extensions
  File /usr/src/packages/BUILD/Zope-2.3.3-src/inst/build_extensions.py, line 105
, in ?
make('lib','python','BTrees')
  File /usr/src/packages/BUILD/Zope-2.3.3-src/inst/do.py, line 134, in make
do('make -f Makefile.pre.in boot PYTHON=%s' % sys.executable)
  File /usr/src/packages/BUILD/Zope-2.3.3-src/inst/do.py, line 104, in do
if i and picky: raise SystemError, i
SystemError: 512

I read sometimes something about broken BTrees. Is this my problem ?

Thanks,
Dirk





___
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] problem adding ZClass instances via DTML

2002-02-26 Thread Gilles Lenfant

Mark,

It seems you forget the id of your new object !!
I use do do it in Python script (easier for testing initial data from request). But 
you can translate in DTML if you prefer...
# Test initial data from REQUEST and redirect somewhere if required
...
# Create the new ZClass based object
newobject = 
somefolderishobject.manage_addProduct['MyProduct'].MyZClass.createInObjectManager(newId,
 context.REQUEST)
# May add computed values to properties
props = {}
props['created'] = DateTime()
props['creator'] = context.REQUEST.AUTHENTICATED_USER.getUserName()
...
newobject.propertysheets.mypropertysheet.manage_changeProperties(props)
# Redirect somewhere or return the object or whatever

HTH

--Gilles
- Original Message - 
From: Mark James Adams [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 26, 2002 8:25 PM
Subject: [Zope-dev] problem adding ZClass instances via DTML


: I'm following the instructions in Adding ZClass Instances 
: Programmatically (http://www.zope.org/Members/taz/addZClasses), but 
: Zope always returns an error.
: 
: Using the code from a DTMLMethod in another ZClass in the same product:
: 
: dtml-with manage_addProduct['MyProduct']
: dtml-call MyZClass_add(_.None, NoRedir=1)
: /dtml-with
: 
: I get the error:
: 
: File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 339, 
: in eval (Object: MyZClass.createInObjectManager(REQUEST['id'], REQUEST)) 
: (Info: REQUEST) File , line 0, in ? NameError: MyZClass
: 
: So this is clearly having a problem finding MyZClass from the 
: MyZClass_add method.
: 
: I then noticed that, according to the HowTo, if you are instantiating a 
: ZClass from within another ZClass, you only need the code:
: 
: dtml-call MyZClass_add(_.None, NoRedir=1)
: 
: However, this gives the error:
: 
: File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 339, 
: in eval (Object: MyZClass_add(_.None, NoRedir=1)) (Info: _) File , line 
: 0, in ? NameError: MyZClass_add
: 
: Any suggestions?
: 
: Thanks.
: 
: --
: Mark James Adams
: [EMAIL PROTECTED] | [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 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] Re: Zope vs. Cocoon

2002-02-25 Thread Gilles Lenfant

I agree,

I've been lookin for a Zope site design guidelines like chapter in Zope site when I 
was a newbie but did not find consistent and comprehensive information.
You can only find various Howto in that matter.
Please correct me if I'm wrong.
So I made some spaghetti sites in my first 2 months of Zope practice before knowing 
how to place the best objects at the best place.

--Gilles

- Original Message - 
From: seb bacon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 25, 2002 2:18 PM
Subject: Re: [Zope-dev] Re: Zope vs. Cocoon

...

: 
: What Zope lacks IMO is good best practice guidance and detailed
: developer documentation, though it's getting there now.  Without best
: practice guidance, developers tend to choose the first development model
: they see, which at the moment tends towards heaps of quick-and-dirty
: through the web hacks and tricks.  This does give the illusion of Zope
: being an 'environment' rather than a 'framework', and encourages
: Zopish-looking sites, too.




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