Re: [Zope-dev] cvs checkin?

2001-04-16 Thread Jonothan Farr

  if find(v,'\r') = 0: v=join(split(v,'\r'),'')
 -if find(v,'\n') = 0: v=join(split(v,'\n'),'br\n')
 +if find(v,'\n') = 0: v=join(split(v,'\n'),'br /\n')

Out of curiosity, what is the reason for using join(split(...)) instead of just
replace()? Is it really faster or something?

--jfarr



___
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] FTP error messages

2001-02-20 Thread Jonothan Farr

 I've now added the ability to set the message to be sent back to the FTP
 client on FTPResponse. The patch is attached. We'll be using it and I hope
 that it, or something similar, makes it into the 2.3.1.

Try submitting it to the collector. It's likely to get lost on the mailing list.

--jfarr



___
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] download file from LocalFS

2001-01-24 Thread Jonothan Farr

 When mylfs references a directory meta_type is 'Local Directory'
 but if mylfs references a file meta_type is 'File'.

 How can I let the user download the file?

I tried it like this:

dtml-call "RESPONSE.setHeader('content-type',mylfs.content_type)"
dtml-var mylfs

It mostly worked, except that my html documents were getting html-quoted. If you
can solve that I think you're home free.

--jfarr



___
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] Calling a DTML Document using a string

2001-01-24 Thread Jonothan Farr

- Original Message -
From: "Anderson Ami" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 12:00 PM
Subject: [Zope] Calling a DTML Document using a string


 How can I do a dtml document call using the call dtml tag ?
 e.g.

 - I have 3 DTML documents ( bot1, bot2 and bot3)
 - I have in my request a int variable called varX
 - I would like do it, but this one doesn't work :
 ...
 dtml-var expr="bot + varX"

I think this will work.

dtml-let doc=bot
dtml-var "doc + _.str(varX)"
/dtml-let

The dtml-let call seems to render the 'bot' document. (I'm not very experienced
with the dtml-let tag.) You need to convert varX to a string so you can
concatenate the two strings together.

Give that a try!

--jfarr


___
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] Calling a DTML Document using a string

2001-01-24 Thread Jonothan Farr

Boy did I ever misunderstand the question. Dang. Sorry! Nevermind me!
--jfarr


- Original Message - 
From: "Dieter Maurer" [EMAIL PROTECTED]
To: "Anderson Ami" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 1:50 PM
Subject: Re: [Zope] Calling a DTML Document using a string


 Anderson Ami writes:
   How can I do a dtml document call using the call dtml tag ?
   e.g.
   
   - I have 3 DTML documents ( bot1, bot2 and bot3)
   - I have in my request a int variable called varX
   - I would like do it, but this one doesn't work :
     
   dtml-var expr="bot + varX"
   
 This is an FAQ: computed variable access:
 
  dtml-var expr="_['bot%d' % varX]"
 
 
 Dieter
 
 ___
 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-dev] Is manage_add for products broken?

2001-01-22 Thread Jonothan Farr

Hello all,

One of the Local File System users pointed out that calling
manage_addLocalFS from dtml doesn't work. I did some checking and discovered
that calling manage_addXXX doesn't work for any of the built-in products
either. My testing was with 2.2.5. Am I crazy or didn't this work at one
time? Is there a way to work around this? I couldn't find one.

Thanks very much. Any help is appreciated.

--jfarr



___
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] Stopping a dtml-in

2001-01-19 Thread Jonothan Farr

  Now just don't get me started on
   "_['index-whatever']" :-)
 
  Funny. I patched that too, and I know I'm not the only one. It also "fell
  through the cracks". *sigh*

 I've never understood the reaction that always comes from DC w.r.t. patches
that
 fix that.

 There always seems to be a huge 'no!' for no particular reason, even though
that
 would save _so_ many people _so_ much time and effort :-(


Yeah, so hey, DC, what gives? Why don't we have sequence_item and family or some
reasonable alternative? This has been dragging out for too long!

--jfarr



___
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] Stopping a dtml-in

2001-01-19 Thread Jonothan Farr

 Anyway, I'm sorry that your proposal fell through the cracks;
 the "hot money" these days is all on HiperDOM/XHTML stuff, rather
 than DTML, so it may stay there (especially if the patch is hard
 to apply to a recent Zope).

It would be easy to apply the patch. The work would be in testing it. It seems
like getting it into the new release while it's still alpha would get a lot more
eyeballs looking at it. HiperDOM/XHTML may be the way of the future, but DTML is
what we've got. Why not make it a little bit easier to use if it doesn't take
much effort?

--jfarr



___
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] Stopping a dtml-in

2001-01-18 Thread Jonothan Farr

Now just don't get me started on
 "_['index-whatever']" :-)

Funny. I patched that too, and I know I'm not the only one. It also "fell
through the cracks". *sigh*
--jfarr



___
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] Tools used for programming Zope

2001-01-18 Thread Jonothan Farr

 do an xml export. You can save cvs that to your hearts content.

 ... but then I'll have to forego readability, edit-ability, etc.

 Frankly, I'm a little surprised that this isn't a problem for more people,

I'll wager that it is a problem for lots of people but you don't hear from them
here. They've already moved on to other solutions. I know a few who were
completely put off by not being able to grep through the code. It's a problem
I'd love to be able to solve but so far it hasn't been solved by people far
smarter than me.

--jfarr



___
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] Stopping a dtml-in

2001-01-17 Thread Jonothan Farr

http://www.zope.org/Members/jfarr/Patches/dtml-break

I requested that this page be cataloged but it never was. I also submitted it as
a patch to the distribution but it was refused. Something about a new dtml-in
implementation that I haven't seen materialize in the last 5 versions or so.

I would use patch with the diff file rather than overwriting your existing files
since these patches were made to 2.1.6.

--jfarr


- Original Message -
From: "Geoffrey L. Wright" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 17, 2001 3:04 PM
Subject: Re: [Zope] Stopping a dtml-in


 Dieter Maurer [EMAIL PROTECTED] writes:

  Diego Rodrigo Neufert writes:
dtml-in "_.range(1000)"
code...
dtml-if valueOk
STOP THE LOOP
/dtml-if
/dtml-in
  A long time ago, someone has implemented a "dtml-break" tag.

 Wow.  That's good to know.  I just created some fairly ugly code to
 get around the lack of something like a dtml-break.

 I just tried searching for it on zope.org, on the mailing lists, and
 using google for good measure.  Didn't find any mention of it
 anywhere.  If anybody does come up with a link I'd love to see it.

 I wonder why there's nothing like that natively..?


 file://glw


 ___
 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] Is it time for mandatory subject keys?

2001-01-17 Thread Jonothan Farr

 Maybe it's time for mandatory subject keys. Something like NEW: for
 newbies questions; OT: for off-topic (like this); 

You mean ADM: for administrative topics.

I think it's a great idea. I'll do it if DC decides on the keys.

--jfarr



___
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] In desparate need of some help

2001-01-16 Thread Jonothan Farr

Not sure why you're crashing but your SQL looks incorrect and incomplete. It
should be something more like:

select * from songdetails
where
some_field='' and
some_other_field = 2000
...
;

Hope this helps,
--jfarr

- Original Message -
From: "alankirk" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 16, 2001 3:40 PM
Subject: [Zope] In desparate need of some help


  Hi there, i am new to zope and i'm in need of some help. I'm using zope as
part of my final year project for university. I am using zope with a database
i've constructed using MySQL. I've been having trouble sending queries to MySQL
for data from the tables in the DB, instead of the required data i get an error
message window appear and my python server crashes(which is running on my
machine, by the way i'm using version 2.2.2 of zope on windows ME). Somethimes
the error message is blank, other times it's PYTHON15.DLL or MYSQL.DLL when it
crashes. Also when i submit a query to add data to a table zope returns what
appears to be a error message in my browser, which the zope control panel is
using, but the data is still added to my DB table.
When submitting a query to extract data, if my python server doesn't crash, zope
returns the following:
Error, MySQL.error: have an error in your SQL syntax near ' '', '', '', 2000 )'
at line 3

SQL used:

SELECT * FROM songdetails
WHERE(
 '',
 '',
 '',
 '',
 2000
 )

I'd be most grateful if you could provide some answers to any of these probelms
as soon as you can. Even if you don't know if you could point me in the
direction of someone who does.

Cheers

Alan



___
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] converting int to string?

2001-01-08 Thread Jonothan Farr

 in python you can do:

 str(int)

 and in zope you do it like

 _.str(int)

 You can also use the short form in both Zope and Python:

 `int`

 Two of those funny `` characters surrounding what you want converted to a
 string.

The backtick notation `` is actually the shorthand for repr(), not str(). In the
case of ints this will give you the same result but not in all cases. I second
Jens's recommendation. _Learning Python_ is a great book.

--jfarr



___
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] Advice on searching/indexing Word documents?

2001-01-03 Thread Jonothan Farr

