[Zope-dev] asynchat producer ready() method patch.

2001-01-27 Thread Donovan Baarda

G'day zope-dev,

I'm not subscribed to the zope-dev list (got enough email thanks :-), but I
thought some of you might be interested in the following patch to medusa
that I sent to the medusa list (ZServer is based on medusa).

I remember reading ages ago on a wishlist for ZServer that someone was
thinking of adding blocking support to producers. This patch adds support
for just that in a non-intrusive way. I haven't tried applying this patch to
ZServer, but it _should_ work.

The two things to look out for when applying these changes to older
programs that use asynchat.py and producers.py are; old producers with
existing and conflicting ready() methods, anything that uses the
compound_producer because the __init__ method has been simplified.

I hope someone finds this useful, and would appreciate any feedback.

Thanks,

ABO

- Forwarded message from Donovan Baarda [EMAIL PROTECTED] -
G'day,

I've recieved one note of interest in my patch for medusa to allow producers
to block using a ready() method. The gist was "this is a good idea, but it
doesn't work". At the time I was focusing on the ftp server part of medusa,
so I hadn't checked the http side much at all.

I also noticed that asyncore.py and asynchat.py were distributed without
producers.py in python itself. My original changes made asynchat.py
dependant on producers.py, which was probably a bad idea.

So I have gone right over my changes and produced a new, more thoroughly
tested patch that tries to minimize the side affects. I have tested the
changes as they are incrementaly applied to ensure that my changes don't
break old code that doesn't use the ready() feature. This patch contains
all changes made to all files, but you only need to accept the changes to
some files to use ready()

The main change is to asynchat.py, where support for the ready() method has
been added. Also added are a variety of producer base classes that allow new
producers with ready() support to be easily derived (and removed the
asynchat.py dependancy on producers.py that my early patch introduced). The
main async_chat class is actualy significantly simpler for the change,
mostly due to replacing the fifo class with a fifo_producer class. The
find_prefix_at_end procedure for finding terminators has also been
simplified and speeded up. Overall, asynchat.py is only 23 lines bigger
dispite all the additional functionality.

The good news is, the changes to asynchat.py are fully backwards compatible
and medusa runs fine with all other files unchanged, _except_ that
filesys.py and status_handler.py have conflicting ready() methods in
producers. These ready() methods are unused in the original medusa, but
cause the new asynchat.py to think the producers never complete. The patch
to these two files simply removes these ready() methods so medusa can run
with the new asynchat.

The next lot of serious changes are to producers.py and http_server.py.
These changes are not needed to run medusa as it stands, but are needed if
you start using blocking producers. The changes primarily make the producers
inherited from the base producer classes defined in asynchat.py. This
ensures that producers that wrap other producers will block correctly. The
inheritance of features makes producers.py 62 lines smaller than it was. All
the changes to producers.py are backwards compatible _except_ the
compound_producer.__init__() method now takes a python list of producers not
a fifo. The changes to http_server.py take this into account.

The final trivial change is a commented out alternative to use the new
async_producer instead of file_producer in ftp_server.py. This allows medusa
filesystems to return file types that could block without blocking the whole
server.

I hope someone gets a chance to try these out, and I would appreciate any
form of feedback. I'm tempted to submit my patch to asynchat.py direct to
the Python people for inclusion in Python 2.1, but would like to hear more
feedback before I do. 

BTW, ignore the patch to "medusa.prj"... that is a side affect of using
prcs to revision control my changes. This patch is to the 2601 version
of medusa.

-- 
--
ABO: finger [EMAIL PROTECTED] for more info, including pgp key
--

___
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] QNX and Zope

2001-01-27 Thread Joachim Werner

Hi!

Is there anyone who has tried using Zope on QNX? I have a request for 
using Zope in an embedded environment.

Thanks!

Joachim


___
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: asynchat producer ready() method patch.

2001-01-27 Thread Donovan Baarda

