[Zope] Re: dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Okay, I figured it out.

- Silly Lee


___
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] dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Thanks, Steve. This'll do nicely ;-) BUT...

For some strange reason the following doesn't work in my Python *method*:

dict = {}
dict["Lee"] = 1

Error:

 Error Type: Python Method Error
 Error Value: Forbidden operation STORE_SUBSCR at line 3! <<-- ?

Which seems very strange. No matter what I try and store I get the same error.

dic = {'two': 2, 'three': 3}
return dic['two']

The above works fine but when I try and add to it I get the same error. If this is a
simple mistake I'm making then I plead stupidity!!! Can someone tell me how to do
this in my python method? I've tested all my code in IDLE and it works fine - why not
in Zope?

Answers on a postcard to the usual address!

Thanks very much, guys.

- Best regards,

Lee

Steve Spicklemire wrote:

> Hi Lee,
>
>You could use a dictionary for this:
>
> vars = {}
>
> while (p!=0):
> vars['p'+`p`] = string.replace(component[control], ",", "")
> p=p-1
> control=control+1
>
> then 'vars' will contain keys (e.g., 'p1', 'p2' etc.. ) and corresponding values.
>
> If that's totally not what you want.. a little more context would help.
>
> ;-)
>
> -steve





___
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] Source to www.zope.org

2001-01-21 Thread Gerald Gutierrez



>At the bottom of the page there's a link called "View Source" which will
>give you the original DTML. You can tack 'view_source' onto the end of any
>www.zope.org URL to see how it was built.

Hi Tim. Yes, I've looked at those sources, but unfortunately, they don't 
provide some of the backend stuff that's not exposed through the browser. 
I'm more interested in those areas. jatwood mentioned www.zope.org/About, 
which is indeed very cool and describes the architecture for www.zope.org, 
but again it doesn't go into the backend code.

I thought that it would be very useful to see how this "demonstrative" web 
site does things.


Gerald.


___
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] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Steve Spicklemire


Hi Lee,

   You could use a dictionary for this:

vars = {}

while (p!=0):
vars['p'+`p`] = string.replace(component[control], ",", "") 
p=p-1
control=control+1

then 'vars' will contain keys (e.g., 'p1', 'p2' etc.. ) and corresponding values.

If that's totally not what you want.. a little more context would help. 

;-)

-steve

--

Hi there,

I'm creating variables in python but I am having trouble creating them
when they're *named* using other variables. Here's an example;

while (p!=0):
p+`p`= string.replace(component[control], ",", "") 
# e.g. I want 'p1 = string.replace.blah...'
p=p-1
control=control+1

==> SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks,

Lee (crossing his fingers)


___
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] Adding to an XMLDocument through web forms

2001-01-21 Thread J. Cameron Cooper