This sounds pretty exciting. Sounds like someone should set up a proposal on
dev.zope.org.I'm afraid I wouldn't be able to contribute much development right
now but I'd be willing to help test and participate in discussions.

--jfarr

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 03, 2001 8:25 AM
Subject: RE: [Zope] Advice on searching/indexing Word documents?


 I really like the idea of extending OFS:File to support different file
 types, but what I would like to see is something that is
 format/filter/library agnostic.  That is to say, that perhaps the way we
 ought to go about this is to create an API framework that upon upload
 filters the file with a specified filter for its mime-type.

[snip]



___
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] dtml-in: total??

2001-01-02 Thread Jonothan Farr

dtml-var sequence-length

- Original Message - 
From: "Edwin Martin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 02, 2001 7:23 AM
Subject: [Zope] dtml-in: total??


 Hello,
 
 I'm making a generic DTML-method which shows a bar like
 AltaVista does:
 
 [  previous] [1] [2] [3] [4] [next  ]
 
 I need to know the number of rows the database returned.
 
 In appendix A of the Zope book, I see I can use total-name etc.
 
 How can I get the total number of rows, independent of
 column names?
 
 Can I do it without rewriting the SQL-queries?
 
 Bye,
 Edwin Martin.
 
 ---
 The world is moving so fast these days that the person who says
 it can't be done is generally interrupted by someone doing it.
   -- Harry Emerson Fosdick
 
 
 ___
 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] Advice on searching/indexing Word documents?

2001-01-02 Thread Jonothan Farr

I used to
 write text filters in C and Lex for my previous employer - one of these days
 I will figure out how to extend python with C and do this.  

Here's one that's written entirely in Python:
http://www.cosc.canterbury.ac.nz/~greg/python/Plex/

I've seen a couple of other implementations out there.

--jfarr



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

2000-12-12 Thread Jonothan Farr

 At least the "Local File System" object does not expose
 its children via "getattr" (which is required for the
 usual "." operator to work) but only via "[...]".

 This probably is a bug.


No this is by design, as explained in the how-to. Most operating systems allow
period (.) characters in filenames, so how would the dtml expression
"LocalFS.some.dir.some.file.plus.extension" be translated to a file system path?

--jfarr



___
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] persistence and dictionaries

2000-12-08 Thread Jonothan Farr

Maybe I'm mistaken, but it seems like you can put an instance of an object that
doesn't inherit from Persistent into the ZODB just fine, but its contents won't
persist, so you'll always end up with a copy of the object as it was first added
to the database.

--jfarr

- Original Message -
From: "Chris McDonough" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, December 08, 2000 11:57 AM
Subject: Re: [Zope] persistence and dictionaries


 Huh.  If they do, it's by chance only.  I'd be hard-pressed to explain it.

 Do they inherit from *anything*?

 - Original Message -
 From: "Matt" [EMAIL PROTECTED]
 To: "Chris McDonough" [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Friday, December 08, 2000 2:30 PM
 Subject: Re: [Zope] persistence and dictionaries


  Chris, this was my original confusion  the two places below where you
 say
 
  "You can put instances which do not inherit from Persistence.Persistent in
  your database.  They just won't "stick".  They'll hang around until the
  server is restarted or for an undetermined amount of time during normal
  operations."
 
  "No.  It'll work for "a while" or until the server is restarted.  :-)"
 
  actually do persist after restarts ... that's what confused me, they
 wouldn't
  go away and they should!!
 
  regards
  Matt
 
  Chris McDonough wrote:
 
Thanks for the reply, that is really useful.  There are a couple of
 things
though that still don't add up.  Firstly, you say below, as do all the
   ZODB
documents that "Custom" classes can certainly persist, they just need
 to
   mix in
the "Persistence.Persistent" class as a base class.  Well, in my
 example I
attached in my first email, my product certainly has
   Persistence.Persistent,
but my second class that I add to this one does not, yet it still
   persists.
There was an email sometime ago on the mailing list that told someone
 that
   this
was why their product instances disappearing from the ZODB.
(the ref for the original email is :
   http://www.egroups.com/message/zope/44263
... I can't find the reply again.)
   
  
   You can put instances which do not inherit from Persistence.Persistent
 in
   your database.  They just won't "stick".  They'll hang around until the
   server is restarted or for an undetermined amount of time during normal
   operations.
  
So my current understanding would be that any classes you want to add
 in
   do not
need to derive from Persistence.Persistent, and if it is pickleable
 then
   all
should be fine if you call on instances of that object within you
 product.
  
   No.  It'll work for "a while" or until the server is restarted.  :-)
  
The next part that worried me came from the "python product tutorial"
http://www.zope.org/Members/hathawsh/PythonProductTutorial
   
This stated that the class dictionary self.votes = {} needed to be
 changed
   to
self._votes = Globals.PersistentMapping()  so that updates to it
 persist.
Hence my query about dictionaries.
  
   This was for convenience, I'd imagine.
  
 I also noticed your comment about __setstate__ .  What is it about
 this
   that is
dangerous.
  
   Nothing implicitly dangerous, but it can get confusing if you have
 multiple
   revisions of your product and you use variables caused by __setstate__.
   Also, once you add a __setstate__ which modifies the object in-place,
   there's a likelihood that it can never go away (you're can never be sure
 if
   all instances have been updated).
  
Recently I built a product out of some python classes I wrapped
around 4DOM, and since 4DOM documents do not seem to persist(well the
   document
does, but it loses all its children), then I persisted them to the
 local
   file
system, since I needed to do that anyway for what I was doing.
 Setstate
   seemed
to work nicely to bring them back, though watching its behaviour I
 noticed
   that
it was called very often by zope.
  
   Sure, that works... although at that point you're creating your own
 object
   database.  :-)
  
   
Chris McDonough wrote:
   
 All pickleable Python primitive types (strings, dictionaries, lists,
   Nones,
 integers, floats, longs, etc.) can live in the ZODB.  They can
 persist
   just
 like instances that inherit from the Persistent class.

 I think you read a little too much in to the fact that you need to
   "treat
 mutable objects immutably" when working with them in the ZODB.  This
 statement doesn't mean that these kinds of objects can't be saved in
 the
 ZODB, it just means you need to treat them specially when putting
 them
   in
 the database.

 For instance, if you were doing this inside of an external method:

 def amethod(self):
self.mydict = {}
self.mydict['a'] = 1

 (where self is the persistent object that is usually the external
   method's
 "container")

Re: [Zope] persistence and dictionaries

2000-12-08 Thread Jonothan Farr

Oops. You snipped the contents of MoreStuff.addStuff(). No way to tell what's
going on without that!
--jfarr

- Original Message -
From: "Matt" [EMAIL PROTECTED]
To: "Jonothan Farr" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 08, 2000 2:39 PM
Subject: Re: [Zope] persistence and dictionaries


 Ok, here are some of the offending bits out of my boringplus product
  which I can send again if people want.  I have
 another product that keeps a dictionary of cookies so I can see how many
 times someone uses the back button to
 access the same forms page again.  This worked as expected, where I had
 to issue an _p_changed=1 to get them to
 persist.  But I am doing a similar thing below, or so I thought, once
 with a dictionary in the product and once in a
 dictionary within a class that does not inherit Persistent.  This is
 what is confusing.  Through restarts etc, everything
 perisists


 class Boring(
 OFS.SimpleItem.Item,   # A simple Principia object. Not Folderish.
 Persistent,# Make us persistent. Yaah!
 Acquisition.Implicit,  # Uh, whatever.
 AccessControl.Role.RoleManager # Security manager.
 ):


 def __init__(self, id, title=''):
  self._things = {}
  self._more = myClass.MoreStuff()


 def manage_edit(self, title, REQUEST=None):
if REQUEST is not None:
   if REQUEST.has_key('thing'):
  self._things[REQUEST['thing']] = REQUEST['thing_value']
   self.addToMore(REQUEST['thing'],REQUEST['thing_value'])


 def addToMore(self,name,value):
 self._more.addStuff(name,value)
 return ""


 class MoreStuff:

 def __init__(self):
 self._stuff = {'animal':'monkey'}

 def addStuff(self,stuff_name,stuff_item):


 On Sat, 09 Dec 2000, Jonothan Farr wrote:
  Maybe I'm mistaken, but it seems like you can put an instance of an
 object that
  doesn't inherit from Persistent into the ZODB just fine, but its
 contents won't
  persist, so you'll always end up with a copy of the object as it was
 first added
  to the database.
 
  --jfarr
 
  - Original Message -
  From: "Chris McDonough" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Friday, December 08, 2000 11:57 AM
  Subject: Re: [Zope] persistence and dictionaries
 
 
   Huh.  If they do, it's by chance only.  I'd be hard-pressed to
 explain it.
  
   Do they inherit from *anything*?
  
   - Original Message -
   From: "Matt" [EMAIL PROTECTED]
   To: "Chris McDonough" [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Friday, December 08, 2000 2:30 PM
   Subject: Re: [Zope] persistence and dictionaries
  
  
Chris, this was my original confusion  the two places below
 where you
   say
   
"You can put instances which do not inherit from
 Persistence.Persistent in
your database.  They just won't "stick".  They'll hang around
 until the
server is restarted or for an undetermined amount of time during
 normal
operations."
   
"No.  It'll work for "a while" or until the server is restarted.
 :-)"
   