On Sat, Jan 27, 2001 at 09:30:16PM +1100, abo wrote:
 G'day zope-dev,
 
 I'm not subscribed to the zope-dev list (got enough email thanks :-), but I
 thought some of you might be interested in the following patch to medusa
 that I sent to the medusa list (ZServer is based on medusa).
[...]

whups... didn't attach the patch. Rather than bombard everyone with a 10k
patch, it can be found at;

ftp://minkirri.apana.org.au/pub/python/medusa-ready_0.3.patch.bz2

-- 
--
ABO: finger [EMAIL PROTECTED] for more info, including pgp key
--

___
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] ZCatalog FieldIndex bug in Zope 2.3.0b3

2001-01-27 Thread Chris Withers

  I'm guessing the DTML method TestCase is acquired from it, before the
  namespace
  is searched for the meta_data, which is a little screwy :-(

 Odd, I thought you were reffering to another bug that I fixed, thanks to
 your report :-) hehehe, apparantly that wasn't the actual bug you were
 interested in Should I put the other one back? :-)

Other one? not sure what you mean there... The bug with FieldIndexes was the
most important, one of our VIP(roject)s crucially relies on this ;-)

The ZSearch problem is weird. I'd need to fix ZDebug to work with 2.3 first
though as, AFAIK, a normal TemplateDict won't tell you what
mappings/InstanceDicts it has in it and what order they're in :-S

Thanks for the quick fix though :-)

Chris


___
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] Creating a namespace

2001-01-27 Thread Stephan Richter

Hello everyone,

I want to make my own name space with the following situation:

class X:

attributes = {'foo': 'bar'}

x = X()


Then I want to use it like that:

dtml-with x
  dtml-var foo
/dtml-with

The result should be : bar

I found out that I have to somehow use TemplateDict and InstanceDict, but I 
have no clue how to use itOf course there is no documentation on any 
web site or in the Zope code itself

Thanks for you help!!!

Regards,
stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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] http protocol

2001-01-27 Thread Jonas Luster

* Oliver Vecernik sez:

 Hi all,
 
 I'd like to write an http client for an embedded system to get
 information from Zope. For debugging I want to see the traffic between
 the client and Zope (http protocol). How can this be achieved?

Any reason not to use tcpdump,snoop or some sn0rt-alike?

jonas

-- 
Jonas Luster -- http://smurftarget.net (while netwarriors.org is down) -- 
[EMAIL PROTECTED]

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




[Zope] where are the pages stored?

2001-01-27 Thread Horatio B. Bogbindero


thanks to all those who helped me the URL passing thing! this has
definitely made my zope life better. 

btw, were does zope store the template pages and objects? i tried do look 
into the folders but i could not seem to find it. is there are a way of
moving this document root to a different folder? 

also the reason why i have so many questions is because i could not find
the zope documentation set in the zope source distribution. can someone
point me out the distribution so that i can read the fine manual(RTFM)
instead. thanks.

 
--
William Emmanuel S. Yu
Ateneo Cervini-Eliazo Networks (ACENT)
email  :  [EMAIL PROTECTED]
web:  http://cersa.admu.edu.ph/
phone  :  63(2)4266001-5925/5904
 
Standards are crucial.  And the best thing about standards is: there are
so many to choose from!
 


___
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: Typo in CopySupport.py in 2.3.0 final

2001-01-27 Thread Jerome Alet

Hi,

Line 282 of lib/python/OFS/CopySupport.py of 2.3.0 final reads:

raise 'BadRequst','Please rename each listed object.'

Instead this should probably be:

raise 'BadRequest','Please rename each listed object.'

since all the other .py in this directory raise 'BadRequest'

no patch this time.

hoping this will help.

bye,

Jerome Alet

___
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 with a patch

2001-01-27 Thread Jerome Alet

Hi,

the way the manage_renameObjects() method was coded made it impossible 
to exchange two objects ids in one pass, e.g. rename Obj1 to Obj2 and 
Obj2 to Obj1.

The attached patch seems to correct this problem, however a better 
temporary id construction method is needed.