> I`m looking for a way to give a user the ability to add new data to an
> XMLDocument through web forms, does anyone have experience of this or would
> be able to point me in the direction of an example or howto?

I tried to do this before, and it never worked, so I'm probably not of all
that much help, but...

take a look at the Zope Quick Reference, which has the API for XMLDocument.
You should be able to find the methods that add nodes to it. (Presumably the
regular old object methods would work too, but I can't verify that.) If you've
already done that and still don't have it working (like me), perhaps knocking
about the XMLDocument code would help. Last resort, contact the XMLDocument
maintainer: certainly there are test cases for this somewhere if it's
possible.

--jcc
--
"Hwaet! We Gar-Dena   in gear-dagum,
theod-cyninga,   thyrm gefrunon,
hu tha aethelingas   ellen fremedon!"
http://jccooper.brown.rice.edu/



___
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 and PHP - possible or not ?

2001-01-21 Thread J. Atwood

A lot came up with you just put 'PHP' in the Zope.org search box. 
Here are the best.

http://www.zope.org/Members/Mamey/PHP

http://www.zope.org/Members/Ioan/PHPObject

J



At 7:18 PM +0100 1/21/01, Greg Nowak wrote:
>Hi!
>
>How do I combine the PHP code with ZOPE ?
>
>How to tell Apache to parse the PHP code ?
>Where do I find info ?
>
>Best regards,
>Greg
>
>
>
>--
>BEZPLATNE konto e-mail o adresie [EMAIL PROTECTED] i NIELIMITOWANEJ pojemnosci
>Tylko w POLAND.COM ! www.poland.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 )




Re: [Zope] Source to www.zope.org

2001-01-21 Thread J. Atwood

Also check out the About Zope.org link on the home page.

http://www.zope.org/About

There is a lot of good stuff there!

J

At 4:39 PM -0800 1/21/01, Gerald Gutierrez wrote:
>Is the source code to www.zope.org available somewhere?
>
>It would certainly be an interesting example of how to build a large 
>web site with Zope.
>
>
>___
>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] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Lee

Hi there,

I'm creating variables in python but I am having trouble creating them
when they're *named* using other variables. Here's an example;

while (p!=0):
p+`p`= string.replace(component[control], ",", "") 
# e.g. I want 'p1 = string.replace.blah...'
p=p-1
control=control+1

==> SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks,

Lee (crossing his fingers)


___
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] Source to www.zope.org

2001-01-21 Thread Timothy Wilson

On Sun, 21 Jan 2001, Gerald Gutierrez wrote:

> Is the source code to www.zope.org available somewhere?

At the bottom of the page there's a link called "View Source" which will
give you the original DTML. You can tack 'view_source' onto the end of any
www.zope.org URL to see how it was built.

You're right. It's very handy.

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




[Zope] Login Form / User Registration Code Snippets

2001-01-21 Thread Gerald Gutierrez


I remember that someone, somewhere, has a document with code snippets to do 
authentication and registration of users through forms, much like how 
www.zope.org does it. Does anyone know where this is?

Thanks


___
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] Source to www.zope.org

2001-01-21 Thread Gerald Gutierrez


Is the source code to www.zope.org available somewhere?

It would certainly be an interesting example of how to build a large web 
site with Zope.


___
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: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson


> No reason except that I have an install script for python, zope, and modules
> (including configuration) for both that I "know" form a stable environment on
> our production servers, whether linux, or freeBSD.  I should try the ports
> distribution and run my unit tests to perhaps build a more likely to be
> stable freeBSD installer for our work.

That would be a good idea. Try that and let me know if your tests
work. People go to alot of trouble to make a port. It makes little sense
to re-invent the wheel especially with ports. If your tests fail let me
know where and how and I will see about getting the maintainer of the
offending port to ensure it works with your tests and application.

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable & Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


___
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] LoginManager disrupts access to protected object above it

2001-01-21 Thread Itai Tavor

Hi,

This problem started with failure to access Control_Panel, which I 
thought was due to a SiteAccess problem... but I now tracked it to a 
problem with an instance of LoginManager.

I have the following setup:

Zope 2.3.0b2
ZPatterns 0.4.3b2
LoginManager 0.8.8b1

Zope/
 test1 (PythonScript) requires Manager to view
 folder/
 test2 (PythonScript) Manager proxy role
 acl_users (LoginManager)

test1:
 return 'spam'

test2:
 return container.test1

Calling test2 results in the traceback attached below. If I remove 
acl_users, test2 works. The LoginManager is a bit tricky, as it uses 
a virtual UserSource loading user objects from an external 
Specialist, but it seems to work in every other way. I have no idea 
if this problem is due to a bug in my LoginManager implementation or 
a general LoginManager bug.

Can anyone explain this or suggest a way to find out what is going wrong?

TIA


   AttributeError

   test1

Traceback (innermost last):
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 222, in publish_module
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 187, in publish
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/Zope/__init__.py, line 
221, in zpublisher_exception_hook
 (Object: Traversable)
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 171, in publish
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
 (Object: test2)
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, 
line 325, in __call__
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, 
line 354, in _bindAndExec
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/PythonScript.py, 
line 330, in _exec
 (Object: test2)
 (Info: ({'script': , 'context': 
, 'container': , 'traverse_subpath': []}, (), {}, None))
   File Script (Python), line 2, in test2
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/Guarded.py, 
line 273, in __getattr__
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/Guarded.py, 
line 143, in __careful_getattr__
 (Object: Traversable)
AttributeError: (see above)
-- 
Itai Tavor"Je sautille, donc je suis."
C3Works[EMAIL PROTECTED]  - Kermit the Frog

"If you haven't got your health, you haven't got anything"


___
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: patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

On Mon, 22 Jan 2001, Chris Watson wrote:
> > Sorry, to be more explicit :
> > I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
> > stable release of Zope also gave the same error.
> > 
> > I did not use the ports distribution of python or zope, so I don't know if
> > the same default configure script is used by them too.
> > 
> > Is that what you wanted to know?
> 
> 
>   Yes. That answers what I wanted to know. Is there a specific
> reason you didnt want to use the ports? Since the ports work just fine im
> assuming there is. I would like to know if its because the ports are
> lacking a feature you need so they can be fixed? If not why not just
> use the ports?
>


No reason except that I have an install script for python, zope, and modules
(including configuration) for both that I "know" form a stable environment on
our production servers, whether linux, or freeBSD.  I should try the ports
distribution and run my unit tests to perhaps build a more likely to be
stable freeBSD installer for our work.

Matt


   
> --
> =
> -Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
> Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
> Home:  [EMAIL PROTECTED] | http://open-systems.net
> =
> WINDOWS: "Where do you want to go today?"
> LINUX: "Where do you want to go tomorrow?"
> BSD: "Are you guys coming or what?"
> =
> GNU = Gnu's Non-portable & Unstable
> irc.openprojects.net #FreeBSD -Join the revolution!
> ICQ: 20016186

___
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: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson

> Sorry, to be more explicit :
> I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
> stable release of Zope also gave the same error.
> 
> I did not use the ports distribution of python or zope, so I don't know if
> the same default configure script is used by them too.
> 
> Is that what you wanted to know?


Yes. That answers what I wanted to know. Is there a specific
reason you didnt want to use the ports? Since the ports work just fine im
assuming there is. I would like to know if its because the ports are
lacking a feature you need so they can be fixed? If not why not just
use the ports?

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable & Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


___
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: patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

On Mon, 22 Jan 2001, Chris Watson wrote:
> > Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
> > Zope.  If you are trying to do the same and tun into the following error when
> > trying to start zope, then apply this patch to the configure script of python
> > and rebuild it.
> > 
> > ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"
> 
> Matt,
> 
>   Is this an error in the port itself of python? Python 2.0 is in
> ports as well as zope. If there is a problem with either port can you give
> more detail so the apropriate maintainer can be notified. Thanks! 


Sorry, to be more explicit :
I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
stable release of Zope also gave the same error.

I did not use the ports distribution of python or zope, so I don't know if
the same default configure script is used by them too.

Is that what you wanted to know?

Matt



> 
> --
> =
> -Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
> Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
> Home:  [EMAIL PROTECTED] | http://open-systems.net
> =
> WINDOWS: "Where do you want to go today?"
> LINUX: "Where do you want to go tomorrow?"
> BSD: "Are you guys coming or what?"
> =
> GNU = Gnu's Non-portable & Unstable
> irc.openprojects.net #FreeBSD -Join the revolution!
> ICQ: 20016186
-- 

___
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: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson

> Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
> Zope.  If you are trying to do the same and tun into the following error when
> trying to start zope, then apply this patch to the configure script of python
> and rebuild it.
> 
> ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"

Matt,

Is this an error in the port itself of python? Python 2.0 is in
ports as well as zope. If there is a problem with either port can you give
more detail so the apropriate maintainer can be notified. Thanks!   

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable & Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


___
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] ZSQL Methods in ZClasses...

2001-01-21 Thread Curtis Maloney


Green things,

Am I missing something, or should I just simply not be using ZSQL methods in 
my ZClass?  If I try to add one, I get an error about there not being a DB 
connection object (which makes sense) and won't let me add the object.

I was planning on making the constructor find all available DB connections, 
and make the user select one.

Have a better one,
Curtis Maloney

___
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] Object DB versus Relational DB

2001-01-21 Thread Tom Deprez

Hi,

Can somebody provide me informational links of documents which present the
benefits and non-benefits of both DB? eg. When to use one and when not to
use one?

Thanks,
Tom.


___
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] patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
Zope.  If you are trying to do the same and tun into the following error when
trying to start zope, then apply this patch to the configure script of python
and rebuild it.

ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"

have fun
Matt

2249c2249
<   FreeBSD*/4*) LDSHARED="gcc -shared";;
---
>   FreeBSD*/3*) LDSHARED="gcc -shared";;
2295c2295
<   FreeBSD/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
---
>   FreeBSD/3*) LINKFORSHARED="-Xlinker -export-dynamic";;



[Zope] TCPWatch... and closing sockets..

2001-01-21 Thread Steve Spicklemire


I'm going to try to make a long story short... and the story isn't even
over... but I'm getting close. One of our clients is a 'multimedia'
company and we're working with a group there that consists mostly
of artists and designers who use tools like photoshop and 
macromedia director. They came to us recently with a project
for which they were *going* to use Macromedia Multiuser Server
but the complexity of their application is significant.. 

long story short... I've sold them on the concept of using Zope as the
'media/personality server' for this application.  They will use
Director (which can post stuff to an URL and can also parse
XML). So.. I'm building a framework that permits them to use their
favorite tools, but I get to use *my* favorite tool too. ;-) The
problem: Director is not a browser. There is no 'view source'. But (I
think to myself) this is a great chance to use tcpwatch, which I've
never used before. It's a little tricky since my favorite client
machine is a Macintosh, and well.. lets just say that Tkinter for the
mac is not perfect... not to mention there is no thread module..  but
I do have a workaround that's useful (since I run Zope on a FreeBSD
server, I just use tcpwatch on FreeBSD and either MI/X, or VirtualPC
with Linux for my X server.. ). I noticed however that when I did a
'POST' the URL encoded arguments were lost. I found that the
proxy_receiver handle_close method was never called.. so that anything
in a 'last line' that didn't end in '\n' was lost. I added the
following patch that shows this... but why is handle_close not called?
I can only guess that the socket is not being properly closed
somehow. I use lib/python/ZPublisher/Client.py to test calls to Zope
and it works fine, but the asyncore/asynchat stuff never calls
handle_close for proxy_receiver.

Anyway... here's the patch: Comments welcome!

*** ./tcpwatch_orig.py Sat Jan 20 16:55:43 2001
--- ./tcpwatch.py   Sun Jan 21 16:52:11 2001
***
*** 130,135 
--- 130,137 
  pos = pos + 1
  else:
  # Last line, may be incomplete.
+ line = "Partial line? " + data[oldpos:] + '\r\n'
+ self.watch_output(line, byClient)
  return data[oldpos:]
  
  def cleanupRefs(self):

take care,
-steve

___
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: Index out of range

2001-01-21 Thread Tim Cook

Tim Cook wrote:
> 
> Tim Cook wrote:
> >
> > Error Type: IndexError
> > Error Value: list index out of range
> >

Well, DUH me. I forgot the last two lines of the text file (it's
a dump from a database sent to me from someone else). One only
had the number of rows and the other an EOF.

Sorry to waste your bandwidth. 
My external method now checks the length of the list before
putting it intothe dictionary. :-)


-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

___
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] Bug "Export Product and inheritance" (2). Any more description about XML export format?

2001-01-21 Thread Thierry Nabeth

Hello,

I am still struggling to find a way to solve the bug (even manualy)
relate to exporting a package in which a class inherits from a class
of another package.

Do you have any more details about the Import XML format ?
I want to see if I can edit manually this file in order to solve
the fact that I lost inheritance from one class to another class
that is defined in another package.




For instance in the file
.../OFS/XMLExportImport.py

we have:

def save_record(parser, tag, data):
file=parser.file
write=file.write
pos=file.tell()
file.seek(pos)
a=data[1]
if a.has_key('id'): oid=a['id']
oid=ppml.p64(string.atoi(oid))
v=''
for x in data[2:]:
v=v+x
l=ppml.p64(len(v))
v=oid+l+v
return v

def importXML(jar, file, clue=''):
import Shared.DC.xml.pyexpat.pyexpat
pyexpat=Shared.DC.xml.pyexpat.pyexpat
if type(file) is StringType:
file=open(file)
outfile=TemporaryFile()
data=file.read()
F=ppml.xmlPickler()
F.end_handlers['record'] = save_record
F.end_handlers['ZopeData'] = save_zopedata
F.start_handlers['ZopeData'] = start_zopedata
F.binary=1
F.file=outfile
p=pyexpat.ParserCreate()
p.CharacterDataHandler=F.handle_data
p.StartElementHandler=F.unknown_starttag
p.EndElementHandler=F.unknown_endtag
r=p.Parse(data)
outfile.seek(0)
return jar.importFile(outfile,clue)


Would it be possible to have a couple of lines of comments ?

Thank you


Thierry Nabeth
INSEAD CALT
http://www.insead.edu/CALT/



Note:
This BUG makes almost impossible all serious reuse of package
in Zope. (if you want to use inheritance, since you can not
get newer version of the package you reuse).
I am very surprised that nobody did not give any comment to my previous
message !!!


___
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: Workflow and document management system in Zope

2001-01-21 Thread Nicolas Pettiaux

Dear Mr Krosing,

Thank you VERY much for the information.

This application looks really neat, this is really going in the direction I 
want, and has indeed a lot of the features I am looking for.

This IS the application I want to start with. 

My estonian is really poor (not to say, I don't understand a word), but the 
English help is good enough.

I shall go on tomorrow morning, but for what I noticed, it matches a lot of 
our requirements.

I shall go on with some questions and statements, to knwo more about the 
system.

Le Dimanche 21 Janvier 2001 13:28, Hannu Krosing a écrit :
> > I am looking for a workflow (WF) linked to a electronic document
> > management (EDM) system and a groupware email based (I have just happened
> > to come accross aethera from the Kompany) that would be free software and
> > preferably in Zope + Python. The WF+DEM system I am looking for need to
> > be usable with only a browser (to be independant from the client ... that
> > could be proprietary !), store its data into a postgresql database.
>
> You could check out Amphora which should do most of what you suggest.
> And it is based on Zope+Postgres.
>
> the main info page is at http://www.amphora.ee/  (unfortunately in
> estonian only ;)
>
> but you can check out demo which is either in english or estonian
> (depending on
> your browser language settings) at
> https://demo.amphora.ee/amphora/classic/
> password:demo and username:demo

I did. Working good. I appreciate the fact that it is certified.

> It is not completely opensource though but is available with development
> license.

Q1/ What is not open-source ?

Q2/ What could be done to have the system open-sourced ? (We are ready to pay 
for such a system)

Q3/ What is a developpement license ?

Q4/ Which parts are proprietary ? I would understand if the "special" clients 
related to (I quote)
"Special software exists for easy synchronisation with MS Outlook and MS 
Windows file system." and
"The special Windows client is built using Borland Delphi, uses PGP for 
encryption/decryption and integrates Mozilla toolkit for electronic 
signatures. " would be proprietary, provided their protocol be open and fully 
described." be proprietary.
We could pay for such licenses ... if the cost of the system is comparable to 
other similar systems.

Q5/ Would you be ready for a contract to improve and further develop the 
system, as well as provide a maintenance for 3 to 5 years ?

Q6/ I need to have a setup ready and if possible in English (and French and 
Dutch if possible but I have the translatros from English) within a week. 
Could this be possible ?

Q7/ How do I have to proceed to set the system up (I can have local help with 
Zope + Postgresql + python if I do not succeed personnally, but I need a 
"procedure") = do this and this to install and configure the system, as well 
as some fake data.

Q8/ What is your isntalled base ? (which are your clients) Are there any 
public institution your client (governments, large companies ...)

Q9/ What kind of company are you ? 
How many people ? 
Which specific competences ? 
What is you financial backing (please understand that I would need to go 
through a public market, for which I would need answers to these questions 
plus many other !)

Q10/ How many simultaneous client does the system stand ?

Q11/ What is a reasonable system (I mean hardware) to run the system on, 
knowing that we could have about 50 users to start with in about 2 to 3 
months, plus 200 users in about 6 months and about 500 in a year). We are 
ready to start with a small system and upgrade the hardware later on. 

Q12/ The system works with OUtlook. Does it also work with Outlook Express ? 
(that has less features than outlook, for example NO calendar as far as I 
know)

Q13/ Are all the protocols, formats, file formats ... open and fully descibed 
(there is a law proposal that is supposed to get through very soon in Belgium 
that make it compulsory for public administration to use open format and 
protocols, that is formats and protocols that are 100 % described in public 
understandable document, for which a free implementation can be made, and 
that are deposited by a public institution)

Q14/ As an open-source system (you say nearly) is it easily extendible in 
Zope and Python ?

Q15/ Can it easily be linked with a LDAP directory service to provide the 
contacts coordinates ? (There is a ZOPE to LDAP system)

Q16/ Can the project management system be extended to provide PERT and GANTT 
chart ? 

Q17/ How can a standard flow for a process be described and checked : I mean 
a way to trace for a project that a standard acceptation process has been 
followed for example ?

Q18/ What about signatures and authentications of actions by specific people ?

Q19/ Could you do as much as possible to let me set up a demonstration ?

Q20/ Does the system run on Debian Potato ? THis is the server we run on, 
because we find debian management is the easiest and that 

[Zope] ZOPE and PHP - possible or not ?

2001-01-21 Thread Greg Nowak

Hi!

How do I combine the PHP code with ZOPE ?

How to tell Apache to parse the PHP code ?
Where do I find info ?

Best regards,
Greg



-- 
BEZPLATNE konto e-mail o adresie [EMAIL PROTECTED] i NIELIMITOWANEJ pojemnosci 
Tylko w POLAND.COM ! www.poland.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: Index out of range

2001-01-21 Thread Tim Cook

Tim Cook wrote:
> 
> Error Type: IndexError
> Error Value: list index out of range
> 

OOPS! forgot the control panel info:

Zope version: Zope 2.2.5b1 (binary release, python 1.5.2,
linux2-x86) 
Python version: 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] 
System Platform: linux2 
Process ID: 32347 (3076) 
Running for: 24 days 9 hours 37 min 39 sec 





-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

___
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] Index out of range

2001-01-21 Thread Tim Cook


Error Type: IndexError
Error Value: list index out of range

I am importing a text file via an external method. I did my
testing with a file that contained 18 records.
All went fine. Stepped up the testing to a file with 550 records.
The real thing will have over 30,000. Now it doesn't work. :-)
It's not a memory issue or anything that you would expect with an
increase i records. 

Anyway, here's the link to where I can the results. I also added
a method to display the dictionary contents (raw mode) for
testing. I don't see anything wrong with it.

I have a ZClass that I will be creating instances of, when I get
the code right. :-)

http://www.freepm.org:8080/tkfpm/Drugs/multum_update

Here's the HTML method:
--


 

...(table headers removed for bandwith's sake)




  

  


  
  
  
  
  
  
  
  
  
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


  




-
The RAW dictionary dump method:





Number of items: 




    
 Length: 
 
 




-


I found that if I just include the first element of the list
() the HTML table renders.
When I add the second list element is when it dies.

I have looked at the source file to see if there are any
incorrect (non-printables etc) didn't find any.


THanks for any help/suggestions,

-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

___
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: Workflow and document management system in Zope

2001-01-21 Thread Hannu Krosing

Nicolas Pettiaux wrote:
> 
> I am looking for a workflow (WF) linked to a electronic document management
> (EDM) system and a groupware email based (I have just happened to come
> accross aethera from the Kompany) that would be free software and preferably
> in Zope + Python. The WF+DEM system I am looking for need to be usable with
> only a browser (to be independant from the client ... that could be
> proprietary !), store its data into a postgresql database.

You could check out Amphora which should do most of what you suggest. 
And it is based on Zope+Postgres.

the main info page is at http://www.amphora.ee/  (unfortunately in
estonian only ;)

but you can check out demo which is either in english or estonian
(depending on 
your browser language settings) at
https://demo.amphora.ee/amphora/classic/
password:demo and username:demo 

It is not completely opensource though but is available with development 
license.

-
Hannu

___
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] MySQL connection string.

2001-01-21 Thread Joachim Werner

Indra Gunawan wrote:

> Hello,
> could anyone tell me how to make connection string to MySQL in Linux?
> I use Zope 2.3 and I've tried the 
> 
> database@[host] username password

This should work. Your problem is probably somewhere else. Are you sure 
that the database adapter, database etc. are all set up correctly?

Joachim.


___
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] SQL query result set - what data structure & how to access [(elements)]?

2001-01-21 Thread Andrew Kenneth Milton

+---[ Lee ]--
| Hi,
| 
| I'm using a python method to query my database as follows, where I need
| to use the result set to generate some HTML. I'm interested in result[0]
| and result[1] as listed below;
| 
| * return result[0] gives me:
| [{'name': 'PRACTICALS', 'type': 's', 'null': None, 'width': None},
| {'name': 'TUTORIALS', 'type': 's', 'null': None, 'width': None},
| {'name': 'ASSIGNMENTS', 'type': 's', 'null': None, 'width': None},
| {'name': 'BONUS', 'type': 's', 'null': None, 'width': None}]
| 
| * return result[1] (or just 'return result') gives me:
| [(1, 16, 9, 1)]
| 
| What kind of data structure is this? First impressions suggest that it's
| a tuple but why the extra brackets?. I need to access each element but
| how do I do this? I've tried all sort of tuple/list
| conversions/operations and have had no success.
| 
| If the result is [(1, 16, 9, 1)] how can I assign...
| 
| a=1st element i.e. 1
| b=2nd element i.e 16..?
| 

Ok try this... you're getting a ResultSet back, here's some code to
iterate over them.

These are little gems I've gleaned from various places, so I take
no credit (or responsibility) for this code :-)

add these to your .py file


from string import upper, lower
import Missing
mt=type(Missing.Value)

def typeconv(val):
if type(val)==mt:
return ''
return val

def sqlattr(ob, attr):
name=attr
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
attr=upper(attr)
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
attr=lower(attr)
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
raise NameError, name


Then as an example of how it works;
in the same .py file.

def parseResultSet(self):
userList={}
myResults=self.sqlGetAllCustomers()
for cust in myResults:
customername=sqlattr(cust,'customername')
username=sqlattr(cust,'username')
userList[username]=customername
return userList

myResults represents any result set... so it should 'just work', YMMV

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 ABN: 83 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[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 )