actually do persist after restarts ... that's what confused me,
 they
   wouldn't
go away and they should!!
   
regards
Matt
   
Chris McDonough wrote:
   
  Thanks for the reply, that is really useful.  There are a
 couple of
   things
  though that still don't add up.  Firstly, you say below, as do
 all the
 ZODB
  documents that "Custom" classes can certainly persist, they
 just need
   to
 mix in
  the "Persistence.Persistent" class as a base class.  Well, in
 my
   example I
  attached in my first email, my product certainly has
 Persistence.Persistent,
  but my second class that I add to this one does not, yet it
 still
 persists.
  There was an email sometime ago on the mailing list that told
 someone
   that
 this
  was why their product instances disappearing from the ZODB.
  (the ref for the original email is :
 http://www.egroups.com/message/zope/44263
  ... I can't find the reply again.)
 

 You can put instances which do not inherit from
 Persistence.Persistent
   in
 your database.  They just won't "stick".  They'll hang around
 until the
 server is restarted or for an undetermined amount of time during
 normal
 operations.

  So my current understanding would be that any classes you want
 to add
   in
 do not
  need to derive from Persistence.Persistent, and if it is
 pickleable
   then
 all
  should be fine if you call on instances of that object within
 you
   product.

 No.  It'll work for "a while" or until the server is restarted.
 :-)

  The next part that worried me came from the "python product
 tutorial"
  http://www.zope.org/Members/hathawsh/PythonProductTutorial

Re: [Zope] Patch to avoid hypenation variables and more

2000-12-04 Thread Jonothan Farr

I've had patches for this for some time at
http://www.zope.org/Members/jfarr/Patches/Patches/dtml-in-sv

I was told they weren't being considered for inclusion because they will be
superceded by the named dtml-in construct (which would also supercede your
second patch). No word on when or if named dtml-in will actually happen, though.

--jfarr


- Original Message -
From: "Adam Karpierz" [EMAIL PROTECTED]
To: "Michel Pelletier" [EMAIL PROTECTED]
Cc: "Zope Mail List" [EMAIL PROTECTED]
Sent: Monday, December 04, 2000 5:36 PM
Subject: Re: [Zope] Patch to avoid hypenation variables and more


 - Original Message -
 From: "Michel Pelletier" [EMAIL PROTECTED]
 To: "Tino Wildenhain" [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, December 04, 2000 7:10 PM
 Subject: Re: [Zope] Patch to avoid hypenation variables and more

 [...]
  It's cool.

 Yes !. It is _very_ cool and very long awaited.
 Thank you Tino :)

 Maybe also is a good time to mix and apply
 my old patch for 'sort' attribute with Tino's patch ?.
 Please, take a look at:
 http://classic.zope.org:8080/Collector/1542/view
 http://classic.zope.org:8080/Collector/1541/view

 Regards

 Adam Karpierz
 [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 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] Search and replace

2000-11-20 Thread Jonothan Farr

 ideally two external methods. one recurses through folders collect
 objects of a particular meta_type

 the second external method calls the first to get a collection of
 objects for a particular meta_type and performs string manipulations on
 the raw() representation of the method.

I think a better implementation would be to add a 'Replacable' interface,
otherwise you have to assume too much about the internal representation of lots
of different classes of object.

--jfarr



___
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] PropertyManager

2000-11-14 Thread Jonothan Farr

The Local File System product does this. You can check out the source code at
http://www.zope.org/Members/jfarr/Products/LocalFS.

--jfarr

- Original Message -
From: "Max M" [EMAIL PROTECTED]
To: "Zope@Zope. Org" [EMAIL PROTECTED]
Sent: Tuesday, November 14, 2000 4:39 PM
Subject: [Zope] PropertyManager


 Does anybody know a good example that shows the working of the
 PropertyManager??

 An example with a product that subclasses the PropertyManager and sets the
 "_properties" and the "__ac_permissions__" would be preferable. But anything
 will do.

 Regards Max M


 Max M. W. Rasmussen,Denmark.   New Media Director
 private: [EMAIL PROTECTED] work: [EMAIL PROTECTED]
 -
 Specialization is for insects.  -  Robert A. Heinlein


 ___
 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] Bypass ZODB and use File System

2000-10-19 Thread Jonothan Farr

As long as you're only storing text, whether it be html or dtml or what, then
LocalFS might be a good solution for you. You still get through-the-web content
management, and lots of neat Zope-isms like acquisition. What you can't do is
attach persistent properties to the files you store locally, not even as much as
a 'title' property. If you need that ability then LocalFS is not the way to go.
I don't see how Michael's wget solution will help you there either, though.

--jfarr


- Original Message -
From: "Michael Bernstein" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, October 19, 2000 7:59 AM
Subject: Re: [Zope] Bypass ZODB and use File System


 Noah wrote:
 
  What we really want to do is to provide a second view to
  /var/www/htdocs for Apache. I understand that Apache won't
  serve up our dynamic content, but that's not important.
  Zope is just viewed as a better solution for managing our
  static documents. The problem we have in my organization is
  that there is a lot of resistance to my prototype Zope
  document management system due to the fact that everything is
  stored in ZODB. We think this risky -- possibly a data prison.

 The way my organization does it, is to manage the content
 within Zope, and to regularly run 'wget' on the server to
 replicate it all to static files, which are then served by
 Apache on another server. Doing that, plus regular backups
 of the Data.fs file (you're already making regular backups
 of your Apache based system, right?), and you should be
 guarded against any but the most catastrophicly unlikely
 disaster scenarios (you do have a disaster recovery plan,
 right?).

 wget is really a very easy way to get documents back out of
 Zope, and if your system is designed to do this as a matter
 of course (perhaps by using 'cron'), it should silence those
 particular criticisms.

  Also people don't want to change from their current habits of
  editing files via NFS or Samba mounted directories. My original
  plan was to allow them some sort of syncronization process,
  but now I think that would be crazy.

 Hmm. I guess it depends on what percentage of your users
 want to keep doing this. You can certainly combine LocalFS
 with the approach that I outlined above. I would make it a
 special case. Keep the CMS server separate from the Apache
 server, and only allow the mounted directories on the CMS
 server. I've found that people appreciate being able to
 manage their content from anywhere through a browser, and
 they tend to gravitate toward that as a matter of course,
 once it's there, if they're not forced to do it.

 In short, give people options, and see which ones they
 actually use.

 HTH,

 Michael Bernstein.

 ___
 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] Searching a LocalFS through Zope

2000-10-17 Thread Jonothan Farr

Check out LocalFS v0.9.6. Now with ZCatalog support!
--jfarr

- Original Message - 
From: "neeloy_saha" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, October 17, 2000 5:12 AM
Subject: [Zope] Searching a LocalFS through Zope


 Hi all,
 
 Well I had sent this earlier but i want to resend this again!! I have not
 yet received a reply back. 
 
 Can anyone suggest me a way out ???
 
 I have lots of old html/ documents that I want to publish through my zope
 portal. To ensure that I do not tweak html files I have used the LocalFS
 product, also I do not want to **load the data.fs**. Now. I am running into
 search problems. How do i do a search the filesystem file? and also ensure
 that the search results come from both the filesystem files and the portal
 zcatalog.??
 
 I guess there are two ways ??
 ** attach a search engine to index on the filesystem files and let zcatalog
 take care of the rest.
 ** or make all those html files zcatalog aware.But then u cant look inside
 pdf/latex/word docs or do u??.
 
 I guess I would prefer the first one !! gut feel probably that would require
 less effort and I can support different file formats . Has anyone used a
 FREE external search engine ith zope before.If so which one is it ???
 
 -neeloy
 
 -Original Message-
 From: Guido van Rossum [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, October 16, 2000 7:53 PM
 To: neeloy_saha
 Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]';
 '[EMAIL PROTECTED]'
 Subject: Re: Migrating website to zope.
 
 
 Strange though it seems, we are *not* Zope experts (yet).  We used an
 external volunteer to set up our site.  I recommend that you post your
 question to one of the Zope mailing lists -- see www.zope.org for
 pointers.
 
 --Guido van Rossum (home page: http://www.python.org/~guido/)
 
  Subject: Migrating website to zope.
  From: neeloy_saha [EMAIL PROTECTED]
  To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED]
  Cc: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED],
  "'[EMAIL PROTECTED]'"
  [EMAIL PROTECTED]
  Date: Mon, 16 Oct 2000 16:00:43 +0530
  
  Hi all,
  
  Sorry if u receive this mail multiple times.I need help desperately.
  
  I am working in a migration project where I am trying to reenginer my
  website from the html/cgi based thing to zope.[something like urs
  http://www.pythonlabs.com/news/08-22-2000-0001.html  ] I have lots of
 legacy
  static html documents which I want to use "as it is". So I have taken help
  of the LocalFS (http://www.zope.org/Members/jfarr/Products/LocalFS) and
 used
  it to serve the html documents.
  
  Now I am facing a tricky issue of how to do a search on those files (
 html
  )as i do not find any patch which makes them a part of the Zcatalog. I am
  using the Zcatalog to do the search on other contents of my site. 
  
  I guess u might have faced the same issue and implemented the search. I
  desperately need help on this issue. any pointers/code/patches/contact
  person /how u went abt it!! would be welcome.
  
  Thx in advance.
  
  -neeloy
   India
 
 ___
 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] new LocalFS release: 0.9.6

2000-10-16 Thread Jonothan Farr

Changes v0.9.6

 - Fixed saving large File and Image objects.

 - Added ZCatalog support.

http://www.zope.org/Members/jfarr/Products/LocalFS/

--jfarr



___
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] Ability to catalog localFS objects in the portal catalog