I've tried to submit it to the colector but I don't know if it succeeded.

hoping this will help

Jerome Alet


--- CopySupport.py.2.3.0-final  Sat Jan 27 10:04:42 2001
+++ CopySupport.py  Sat Jan 27 10:10:48 2001
@@ -280,9 +280,20 @@
 """Rename several sub-objects"""
 if len(ids) != len(new_ids):
 raise 'BadRequst','Please rename each listed object.'
+conflicts = []
 for i in range(len(ids)):
 if ids[i] != new_ids[i]:
+if new_ids[i] not in ids :  # may a conflict occur ?
 self.manage_renameObject(ids[i], new_ids[i], REQUEST)
+else :
+tempo = ".temporary_%i_" % i
+self.manage_renameObject(ids[i], tempo)
+conflicts.append((tempo, new_ids[i]))
+
+# now we rename conflictuous objects
+for (old, new) in conflicts :   
+self.manage_renameObject(old, new)
+
 if REQUEST is not None:
 return self.manage_main(self, REQUEST, update_menu=1)
 return None



Re: [Zope] where are the pages stored?

2001-01-27 Thread David K. Trudgett

On Sat, Jan 27, 2001 at 04:51:23PM +0800, Horatio B. Bogbindero wrote:

...
 the zope documentation set in the zope source distribution. can someone
 point me out the distribution so that i can read the fine manual(RTFM)
 instead. thanks.

Try http://www.zope.org/Documentation

Regards,

David Trudgett


___
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: 2.3.0 Final? - ZCatalog

2001-01-27 Thread Tim Cook


When importing a .zexp from a (2.2.5) site into 2.3.0 I get the
below traceback (reproduceable). I have imported other apps with
catalogs that did not generate this error. I was able to narrow
it down to one particular folder with a catalog. Any ideas on how
to find out (if it is in my code) what is causing this error?


-

Error Type: AttributeError
Error Value: 'tuple' object has no attribute 'append'

Traceback (innermost last):
  File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line
222, in publish_module
  File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/local/zope/2.3/lib/python/Zope/__init__.py, line 221,
in zpublisher_exception_hook
(Object: ApplicationDefaultPermissions)
  File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /usr/local/zope/2.3/lib/python/ZPublisher/mapply.py, line
160, in mapply
(Object: manage_importObject)
  File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line
112, in call_object
(Object: manage_importObject)
  File /usr/local/zope/2.3/lib/python/OFS/ObjectManager.py, line
566, in manage_importObject
(Object: ApplicationDefaultPermissions)
  File /usr/local/zope/2.3/lib/python/OFS/ObjectManager.py, line
300, in _setObject
(Object: ApplicationDefaultPermissions)
  File /usr/local/zope/2.3/lib/python/OFS/ObjectManager.py, line
308, in manage_afterAdd
(Object: Traversable)
  File /usr/local/zope/2.3/lib/python/OFS/ObjectManager.py, line
308, in manage_afterAdd
(Object: Traversable)
  File
/usr/local/zope/2.3/lib/python/Products/ZCatalog/CatalogAwareness.py,
line 114, in manage_afterAdd
(Object: CatalogAware)
  File
/usr/local/zope/2.3/lib/python/Products/ZCatalog/CatalogAwareness.py,
line 184, in index_object
(Object: CatalogAware)
  File
/usr/local/zope/2.3/lib/python/Products/ZCatalog/ZCatalog.py,
line 408, in catalog_object
(Object: Traversable)
  File
/usr/local/zope/2.3/lib/python/Products/ZCatalog/Catalog.py, line
382, in catalogObject
  File /usr/local/zope/2.3/lib/python/SearchIndex/UnTextIndex.py,
line 393, in index_object
  File /usr/local/zope/2.3/lib/python/SearchIndex/UnTextIndex.py,
line 305, in insertReverseIndexEntry
AttributeError: (see above)


-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Liberty has never come from the government." - Woodrow Wilson

___
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: BUG: 2.3.0 Final? - ZCatalog