2000-10-13 Thread Jonothan Farr

There are some patches floating around to add cataloging to LocalFS objects. I
haven't gotten around to including them in the standard distro.

--jfarr

- Original Message -
From: "neeloy_saha" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, October 13, 2000 4:56 AM
Subject: [Zope] Ability to catalog "localFS objects" in the portal catalog


 Hi all,

 I have lots of old html/ documents that I want to publish through my zope
 portal. To ensure that I do not tweak html files I have used the LocalFS
 product, also I do not want to load the data.fs

 Now. I am running into search problems. How do i do a search the filesystem
 file? and also ensure that the search results come from both the filesystem
 files and the portal zcatalog.??

 Thx and regards.

 -neeloy

 ___
 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] Fighting htmllib in external method

2000-10-10 Thread Jonothan Farr

Try using a StringIO object as your file.

import htmllib
import formatter
from cStringIO import StringIO

def index(self, html):
file = StringIO()
fmtr = formatter.AbstractFormatter(formatter.DumbWriter(file))
p = htmllib.HTMLParser(fmtr)
p.feed(html)
file.seek(0)
return file.read()


- Original Message - 
From: "Jason Spisak" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 10, 2000 2:47 AM
Subject: [Zope] Fighting htmllib in external method


 Howdy Zopsters,
 
 I want to catalog some html files but I want to strip the html tags out.
 htmlparser does a good job of that, but when I try to acces that from an
 external method, I run into trouble.
 
 import htmllib
 import formatter
 
 def index(self, html):
 fmtr = formatter.AbstractFormatter(formatter.DumbWriter(file))
 p = htmllib.HTMLParser(fmtr)
 return p.feed(html)
 
 Since the DumbWriter uses stdout, this returns None.  When I try to write
 to a temporary file, or pipe I get 'bad file descriptor' errors because of
 the way external method function I guess.  Any help would really be
 appreciated.
 
 All my best,
 
 
 Jason Spisak
 [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 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] How to use manage_addLocalFS

2000-10-02 Thread Jonothan Farr

That should work. Can you post the traceback?
--jfarr

- Original Message -
From: "Grewen.de" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, October 01, 2000 6:48 PM
Subject: [Zope] How to use manage_addLocalFS


Hi all,

I want to create an LocalFS object.

I use dtml-call "manage_addLocalFS('LocalFS', 'Tis is the title',
'/home/zope/productimages')" but that doesn´t work.

Simular to dtml-call "manage_addFolder('Folder', 'Tis is the title')"

Any ideas?

May I have to use a externel methode like in the mail I posted before?





___
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] dtml-tree urlparam

2000-09-18 Thread Jonothan Farr

Oops. Forgot to mention, this patch adds a new param to the tree tag,
'urlparam_expr' which is a Python expression to evaluate and use as the
urlparam.

--jfarr

- Original Message -
From: Júlio Dinis Silva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 18, 2000 12:59 PM
Subject: [Zope] dtml-tree urlparam


 Hello all!

 Suppose I have a page who needs some dinamically generated params in order
 to be rendered.
 Suppose this page also has a dtml-tree. I found that to
 add extra params to the url created I can use the urlparam param :-)

 But suppose instead of passing "arg=1" I want to pass
 REQUEST['QUERY_STRING']. I thought urlparam would do the trick but
 using urlparam=QUERY_STRING the string passed is "QUERY_STRING" instead of
 the value of QUERY_STRING.

 Is there another param to do what I want or do I have to go into the
 source to hack dtml-tree to force to pass my QUERY_STRING parameters?

 thanx to all,
 Julio Dinis Silva
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.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] Static pages

2000-09-14 Thread Jonothan Farr

If they are:

- very large (MB+)
- generated by some external process
-or-
- uploaded by users

...then Local File System is one way to go.

Otherwise, loadsite.py will just slurp them all into the ZODB and you can serve
them from there.

--jfarr


- Original Message -
From: Nick Trout [EMAIL PROTECTED]
To: Zope Mail list [EMAIL PROTECTED]
Sent: Thursday, September 14, 2000 1:56 AM
Subject: [Zope] Static pages


 Hi, I would like to incorporate a load of static HTML pages into my Zope
 website.

 My question: what is the best way to do this?

 Is there a product to this.?

 I don't really want to have to use Apache.

 Regards,
 Nick.



___
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] Getting the count from dtml-in

2000-09-12 Thread Jonothan Farr

 How do I get the count in a sequence?

dtml sequence-length

--jfarr


___
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: [Zope-dev] Cool, we like the . :-)

2000-08-17 Thread Jonothan Farr

What if an object id contains a period?
--jfarr

- Original Message - 
From: Chris Withers [EMAIL PROTECTED]
To: Steve Alexander [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 17, 2000 11:59 AM
Subject: [Zope-dev] Cool, we like the . :-)


 
 Steve Alexander wrote:
  I can't think of a nice alternative to mean dtml-/foo/bar/baz; "from
  the root, traverse as follows".
 
 dtml-.foo.bar.baz;
 
 not nice, btu I can't think of anything better :(
 
 cheers,
 
 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 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] How to use RESPONSE.redirect ?

2000-08-15 Thread Jonothan Farr

HTTP is stateless. You'll have to build the entire query string and put it into
your redirect URL.
--jfarr

- Original Message -
From: Stuart Foster [EMAIL PROTECTED]
To: Zope List [EMAIL PROTECTED]
Sent: Tuesday, August 15, 2000 10:19 AM
Subject: [Zope] How to use RESPONSE.redirect ?


 I want to use redirect to call another form passing the current form, how
 can I do that.

 dtml-call RESPONSE.redirect('otherform'+?)

 If I do
 dtml-call RESPONSE.redirect('otherform')
 The current form isn't being passed ?

 Any ideas..

 TIA
 Stuart



___
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 bug or my stupidity?

2000-08-15 Thread Jonothan Farr

Once again I'll point out that I have a patch that allows sequence_item. I've
submitted it to the collector but it was rejected because of the AFAIK
not-yet-scheduled "named dtml-in" feature.

http://www.zope.org/Members/jfarr/Patches/dtml-in-sv/

--jfarr

Hardware, n.:
The parts of a computer system that can be kicked.

- Original Message -
From: Curtis Maloney [EMAIL PROTECTED]
To: Peter Hernberg [EMAIL PROTECTED]; Chris Withers [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, August 15, 2000 5:51 PM
Subject: Re: [Zope] Zope bug or my stupidity?


 On Wed, 16 Aug 2000, Peter Hernberg wrote:
  --- Chris Withers [EMAIL PROTECTED] wrote:
   Peter Hernberg wrote:
Here's the method that calls that method:
dtml-var "get_storys"
  
   Why the quotes?
  
   try dtml-var get_storys instead
 
  But then I get the following weird error:
  Traceback (innermost last):
 *snip*

  (Object: objectValues('Story'))
File /root/Zope-2.2.0-src/lib/python/DocumentTemplate/DT_Util.py, line
  337, in eval
  (Object: sequence-index == 0)
  (Info: index)
File string, line 0, in ?
  NameError: (see above)
 
  I am fairly new to zope, but this seems pretty weird, especially the method
  returning its dtml source.

 And you've been caught by one of the most common (and understandable) newbie
 mistakes. (o8.

 'sequence-item' is not a valid Python name.  To Python it looks like  "
 sequence - item ", the mathematical expression.

 This is a holdover from days of old, and not much has been done to deprecate
 it (all my shouting, and that of others, has so far come to naught.)

 dtml-var sequence-item  will work, because that is in Zope Land... no
 quotes.

 dtml-var "_['sequence-item']" is the Python Land equivalent.  the _[] name
 space lookup is your friend for this sort of problem.

 dtml-if "sequence-index  (numStories - 1)"

 should be written as:

 dtml-if "_['sequence-index']  (numStories -1)"

 
  =
  Peter Hernberg
  An all-purpose, antibacterial, lemon-scented geek/nerd
 
 I guess I should really try to rally people to send this to the collector...

 Have a better one,
 Curtis Maloney.

 dtml-var standard_work_disclaimer

 ___
 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] dtml-in and tuples

2000-08-14 Thread Jonothan Farr

Well in Python a list is mutable and a tuple is not.
--jfarr

- Original Message - 
From: Chris Withers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 14, 2000 3:38 PM
Subject: [Zope] dtml-in and tuples


 Hi,
 
 Why and how are python tuples (like, this) handled differently (and not
 in a logical way I can see...) than python lists [like, this]?
 
 cheers,
 
 Chris
 
 ___
 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] Why is 'Shutdown' an Error?

2000-08-10 Thread Jonothan Farr

Because it throws a SystemExit exception. If you're not running in debug mode
"-D" you won't see the traceback.
--jfarr

"Work like you don't need the money,
love like you've never been hurt,
and dance like no one is watching!"
Anonymous

- Original Message -
From: William BC Crandall [EMAIL PROTECTED]
To: Zope list [EMAIL PROTECTED]
Sent: Thursday, August 10, 2000 7:13 AM
Subject: [Zope] Why is 'Shutdown' an Error?


 Another start-up question.

 Why does the Control Panel "Shutdown" button
 generate an Error:


 Zope Error
 Zope has encountered an error while publishing this resource.

 exceptions.SystemExit

 Zope has exited normally.

 Traceback (innermost last):
   File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py,
 line 222, in publish_module
   File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py,
 line 187, in publish
   File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py,
 line 171, in publish
   File C:\Program Files\TotipotentZope\lib\python\ZPublisher\mapply.py,
 line 160, in mapply
 (Object: manage_shutdown)
   File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py,
 line 112, in call_object
 (Object: manage_shutdown)
   File C:\Program
 Files\TotipotentZope\lib\python\App\ApplicationManager.py, line 383, in
 manage_shutdown
 (Object: ElementWithAttributes)
 SystemExit: 0

 ___
 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] Re: Upload on a local File System

2000-08-08 Thread Jonothan Farr

You should be able to eliminate the dtml method like so:


upload_image_form
-
FORM ACTION="LocalFS_objekt_id/manage_upload" METHOD="POST"
ENCTYPE="multipart/form-data"
INPUT TYPE="hidden" NAME="action" VALUE="where_you_want_to_go_after_uploading"
TABLE CELLSPACING="2"
TR
  TH ALIGN="LEFT" VALIGN="TOP"File/TH
  TD ALIGN="LEFT" VALIGN="TOP"
  INPUT TYPE="file" NAME="file" SIZE="25" VALUE=""
  /TD
/TR
TR
  TD/TD
  TDBRINPUT TYPE="SUBMIT" VALUE="Upload"/TD
/TR
/TABLE
/FORM

--jfarr


___
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] interating though REQUEST.form in python???

2000-08-08 Thread Jonothan Farr

for name,value in REQUEST.form.keys():

Note the function call (parentheses).
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] acquisition vs. inheritance

2000-08-04 Thread Jonothan Farr

Dang! Just when I think I understand this acquisition thing. ;)

Sorry for the misinformation.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: Jonothan Farr [EMAIL PROTECTED]
Cc: Bob Horvath [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, August 04, 2000 1:54 AM
Subject: Re: [Zope] acquisition vs. inheritance


 Jonothan Farr wrote:
 
   Is it possible to have just one top level object that refers to
   other objects that get overridden as you go into other folders?
 
  Acquisition works the other way around. You can create objects in subfolders
  whose contents are overriden higher up. You can't have an object at the top
  whose contents get overridden as you go down.

 Urm, I think wires are getting crossed here, so here's an example which
 may help (and which we use on most of our sites):

 index_html is a DTML method:

 dtml-var standard_html_header
 dtml-var index.html
 dtml-var standard_html_footer

 Now, in each folder we have DTML documents called index.html which
 actually contain the pages.

 So, we have one index_html and many index.html's.

 When someone does http://www.mysite.com/folder/
 This actually renders http://www.mysite.com/folder/index_html
 Then, index_html is acquired from the root.
 However, because index.html exists is /folder, it is that which is
 displayed.

 I hope this makes it a little clearer :S

 cheers,

 Chris

 PS:
  Your solution was correct. Create another index_html in the subfolder,

 As long as index_html is a method, you only need one of them, in the
 root.

  which
  uses the 'contents' object in the subfolder,

 This will still happen if there's only one index_html



___
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] Redirecting from Python?

2000-08-04 Thread Jonothan Farr

Are you doing a dtml-var or dtml-call to call your external method? I believe
you need a dtml-call.
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: Christopher J. Kucera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 04, 2000 10:49 AM
Subject: [Zope] Redirecting from Python?


 Greetings!

 I'm working on a Product, and I'd like to be able to do a RESPONSE.redirect()
 from inside the Python code.  What I had was basically this:

 dtml-if "some number of conditions"
   View the page . . .
 dtml-else
   dtml-call "RESPONSE.redirect('blahblahblah')"
 /dtml-if

 This works fine, but rather than having that sitting out in DTML-land,
 I figured I could put the conditions in the Python code and simplify
 the if statement, so all I'd have to do is:

 dtml-if someConditions
   View the page . . .
 /dtml-if

 The Python code I was hoping would accomplish this was:

 def someConditions(self):
   if (some number of conditions):
 return 1
   else:
 self.REQUEST.RESPONSE.redirect('blahblahblah')

 My problem is that the redirect just doesn't happen.  I've had this
 function return values and the like, so I know it's parsing my conditions
 correctly, and I can even do a "return self.REQUEST.RESPONSE.redirect" and
 have the function returned back into my page, but it won't actually
 redirect.

 Any ideas?  Thanks in advance . . .

 -CJ

 ___
 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] acquisition vs. inheritance

2000-08-03 Thread Jonothan Farr

 Is it possible to have just one top level object that refers to
 other objects that get overridden as you go into other folders?

Acquisition works the other way around. You can create objects in subfolders
whose contents are overriden higher up. You can't have an object at the top
whose contents get overridden as you go down.

Your solution was correct. Create another index_html in the subfolder, which
uses the 'contents' object in the subfolder, but the standard_html_header and
standard_html_footer from the parent folder.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] boolean property bug

2000-07-31 Thread Jonothan Farr

You should submit this to the collector, preferable with a patch! ;)
Otherwise it's likely to get lost in the chaos of the list.

http://classic.zope.org:8080/Collector

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message - 
From: Aleksander Salwa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 31, 2000 11:02 AM
Subject: Re: [Zope] boolean property bug


 
 On Mon, 31 Jul 2000, I wrote:
  
  Probably I found a bug in handling boolean properties in Zope 2.2.0.
  I can only set them "on", and then can't turn "off". I can have default
  value "off" (in ZClass definition), but after first switch to "true",
  it can't be changed.
  It only refers to handling properties via Zope's management screens.
  API functions manage_changeProperty, manage_editProperty work fine, so
  maybe it's an error in generated HTML forms, or in processing of these
  forms.
 
 I've located this bug, I think.
 It's in file 'lib/python/OFS/PropertySheets.py' in method
 'manage_editProperties'. This method should change all properties, even
 those not included in REQUEST. But there are handled only properties
 included in REQUEST, so checkboxes that get turned off are ignored.
 
 
 ololo
 
 
 ___
 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] dtml-tree question

2000-07-31 Thread Jonothan Farr

 Jonothan Farr wrote:
  Is it because the document is at the top of the namespace stack instead of
the
  request object in the dtml document case, but not in the dtml method case?

 Hurm, thinking for the right words and I think(?) namespace is the right
 one.

 Anyway, DTML documents have one and DTML methods don't.

 Hence your tree tag is using the DTML documents namespace, which has
 nothing in it apart from the properties of the document.


I don't think that's entirely accurate. There's a lot more in the namespace of a
DTML document. I think you're right, though, in that it's a namespace issue. I
found that the results of the SQL query where not part of the namespace in the
DTML Document case, but they were in the DTML Method case. Here's how I got it
working:

dtml-var standard_html_header

dtml-tree
branches_expr="select_subprojects(project_id=REQUEST.get('project_id',0)
id=project_id

  dtml-call "REQUEST.set('project_id', project_id)"

  smalla
href="edit_project?project_id=dtml-project_id;"edit/a/smallnbsp;

  a href="view_project?project_id=dtml-project_id;"dtml-var
project_name/anbsp;/td

  td align=right valign=topdtml-var task_count

/dtml-tree

dtml-var standard_html_footer


In other words, I have to explicitly get the parameter from the result object
and pass it back into the sql query. What I'd like to know is why? Is this a bug
or a feature?