2001-01-27 Thread Tim Cook

Tim Cook wrote:
 
 When importing a .zexp from a (2.2.5) site into 2.3.0 I get the

I Cleared the Catalog, re-exported it and it imported fine.

Non-issue?

-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Liberty has never come from the government." - Woodrow Wilson

___
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 script safety

2001-01-27 Thread Robin Becker

There seems to be some attempts to avoid DOS attacks by eliminating
excessive resource usage. Might I point out that the first script I
tried out

m=range(99)
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
m=[m,m[:],m[:],m[:],m[:],m[:],m[:]]
return m

seems to be taking an awful lot of my machine's resources
-- 
Robin Becker

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




Re: [Zope] Editors [OT]

2001-01-27 Thread Phil Harris

On Saturday 27 January 2001 03:26, Tres Seaver wrote:
 In the neverending "perfect Zope editor" jihad, "Phil Harris"
 [EMAIL PROTECTED] wrote on the side of the angels

 of light:
  I just did a search on google and came up with some
  interesting  Win32 versions of Vim 5.7.11:
 
  See http://vim.sourceforge.net/bin_download/00index.txt
 
  Since the Python and TCL interpreters are built in it should
  be possible to add seamless FTP/WebDAV clients into Vim,
  cool!

 Even more insidious, consider:
  :py import Zope; app=Zope.app()

 ZEO + VIM is a r00ling IDE :)

 Tres.

Hmm, never thought of that, hmm.  (Phil starts thinking nice thoughts)

Phil

___
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] manage_listLocalRoles user entry needed

2001-01-27 Thread Kyler B. Laird


I've read that some people are at least thinking
about user management systems that go beyond the
"handful of users" systems currently supported
by Zope.  (I'm working on one today.)

As a baby step toward supporting these systems,
I propose that manage_listLocalRoles provide a
text box for entering users in addition to (or,
in my case, instead of) allowing them to be
chosen from the select list.

The kludge I've been using is another form that
is defined in the root folder that imitates
manage_listLocalRoles, but has the text input
instead of the select list.  This works, but it
requires the user to know to use it instead of
just selecting "local roles."

Times like this make me think about an
infrastructure that would easily allow admins
to override pages without changing them every
time a package is installed.  Hmmm...

Thank you.

--kyler

___
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] Updated Quickstart for Zope 2.3.0

2001-01-27 Thread Jon Franz


I noticed that 2.3 didn't update the quickstart materials, and that the
quickstart materials still used the old server-side-include syntax
internally and in their examples.  To make matters worse, the ZSQL method
examples didn't use sqlvar - thus were unsafe.  I updated the complete
quickstart to fix these problems and have sent a copy to Brian Lloyd for
future use.  Attached is the updated quickstart for your use in a win32
winzip archive - sorry, I don't have access to any other archive tools at
the moment.  Enjoy!


 QuickStart.zip


[Zope] Cobalt Qube

2001-01-27 Thread Graham Chiu


Inexplicably I purchased a Qube 2 to play around with but am
wondering whether I should keep or dispose of it now.  I've
left the shrinkwrap on while I decide. It was *cheap*!

Is it possible to set up Zope +/- SSL on this box without
having to purchase software modules from Cobaltnetworks?

( I have no Linux experience )

--
Graham Chiu

___
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] Cobalt Qube

2001-01-27 Thread Francisco M. Marzoa Alonso

El Sat, 27 Jan 2001, escribiste:
 Inexplicably I purchased a Qube 2 to play around with but am
 wondering whether I should keep or dispose of it now.  I've
 left the shrinkwrap on while I decide. It was *cheap*!

We've one of those also, and also for play around X) It's only used as 
internal mail server because I've find more flexiblity in use my own LiNUX 
boxes to do functions that Qube implements. It's a powerful machine from 
hardware view, but its standard software is closed (and bad) enough to forget 
it. It has only advantages if you have no LiNUX experience and no time to 
learn about because its HTTP based administration is good.

 Is it possible to set up Zope +/- SSL on this box without
 having to purchase software modules from Cobaltnetworks?