Thanks,
--jfarr



___
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 an XMLDocument instance Programmatically

2000-07-24 Thread Jonothan Farr

 I can' t seem to get beyond importing Document (cannot import name
 Document).  Do I need to import other modules?  Is this the best/only way to
 do this??  Appreciate any help.

 from Products.XMLDocument import Document


I think you missed an 'XMLDocument'.

from Products.XMLDocument.XMLDocument import Document

That is: import the Document class from the XMLDocument module (file) in the XML
package (directory) in the Products package.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] REQUEST a string object?

2000-07-24 Thread Jonothan Farr


I couldn't reproduce this. The following code works for me in Zope 2.1.6,
verbatim.

dtml-var standard_html_header
dtml-call "REQUEST.set('spec', '*')"
dtml-call "REQUEST.set('num_dir_columns', 3)"
table
dtml-call "REQUEST.set('ctr', 0)"
dtml-in "local.fileValues(REQUEST.get('spec', _.None))"
  dtml-if "type == 'directory'"
dtml-if "ctr % num_dir_columns == 0"
  tr
/dtml-if
tda href="dtml-var URL1/dtml-var url"dtml-var "id"/abr
dtml-if "ctr % num_dir_columns == num_dir_columns - 1"
  /tr
/dtml-if
dtml-call "REQUEST.set('ctr', _.int(ctr) + 1)"
  /dtml-if
/dtml-in
dtml-comment In case we end in the middle of a row... /dtml-comment
dtml-if "ctr % num_dir_columns != 0"
  /tr
/dtml-if
/table
dtml-var standard_html_footer

Maybe you can play with this as a starting point.

I added a couple of REQUEST.set() calls at the top to simulate variables passed
from a form, I assume.

'local' is my LocalFS object. Are you using this code in a dtml-with statement
or are you actually serving it as a .dtml file from the local file system?

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] new LocalFS version 0.9.5

2000-07-23 Thread Jonothan Farr

It's been a while since the last LocalFS release. I wanted to fix a couple
of major issues for the next release but I'm a little stuck. I decided to
post a minor bug fix release instead.

This release fixes the following issues.

 - Fixed bobobase_modification_time.

 - Fixed cross-platform bug calculating object id in manage_upload.

 - Added optional 'id' parameter to manage_upload to allow the
   caller to specify the new object id.

 - Added optional 'action' parameter to manage_upload to allow
   redirecting somewhere other than the default 'manage_workspace'.

It is available at:

http://www.zope.org/Members/jfarr/Products/LocalFS

I've also posted my to do list at:

http://www.zope.org/Members/jfarr/Products/LocalFS/todo

So now you can see what I'm working on and what I've done for the next
release at any given time.

Enjoy!
--jfarr



___
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] dumb dtml-in question

2000-07-21 Thread Jonothan Farr

How about just:

dtml-var "_.len(folder.objectIds())"

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message - 
From: Andy McKay [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 21, 2000 3:53 PM
Subject: Re: [Zope] dumb dtml-in question


 dtml-in "objectValues()"
 dtml-var sequence-length
 /dtml-in
 
 This prints out the value every time though so you might do a return or do a
 request set depending upon what you are doing, or use a first / last
 system...
 
 dtml-in "objectValues()"
 dtml-if sequence-end
 dtml-var sequence-length
 /dtml-if
 /dtml-in
 
 Prints only once
 - Original Message -
 From: "Tom Scheidt" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, July 21, 2000 2:58 PM
 Subject: [Zope] dumb dtml-in question
 
 
 
  I'd like to use the dtml-in tag to get the number of files in a specific
  folder.
 
  Tom Scheidt | www.falsemirror.com | [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 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] Creating folders in LocalFS

2000-07-19 Thread Jonothan Farr

 Folder creation isn't really supported in LocalFS at the moment.  Very 
 low level support is there (module function _save_Folder) but it's not 
 intended to be called externally and there doesn't seem to be any path 
 to call it.  There is certainly not a local definition of
 manage_addFolder in LocalDirectory.  This is on my list of stuff to do 
 for our site, but I don't know if it's on Jonothan's list for the real
 product.

It is. It's hard. I'm going to need some help with this one, I'm afraid.

--jfarr



___
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] sequence-item and

2000-07-18 Thread Jonothan Farr

I've patched this for 2.1.6. Now you can use sequence_item in addition to
sequence-item.

http://www.zope.org/Members/jfarr/Patches/dtml-in-sv

There's a much cooler and more elegant solution in the pipe for 2.2.

http://www.zope.org/Members/4am/DTMLWiki/NamedDTMLInLoop

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: Rob Miller [EMAIL PROTECTED]
To: Diego Rodrigo Neufert [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, July 18, 2000 1:30 PM
Subject: Re: [Zope] sequence-item and ""



 Diego Rodrigo Neufert writes:

  Hi ppl...
 
  Why I cant use dtml-var "sequence-item"??

 Because, as I understand it, anything within "" gets treated as Python code
 by the DTML interpreter.  Thus "sequence-item" is parsed as an expression:
 sequence _minus_ item.  A dash is not a valid variable name character in
 Python, but it is in DTML; this is unfortunate.

 
  Every time I try to access sequence-item under "" in a dtml-call dtml-var or
  anything else I got this error:
 
  Error Type: NameError
  Error Value: sequence
 
  Well, I found a solution:
  dtml-let si=sequence-item
  dtml-var "si"
  /dtml-let
  Now everything is ok... but I dont want to do this, I want to access the
  *@%$#@ sequence-item in "".

 I've searched through the list archives and come to the conclusion that
 your solution above is the cleanest way to handle this, for now.  There are
 other ways, but they involve ugly-looking permutations of the "_" namespace
 variable, and they approach the splendor of Perl in their readability.  The
 "right" solution, IMHO, would be to rename the "sequence-..." variables to
 a different set of names that doesn't cause the Python interpreter to
 choke.  I seem to recall someone saying that this (or something similar)
 was being worked on, but, alas, for now dtml-let is our best option.

 rob

 
  Can anyone help me?
 
  -
  Diego Rodrigo Neufert
  -webmaster
  ---
  (Magic Web Design)
  (email) ([EMAIL PROTECTED])
  (curitiba) (pr)
 
  ___
  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 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: Re: [Zope] LocalFS Documentation

2000-07-13 Thread Jonothan Farr

 Was the LocalFS upload support released?  Earlier versions did not support
 upload, but I know the author was working on it.

Yup. Since 0.8.1.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] .dtml files

2000-07-12 Thread Jonothan Farr

 I have found function calls such as:
 manage_roleForm=HTMLFile('roleEdit', globals()) which I believe creates
 an HTML document template from the named file. But, what is the
 mechanism that calls/displays mange_roleForm?

The class heirarchy looks something like this:

Globals.HTMLFile
DocumentTemplate.HTMLFile
DT_HTML.HTMLFile
DT_HTML.HTML
DT_String.String

You want to look at the __call__ method of the DT_String.String class for
enlightenment, although I'll warn you that it's likely to make anyone but Jim's
head explode. ;)

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] File referencing and LocalFS

2000-07-05 Thread Jonothan Farr

 1)Folders names are directly related to string fields
 in a MySQL database which use spaces between words (eg
 New York), but folders names don't use spaces (eg
 NewYork). How can I skip spaces from database fields to
 make them refer to these folders (eg New York --
 NewYork)?

_.string.replace(folder_name, " ", "")

This will return a string with the spaces removed, if 'folder_name' is a string
variable containing the folder name (with spaces).


 2)Using LocalFS, can I do something like dtml-
 var "localfsObject['dtml-var par1'].['dtml-var
 par11'], where par1 and par11 are folder names (after
 skiping spaces)?

You can't nest dtml like this. Just use:

dtml-var "localfsObject[par1][par11]"

(also note that I removed the . between [par1] and [par11])

See http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS
for more information on using DTML with Local File System objects.

--jfarr




___
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] LocalFS cache, was Re: ZODB or not ZODB?

2000-06-29 Thread Jonothan Farr

 How do you do to cache those objects, since LocalFS
 referenced objects are not cached by Zope?

They aren't cached. I experimented with adding a cache, but ran into some
problems and gave up. It would probably be worth giving it another shot, though.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] ZODB or not ZODB?

2000-06-28 Thread Jonothan Farr

 In theory, you could use ZCatalog to catalog objects in the
 file system or in a RDBMS, providing that you can provide
 paths for them. I don't think anyone's done this yet. There
 are bound to be bumps from wjoever does it first. :)

There's a patch to the Local File System product to allow indexing files in the
file system. This will incorporated into the next version.

--jfarr




___
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] LocalFS and Cache Issues

2000-06-28 Thread Jonothan Farr

 I am using a combination of Zope to create and maintain 
 a MySQL database. This database is full of images files 
 so I decided to keep them outside MySQL for caching 
 facilities. My question are: 1)image files referenced 
 by LocalFS objects are cached by Zope? 