It is possible but...

 ( I have no Linux experience )

...you'll need some LiNUX experience to install packages in other formats but 
not the Cobalt pkg system, specially if you need to recompile sources.


Have a good one!

___
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] Script to do various 'manage_' operations

2001-01-27 Thread Tim Hicks

I have been trying to get hold of a script that can automatically convert
various dtml methods to custom zclass instances.  I found a script on the
zope mailing list (see bottom)

I put my file (see below) in the Extensions directory and added an external
method from within zope.  This all appeared to go fine.  To execute the
script, I made a method that simply had dtml-call conscript() and then
standard_h_h etc.  The problem is, nothing seems to happen.  I can view the
method that was supposed to run the script, but the call doesn't seem to
work.  Within the filesystem, there is no file called tempo (as a kind of
log of what's been done), and the methods with extension .shtml certainly do
not get changed to dtml documents.

Has anyone done this before?  Can you shed any light on what I'm doing
wrong?

Much obliged.

tim


Script from [EMAIL PROTECTED]
---

import re

def convert_dtml(self):
 """Convert DTML Methods and DTML Documents from old syntax to
new syntax.
Warning: recursive!
This assumes that DTML Method and DTML Document haven't been
subclassed.
 """
 print 'convert_dtml: id=%s' % self.title_and_id()
 if hasattr(self, 'meta_type') and \
   (self.meta_type == 'DTML Method' or \
self.meta_type == 'DTML Document'):
 convert(self)

 # should this be "isPrincipiaFolderish"?
 if hasattr(self, 'isAnObjectManager') and self.isAnObjectManager:
 for v in self.objectValues():
 v.convert_dtml()

_convert_regex =
re.compile('''!--#(/?)(([^"-]+?|"[^"]*?"|'[^']*?'|-[^-])+?)--''')

def convert(dtml_item):
 print 'converting...'
 title = dtml_item.title
# like document_src, but doesn't require RESPONSE
 data = dtml_item.PrincipiaSearchSource()
 print 'data'
 print data
 newdata = _convert_regex.sub('\g1dtml-\g2', data)
 print 'newdata'
 print newdata
 print 'end'
 dtml_item.manage_edit(newdata, title)


--
And here is how I adjusted it for my purposes:
--

import re

get_shtml = re.compile('\w+\.shtml')
f = open("tempo", "w+")

def convert_dtml(self):
 """Convert DTML Methods and DTML Documents from old syntax to
new syntax.
Warning: recursive!
This assumes that DTML Method and DTML Document haven't been
subclassed.
 """
 if hasattr(self, 'meta_type') and \
 get_shtml.match(self.id):
 convert(self)

 # should this be "isPrincipiaFolderish"?
 if hasattr(self, 'isAnObjectManager') and self.isAnObjectManager:
 for v in self.objectValues():
 v.convert_dtml()

def convert(dtml_item):
 id = dtml_item.id+'2'
 title = dtml_item.title
 # like document_src, but doesn't require RESPONSE
 f.write(id /n)
 data = dtml_item.PrincipiaSearchSource()
 PARENTS[0].manage_addDTMLDocument(id, title)
 id.manage_edit(data, title)







___
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] Siteroot and ZCatalog

2001-01-27 Thread Bob

I have a production site wich was moved from Zope 2.2.1 to Zope 2.2.4.
We use SiteAccess for virtual hosting and the Catalog has many problems
since the upgrade. Objects created before the upgrade show up multiple
times in the cataloged object or can't be edited through the web.
Objects created after the upgrade seem to be ok.

I tried the patch that Evan put up, but it doesn't solve the problem. I
guess the real question is: will Zope 2.3 solve the problem and is it
stable enough yet?

TIA

Bob Corriher


___
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] Cobalt Qube

2001-01-27 Thread Luke Tymowski

Hello,

 Inexplicably I purchased a Qube 2 to play around with but am
 wondering whether I should keep or dispose of it now.  I've
 left the shrinkwrap on while I decide. It was *cheap*!

It's a reliable little box. Plug it in and it will keep running. 
However. Lately it has become difficult to find RAM for it. You'll want 
128MB + to do anything interesting.

Zope will run on it. Performance would be approximately equivalent to a 
Pentium 133.  More than enough to saturate a 10Mb network, let alone a 
T1. So it makes for a very good Apache server.

However, it does not make a very good Zope server. It runs Zope well 
enough to support a small site or intranet. But if you got Slashdotted 
heavily, it might fall over. The more RAM you have the better.

 Is it possible to set up Zope +/- SSL on this box without
 having to purchase software modules from Cobaltnetworks?
 
 ( I have no Linux experience )

Well, if you have no Linux experience, and are intimidated by Linux, 
then don't touch it.

But if you put in a bit of effort, you'll find it worth the time.

The best SSL option would be buying the sw from Cobalt. You'll have to 
go to the command line to do it, though.

Moderate SSL use will kill the Qube, however.

If you want to use Zope heavily and do a lot of SSL, then get an Athlon 
or P3.

A P3-1000 is almost 15 X faster than the Qube2 when it comes to running 
Zope.

Luke


___
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] PythonScript question

2001-01-27 Thread Timothy Wilson

Hi everyone,

I'm using the Photo product to diplay some pictures at various resolutions
and to display them on a certain date. (Some may recall my questions about a
"Picture of the day" recently.) I want to set a 'display_date' property for
each Photo instance and I'd like to do it using a PythonScript. I've created
a form and PythonScript, but I get this error:

Error Type: TypeError
Error Value: argument 1: expected read-only character buffer, instance found

and this traceback:

Traceback (innermost last):
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.3.0/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line
324, in __call__
(Object: POTD_add)
  File /var/lib/zope/2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line
353, in _bindAndExec
(Object: POTD_add)
  File
/var/lib/zope/2.3.0/lib/python/Products/PythonScripts/PythonScript.py, line
330, in _exec
(Object: POTD_add)
(Info: ({'script': PythonScript instance at 87874d0,
'context': Folder instance at 89506c0, 'container': Folder instance at
89506c0, 'traverse_subpath': []}, ('This is a test',
DateTime('2001/01/30'), ZPublisher.HTTPRequest.FileUpload instance at
869e170), {}, None))
  File Script (Python), line 8, in POTD_add
TypeError: (see above)

Here's the relevant part of the form:

form action="POTD_add" method="post" enctype="multipart/form-data"
table
tr
 th align="right"Caption/th
 tdinput type="text" name="title" size="50" value=""/td
/tr
tr
 th align="right"Display Date/th
 tdinput name="display_date:date" size="20" value=""/td
/tr
tr
 th align="right"Image/th
 tdinput type="file" name="file" size="25" value=""/td
/tr
tr
 tdnbsp;/td
 tdbrinput type="submit" value=" Add POTD "/td
/tr
/table
/form

And here's my PythonScript 'POTD_add' to which I pass the parameter list 
'title, display_date, and file':

"""
Create a "Picture of the Day" image.
"""
import string

# create a unique object id based on the display date
newID = string.split(display_date, '/')
id = ''
for i in newID:
  id = id + str(i)

# create the image
context.manage_addProduct['OFSP'].manage_addPhoto(id, title=title,
file=file)

# add a display date property
doc = getattr(context, id)
doc.manage_addProperty('display_date', display_date, 'date')

Any ideas?

Wouldn't it would be great if there was a PythonScript repository
somewhere? It would help me a ton.

-Tim

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




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




[Zope] MYSQL Problem

2001-01-27 Thread Jens Grewen



I installed 

mySQL-3.23.32
mySQLdb 0.3.1
ZmySQLDA 2.0.4

on Win98


From the following SQL statmentI get the 
result 233L and not 233 as expected

select count(PID)from product

When I run this SQL Statment from another program I 
get the expected value 233.