No.

and 2)In this 
 situation do I need to use Apache or only Zope+MySQL?

Just Zope.

--jfarr



___
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: Slow File Access With LocalFS

2000-06-27 Thread Jonothan Farr


It sounds to me like the Apache server is just writing the data directly to the
HTTP connection as it is read. I believe that's how HTTP "streaming" works. I
also believe this is possible to do using the Zope HTTPResponse object. Does
anyone have any ideas?

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: Rob Pratt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 27, 2000 10:56 AM
Subject: Re: Slow File Access With LocalFS


 Hey, thanks for the quick reply.

  No, it just takes a while to read a very large file and construct the
 ZObject
  (performance patches accepted ;)). It can also take a while to download
 them
 but
  that should be obvious. How is it that you're "streaming" the mp3 files?

 Sorry. Streaming is not exactly the right word I think. What I have set up
 is that Zope delivers a playlist (*.m3u), which is opened by a player on
 the
 local machine (assuming there's one installed), and the player app in turn
 makes a request for the actual mp3 file, which starts playing as soon as
 it's properly buffered in the player app. That avoids having to download
 each mp3 before playing it.

 I had the collection stashed behind an Apache rewrite rule, but when I
 checked out LocalFS, I decided to try to move it into Zope under a LocalFS
 object (which I can use to control access to the files more easily than in
 Apache). Using Apache rewrite, requests for mp3 files just bypassed Zope,
 and "streaming" was immediate. But handled as a LocalFS object, mp3 file
 requests (I guess from your reply) have to wait to create the ZObject
 before
 they start "streaming."

 Is there a way to get LocalFS to serve up the file without creating a
 ZObject?

 Wish I knew more about Python and programming. (I'm workin' on it, but it's
 a steep learning curve for a newbie like me.) I'd jump in and see if I
 could
 come up with a performance patch.

 Anyway, I've just started learning Zope, and I see that it has immense
 possibilities for automating a lot of what I do in my day job (I'm an
 editor
 for an alternative newsweekly in Santa Cruz, Calif., USA). The application
 I
 envision will probably make heavy use of the LocalFS product.

 I was hoping that it would be easy to digitize our extensive demo library
 on touring
 bands so that I wouldn't have to lend CDs to writers who never seem to
 return them ;) I could just get an intern to rip CDs into mp3s and post
 them
 on a password-protected mp3 server, and all the writers could have 24-7
 access.

 That's just one feature. Many, many others that I can think of (not
 involving mp3s ;)) could take hours and hours of work off of my weekly
 workload.



___
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] ZMysqlDA

2000-06-24 Thread Jonothan Farr

Sorry for the delayed response. I just posted a patch for this on the Zope
site at http://www.zope.org/Members/jfarr/Patches

--jfarr

- Original Message -
From: Brenton Bills [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 22, 2000 12:06 AM
Subject: [Zope] ZMysqlDA




 Hi people, I am trying to get ZMysqlDA running on a 4.0 Release BSD
 machine, I have compiled this fine before on Linux but no luck on bsd. I
 am new to Bsd so if this is a bsd problem I appolagise in advance, but the
 ZMysqlda documentation is not clear on what libs are required.

 Python 1.5.2 manually compiled and installed (not part from ports).

 cc -fpic  -I/usr/local/include/mysql -I/usr/include/mysql -O -pipe
 -D_THREAD_SAFE -I/usr/local/include/python1.5
 -I/usr/local/include/python1.5 -DHAVE_CONFIG_H -c ./MySQLmodule.c
 ./MySQLmodule.c: In function `pythonify_row':
 ./MySQLmodule.c:238: warning: assignment from incompatible pointer type
 ./MySQLmodule.c: In function `pythonify_res_fields':
 ./MySQLmodule.c:384: invalid lvalue in unary `'
 ./MySQLmodule.c: In function `STH_fetchdict':
 ./MySQLmodule.c:1125: invalid lvalue in unary `'
 ./MySQLmodule.c:1147: invalid lvalue in unary `'
 *** Error code 1

 Brenton Bills.


 ___
 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-dev] Re: possible bug in dtml-in

2000-06-22 Thread Jonothan Farr

You want sequence-end, not sequence-last. That just bit me yesterday. ;)

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: Federico Di Gregorio [EMAIL PROTECTED]
To: Zope Dev [EMAIL PROTECTED]
Sent: Thursday, June 22, 2000 10:16 AM
Subject: [Zope-dev] possible bug in dtml-in


 hi *,

 an external method returns a list of tuples like this one:

 [(elt1, elt2), (elt3, elt4), ...]

 and i want to print something after the last one so i do:

 dtml-in "build_list(args...)"
   ...do some work here...
   dtml-if sequence-last
 should be executed only after last iteration
   /dtml-if
 /dtml-in

 that always worked (when getting stuff out of a DB, for example) but
 with a list built as above, if there is *more* than 1 element i get...

   File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 276, in
render
   File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
 (Object: lettera_ricevuta)
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in
__call__
 (Object: lettera_ricevuta)
   File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
 (Object: genera_ricevuta_mail)
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in
__call__
 (Object: genera_ricevuta_mail)
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in
renderwob
 (Object: elenco.keys())
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in
render
 (Object: key=sequence-item)
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in
renderwob
 (Object: elenco[key][1])
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in
render
 (Object: row=sequence-item)
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 392, in
__getitem__
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 194, in last
   File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 182, in
value
 TypeError: getattr, argument 2: expected string, int found

 any idea?
 federico

 --
 Federico Di Gregorio
 MIXAD LIVE System Programmer   [EMAIL PROTECTED]
 Debian GNU/Linux Developer  Italian Press Contact[EMAIL PROTECTED]
   Those who do not study Lisp are doomed to reimplement it. Poorly.
   -- from Karl M. Hegbloom .signature

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




[Zope] Re: Writing to LocalFS

2000-06-22 Thread Jonothan Farr

 Again, after some searching, I am looking for the syntax to write  a
 file / append to a file in a Local File System.

 This is certainly where my Python days seem to slow my down b/c I
 would have just:

 contents = open('/path/file.txt', "r")

 to read and

 contents = open('/path/file.txt', "a")

 to append.

 I am sure that I am missing some bit of Zope Zen here...

 Please point me in the right direction...


To write a new file you would use the manage_upload method. To append a file,
you could read the contents of an existing file, append your data, then call
manage_upload to overwrite the file. See the LocalFS/DTML faq at
http://www.zope.org/Members/jfarr for information on how to access the contents
of a local file.

You may also consider just using an external method to do what you're trying to
accomplish.

--jfarr



___
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] new product: NISUserFolder

2000-06-22 Thread Jonothan Farr

I've created a new product similar to etcUserFolder that authenticates against
an NIS database.

http://www.zope.org/Members/jfarr/Products/NISUserFolder/

This also improves upon the etcUserFolder product by defining a separate role
for each user group, allowing more fine-grained control of which users have
which permissions.

I've submitted a patch to the collector containing these same changes to
etcUserFolder. If DC decides not to include them I'll release this as a separate
product.

Enjoy!
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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: Problem with LocalFS

2000-06-22 Thread Jonothan Farr

This is a known problem with LocalFS. The only workaround I know of is to put
your dtml code into a file, give it a .dtml extension, and place it in the
directory you want to upload to. This problem will be addressed in the next
version of LocalFS.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: jensebaer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 22, 2000 5:23 PM
Subject: [Zope] Problem with LocalFS


Hello,

I want to upload files to LocalFS.
I created a LocalFS with the id: images

I don´t want to use the existing addImageForm to create a new Image in the
LocalFS.

I want to use two DTML Methods

uploadform

  form action="savefile" methode="POST" ENCTYPE="multipart/form-data"
  Fileinput type="file" name="file" size="25" value=""br
  input type="submit" value="UPLOAD"


and send the data to:

savefile

dtml-call "images.manage_addImages('newfile',file,'titleof tempfile')"


but this do not create a new image in the LocalFS.
It creates an image in the Folder in which the the LocalFS exists.

I do not understand why 

Jens



___
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: LocalFS cross platform bug

2000-06-20 Thread Jonothan Farr

   How about this:
   
   +drive,rest=os.path.splitdrive(path)
   +if drive:
   +path = string.replace(rest, '\\', '/')
 
 Oops, looks like this doesn't work after all.  The Linux version of
 splitdrive doesn't actually do the split :-(.

Doh! Looks like we'll need to roll our own splitdrive then.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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: LocalFS w/ annotation data

2000-06-20 Thread Jonothan Farr

   What about just storing your meta-data in files in the local file system?
Then
   you wouldn't need to modify the LocalFS product at all. Just write a ZClass
that
   can read/write you meta-data file format.

 Might well be a better approach.  I'll think about it.  Unfortunately,
 it doesn't remove the need for automatically handling move, copy and
 rename, since these files wouldn't be visible to the normal archive users.