In my installation there are a lot of Z SQL Methods 
that should return an int value and when I use field description int in the 
databaseI always get this 'L' behind the expected result. A lot of things 
donĀ“t work because of this.

When I change to mediumint (database field 
description)I get the expected 233.

How can I fix this.


Thanks

Jens


Re: [Zope] Zope Entry Flame

2001-01-27 Thread Tres Seaver

"Jason Cunliffe" [EMAIL PROTECTED] wrote:
 
 site design flame
snipped/
 /flame

Jason,

Flaming the Zope.org site layout is OT for this list;  the
"someone who cares" in this case is the Zope-web list
(mailto:[EMAIL PROTECTED], which I am CC'ing, and whither I
would set followups if this were a proper newsgroup, instead
of a lame-oh mailing list.)

Just my $0.25 worth :)

Tres.
--
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] Creating a namespace

2001-01-27 Thread Stephan Richter

Hello everyone,

I want to make my own name space with the following situation:

class X:

attributes = {'foo': 'bar'}

x = X()


Then I want to use it like that:

dtml-with x
  dtml-var foo
/dtml-with

The result should be : bar

I found out that I have to somehow use TemplateDict and InstanceDict, but I 
have no clue how to use itOf course there is no documentation on any 
web site or in the Zope code itself

Thanks for you help!!!

Regards,
stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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] PythonScript question

2001-01-27 Thread Evan Simpson

From: "Timothy Wilson" [EMAIL PROTECTED]
 Error Type: TypeError
 Error Value: argument 1: expected read-only character buffer, instance
found
[snip]
input name="display_date:date" size="20" value=""/td
[snip]
 D = string.split(display_date, '/')

You are marshalling 'display_date' as a date, then trying to treat it as a
string.  You need to either convert it to a string or use date methods.

Cheers,

Evan @ digicool  4-am


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

2001-01-27 Thread Ron Bickers

The trailing L identifies a long int in Python.  As of ZMySQLDA 2.0.4, MySQL
integers use Python longs because an unsigned MySQL integer could overflow a
Python int.  So, it's a bug fix.

A couple solutions (found at http://dustman.net/andy/python/ZMySQLDA/2.0.4)
are to use dtml-var num fmt="%d" or something similar to strip the L, or
use Python 2.x, which would not display the L in this case.  You could also
modify MySQLDA to use a Python int if you know you're not going to have
integers that will overflow.

Note that Python 2 is not officially supported by Digital Creations, though
it does happen to work with Zope 2.3.0.
___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jens
Grewen
Sent: Saturday, January 27, 2001 11:36 PM
To: Zope Maillist
Subject: [Zope] MYSQL Problem

From the following SQL statment I get the result  233L and not 233 as
expected

select count(PID)
from product

When I run this SQL Statment from another program I get the expected value
233.


In my installation there are a lot of Z SQL Methods that should return an
int value and when I use field description int in the database I always get
this 'L' behind the expected result. A lot of things dont work because of
this.

When I change to mediumint (database field description) I get the expected
233.

How can I fix this.


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




[Zope] how do I get properties from a calling document?

2001-01-27 Thread Gary Lowder

I have series of DTML Documents, at the same level in various folders.
The DTML Document (we'll call it 'lot_num') calls another DTML Document
(addForm), that sits at the project's root level, which is a form for
data input.  

From the DTML Document 'lot_num', I can access it's properties with
dtml-var number and dtml-var exp_date.   When I call the form, I
need access to those variables.  I'll additionally need access to them,
when the form calls a method to store the data collected into a database
(the variables I already know from 'lot_num' will also go into that
database record, so need to be accessible as well).

Hrm, I tried to describe it simply, but it still looks confusing to me.


Document = 'Form'=SQL Insert Method
properties 


I need to be able to access the original document's properties from
'Form', and, pass those along with the user's inputed form data, to an
SQL Insert method, as the only variables "sent" on the POST to the SQL
Insert method are what were entered by the user.  (Maybe that sounded
better grin).  


Thanks for your time and effort.

Gary.

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