Good point. Well, for my next trick I plan to add support for generic object
meta-data in the file system. If you need it right away I'd say go for it,
because I don't know when I'll get to it. I'd like it if you could let me know
what you come up with, though. That'll probably make things easier when I get
around to implementing a general solution, which will eliminate the maintenance
chore for you of keeping your branch synched up with mine.

--jfarr



___
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: LocalFS cross platform bug

2000-06-19 Thread Jonothan Farr

   This is a known bug. Thanks for the patch. The problem with it is that
filenames
   containing backslash characters are valid on Unix. I haven't been able to
come
   up with a solution to this. Any ideas?

 That's why I check for a file name that starts with a letter followed
 by a colon (hmm, maybe should check that it contains at least one
 backslash as well).

That's a good point. Although, your patch actually does the backslash
replacement regardless of whether the drive specification is present.

How about this:

+drive,rest=os.path.splitdrive(path)
+if drive:
+path = string.replace(rest, '\\', '/')

This will only work if win32 paths are always specified as full paths by the
browser. Do you know if this is the case?

--jfarr



___
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: LocalFS w/ annotation data

2000-06-19 Thread Jonothan Farr

 BTW: I'm working on associating other annotation data with LocalFS
 files.  My current thinking is to release the result as a separate
 product, since I can't think of a way to do it that doesn't hack
 LocalFS sources.  Basically, I'm adding a PersistentMapping (from id
 to arbitrary class) to LocalFS that can contain one entry for every
 item in the top level directory with items for lower level directories
 being PersistentMappings themselves.  This seems less of a pain that
 one mapping with the key being the full relative pathname when the
 time comes to handle rename, add and delete...

 The motivation for all of this is an archive of PDF files.  I don't
 want to fill up the ZODB with the PDF files, but am perfectly happy to
 keep contributor name, short description, etc. there.  We'll use a
 ZClass to store this info, but I don't think that anything but our
 DTML will need to be aware of the details of it.

 Comments?


That sounds like a mess. LocalDirectory objects are not persistent, they are
created each time they are requested. So you'll have nowhere to put your
PersistentMappings except in the top-level LocalFS object. Trying to make the
LocalDirectories persistent would be painful. For one, it would be hard to keep
in synch with the file system. You could store everything in a PM at the top and
use paths relative to the base but that would make copy,rename,etc. also messy,
like you said.

What about just storing your meta-data in files in the local file system? Then
you wouldn't need to modify the LocalFS product at all. Just write a ZClass that
can read/write you meta-data file format.

--jfarr



___
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: Newbie: Listing filesystem objects?

2000-06-19 Thread Jonothan Farr

 NewbieQ of the moment:

 So there's a folder on my server, call it \\server\files\logos.  I want
 to list its contents in a drop-down listbox in a form; something like

 select name="logo_filename"
option selected value="default.jpg"default.jpg
option value="file1.jpg"file1.jpg
...
 /select

 Needless to say, I've installed the local filesystem product and
 created a localfs object called "logos" that maps to the correct
 folder.  And now I'm mired in the docs.  I'm thinking that I can just
 use dtml-in to iterate through the file ids of the objects in that
 folder, but I'm damned if I can see *how* to do that.  Any tips?



You can also refer to the DTML with LocalFS how-to at
http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS

I just added a section covering this topic. I will be adding more LocalFS/DTML
examples over the coming weeks.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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-dev] Cataloging LocalFS content

2000-05-30 Thread Jonothan Farr

 I think, cataloging "LocalFS" content would be nice.

 I have the following problems with it:

  1. "LocalFS" defines various meta types:
 "Local File System", "Local Directory" and "Local File".

 Only "Local File System" is a "true" meta type which
 should appear in the available objects list of ObjectManager's.

 However, I may well be useful, to select the others, too,
 in for "find" and cataloging.

This could be done, but my concern is that when changes are made to the file
system this will cause the catalog to be out of synch until you re-index. How
does this work with Zope objects? If you move or delete a Zope object that is
cataloged does it automatically update the catalog?


  2. ZCatalog uses "bobo_modification_time" in its meta table
 and for indexing. For "LocalFS" content, this is not
 the best modification time to use for indexing.

 It would be nice, if "bobo_modification_time" could somehow
 be synchronized with the object's modification time in the
 file system.

With the most recent version of LocalFS, the bobobase_modification_time should
be the same as the object's mtime in the file system. Please let me know the
details if you're seeing anything different.


--jfarr



___
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] Re: M$soft

2000-05-26 Thread Jonothan Farr

 Jet is inherently thread-unsafe, and M$ has no plans to fix this (such
 a fix would cut into their ability to sell SQL Server).  This issue
 has been a long-running problem in the Windows world;  the only
 solution is to serialize *all* access to the DB (even concurrent
 *reads* can foul each other up -- blech!)

Doh! Guess I should put thread locking in my JetDA before somebody hurts
themselves, then. ;)
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] sequence-*

2000-05-26 Thread Jonothan Farr

  Many of these variables cause problems for those starting out with Zope.
  Why not create alternate names such as sequence_* and degrade the
  former?
 
 Gotta agree with this :-)


Here's the patch. I'll submit it to the collector too. Enjoy.

http://www.zope.org/Members/jfarr/Patches/dtml-in-sv

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] M$soft

2000-05-25 Thread Jonothan Farr

 Here's a reference that dropped from Google when I asked "corruption
 concurrent microsoft access database"
 
   http://dgl.com/dglinfo/1998/dg980825.html (half way down page)
 
 I wouldn't use Access with Zope.

Sounds like a bug in the Access UI not the underlying Jet DB engine.

--jfarr



___
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-dev] ZCVS Mixin class... feedback sought.

2000-05-24 Thread Jonothan Farr

Just curious. How do you do diffs? How do you resolve conflicts? How do you
handle login/logout?
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] ZCVS Mixin class... feedback sought.

2000-05-24 Thread Jonothan Farr

 Good questions!

 You can just go to the 'admin' tab and type 'diff'.
 The admin tab lets you execute just about any cvs command
 with arguments stat, rtag etc etc.

Doing a diff on a zexp file isn't going to be very helpful, though. Any thoughts
on integrating some sort of xml diff tool?


 Conflicts.. uh... bad news. ;-)  I think it's essentially
 impossible to 'merge' two different versions of a zope
 object... so my plan would be to pick one version, or the
 other.

 Login and logout are handled when you set up the directory
 on the filesystem. Basically you need to 'checkout'
 a module (maybe an empty module) into a directory
 on the filesystem before you can use it to keep the
 xml representations of your Zope objects. That checkout,
 might, or might not, require a login, depending on your
 CVSROOT. You must 'be' the zope user (the same user that
 the zope process runs as) when you checkout the module,
 so that zope can manage the contents.

So essentially all checkins are by the same cvs user, so you lose the ability to
track accountability? I'd like to see something that was on a per-user basis,
maybe tied to the zope user, maybe not.

There's been a ton of talk about a zope cvs product. I've been thinking about
giving it a shot for a while now. I'm excited to see someone actually doing
something about it. I'd be glad to help out however I can. Especially since now
you've taken the killer name. ;)

--jfarr



___
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] M$soft

2000-05-24 Thread Jonothan Farr

 Is anybody bold enough to try Zope with ODBC to an ACCESS database?

I wrote a Jet database adapter so you can skip the ODBC and go straight to
access.

http://www.zope.org/Members/jfarr/Products/ZJetDA/

SQL server is a different story.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] Executing an external program

2000-05-22 Thread Jonothan Farr

 Note that it works from the Python command line, but not from a Zope
 external method.  I'm still trying to figure out why it is failing from
 within Zope (anybody have an idea?).  


How does it 'not work' from an external method?
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



___
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] uploading a batch of files

2000-05-22 Thread Jonothan Farr

There's an external method that loads a batch of files from the local machine
into the zope database. I've got a copy if you're interested, since I can't seem
to find it on the site anymore.
--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: R. David Murray [EMAIL PROTECTED]
To: Jonathan Park [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, May 22, 2000 3:43 PM
Subject: Re: [Zope] uploading a batch of files


 On Mon, 22 May 2000, Dieter Maurer wrote:
  FTP, mput?
  More difficult: a Python script generating appropriate HTTP Post requests

 An equally difficult alternative to b:  a temporary python external
 method that creates file objects and reads the content from the
 file system.

 Perhaps the load_site (or whatever it's name is) product would help
 with this?  I've never looked at it.

 --RDM


 ___
 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] Local File System

2000-05-19 Thread Jonothan Farr

 I'm just getting started, but managed to use
 the following to display only JPG's, and then
 only ones starting with "tn_" (my thumbnails):


There's an easier way. =)

ul
dtml-in "tester.fileIds(spec='tn_*.jpg')"
  img src="tester/dtml-var sequence-item"
/dtml-in
/ul

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



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