[Zope-dev] Zope Tests: 4 OK, 1 Failed

2008-01-02 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Jan  1 12:00:00 2008 UTC to Wed Jan  2 12:00:00 2008 UTC.
There were 5 messages: 5 from Zope Unit Tests.


Test failures
-

Subject: FAILED (failures=1) : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  1 21:02:35 EST 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-January/008890.html


Tests passed OK
---

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Jan  1 20:56:33 EST 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-January/008886.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Jan  1 20:58:04 EST 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-January/008887.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  1 20:59:34 EST 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-January/00.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  1 21:01:04 EST 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-January/008889.html

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


Re: [Zope-dev] Finding modification time for a specific file

2008-01-02 Thread Christian Theune
Hi,

Am Sonntag, den 30.12.2007, 11:35 -0800 schrieb Saurabh Bagchi:
 I would like to do the following for a specific file,
 call it addMember.xls:
 1) Print the name of the file.
 2) By the side of the file, print its modification
 time.
 
 I can do this for all the files in the folder, but not
 for a specific file. I figure I need to pass some
 filter to objectValues to only select the specific
 file, but my attempts have been in vain so far.

Your question is very inspecific, especially to the development *of*
Zope.

To make sure you receive an answer, you should:

- Be more specific, especially about the Zope part
- Probably ask the [EMAIL PROTECTED] mailinglist
  (it seems to be a question of how to use Zope)

Christian

-- 
gocept gmbh  co. kg - forsterstrasse 29 - 06112 halle (saale) - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Notify event for getWSGIApplication?

2008-01-02 Thread Yusei TAHARA
Hello,

I'd like to add a new event for getWSGIApplication.
(the name is like WSGIPublisherApplicationCreatedEvent?)

Because, now zope3 uses no particular web server but can use any wsgi
server and I'd like to make a internal webserver calling facility
with a generic way.

I'd appreciate any comments.

Thank you very much.

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


[Zope-dev] Tutorial on SQLScript - Feedback solicited

2008-01-02 Thread kevin gill
I found that there is a lack of documentation for using SQLScript with
Zope3. SQLAlchemy is newer and exciting and SQLScript is mostly ignored.
This is unfortunate as it works well and is well known to Zope2
developers.

I have made an attempt to redress the balance by adding a page on it to
the ZopeInAnger section of the Wiki.

http://wiki.zope.org/zope3/HowDoIUseSQLScript

Unfortunately, the document is quite long. The example code is attached to
the document.

I would appreciate any feedback, particularly corrections, criticisms. I
will (grudgingly) accept criticisms of my presentation style as well as
the content. This is my first attempt to add to the documentation body for
Zope.

Thanks,

Kevin

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


RE: [Zope] Re: Best Practice for including Javascript inZope Applications

2008-01-02 Thread Matt Hollingsworth
Andreas Jung wrote:
 
...
 Larger JS frameworks like Dojo tend to be split across several files and
 directories. The fun starts when such frameworks load/reload stuff
 using relative URLs. A co-worker using Dojo intensively had to invest
 some time in order to integrate such a JS monster properly. As far as I
 remember Extjs also uses multiple files (but not as much as Dojo
 does)..so please check in advance.

 Another point: consider using CMF and putting your library files into a
 directory system view on the filesystem. This makes your life much
easier.

Or just upload via WEBDAV.
One of the biggest advantages of Zope is the isolation from physical
file system.

Regards
Tino

Hello,

Thanks to everyone for your help.  I thought about Tres's solution and
quickly discovered that I would be doing a *lot* of clicking/typing if I
wanted to upload all of the files necessary to make the ExtJS framework
available.   I'll look into the WebDAV idea; I didn't think of that until
you mentioned it.

However, I came up with another possible solution that may be generally
useful after some (a lot actually) of coaxing.  I threw this together in the
time between my new year's festivities :) : it's incredibly sloppy at the
moment, but before I worried about cleaning it up, I wanted to get some
feedback from you guys about it (pardon the annoying formatting problems):

def package_home(gdict):
Returns the location of the file that calls the function.  You 
must pass it globals() as the argument for it to work right.  

:Parameters:
gdict : dict
A dictionary containing all of the global definitions for the
module.  This is accessible via the python built-in function
globals()

:return: The fully qualified path for the directory in which the calling
module is residing
:rtype: string



filename = gdict[__file__] 
return os.path.dirname(filename)


class FileSystemResource(Implicit,Item):
FileSystemResource is meant to make it easy to access file system
objects
through Zope.  It works by taking over the object traversal process to
recursively return resources, simulating a directory structure, until
it finally reaches the end (__call__()), when it accesses the file
and returns it.

If you do 

js = FileSystemResource()

in the class that you are publishing, then 

http://www.domain.com/yourId/js/all.js

would return the contents of all.js.

:Authors: - Matt
:Date: 2007-1-1


def
__init__(self,path,name,cache=True,persist=False,sync=True,rootdir=package_h
ome(globals())):
Create a FileSystemResource with the specified name
self.path = path
self.name= name
self.cache = cache
self.persist = persist
self.sync = sync
self.rootdir = rootdir

if cache:
self._cache = {}
#   
# Hooks #
#

def __before_publishing_traverse__(self,obj,REQUEST):
Just print the request path so I can debug easier
#print REQUEST.path:  + str(REQUEST.path)
print REQUEST.path:  + str(REQUEST.path)


def __bobo_traverse__(self, request, key):
Takes the key, meshes it with the request, and
generates the object from that

full_path = os.path.join(self.path,key)

if self.cache:
if self._cache.has_key(key):
o = self._cache[key]
fsr = o[0]
mod_time = o[1]
file_size = o[4]
#If modtime isn't the same, refresh the resource

latest_access_time = time.localtime()
num_accesses = o[3] + 1

new_entry =
(fsr,mod_time,latest_access_time,num_accesses,file_size)


self._cache[key] = new_entry
return new_entry[0]
else:
o = FileSystemResource(full_path,name=None)
#Set the modification time
mod_time = time #TODO: Implement
latest_access_time = time.localtime()
num_accesses = 1
file_size = 0 #TODO: Implement
self._cache[key] =
(o,mod_time,latest_access_time,num_accesses,file_size)
return o

o = FileSystemResource(full_path)
print Returning object  + str(o)
return o

###
# ! End Hooks #
###

def cleanCache(self):
#TODO: Not implemented (placeholder vars so I'll remember what's in
the tuples)
for key,value in self._cache.items():
file_location = key
file_obj = value[0]
mod_time = value[1]
latest_access_time = value[2]
num_accesses = value[3]
file_size = value[4]
 

Re: [Zope] Best Practice for including Javascript in Zope Applications

2008-01-02 Thread Tom Von Lahndorff

On Jan 1, 2008, at 7:20 PM, Matt Hollingsworth wrote:


Hello,

I’m new to developing for zope, and I have a quick question  
regarding some best practices when using Javascript in zope  
applications.


I would like to use Ext JS (http://www.extjs.com/ ) in an  
application that I am writing.  It is a fairly extensive library, so  
I didn’t really want to copy/paste every single file into a dtml  
method.  I looked all over the place for some discussion on this  
subject, but only found things relating to plone (which apparently  
has a javascript registry); however, I wish to stay away from plone  
for this particular application.


What should I do to use these libraries?  Is there a canned solution  
for this sort of thing?


Thank you much!

-Matt
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )



You can ftp the files to a static directory on the file system and  
use LocalFS to access them.

http://wiki.zope.org/zope2/LocalFS___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Defining a Variable

2008-01-02 Thread Victor Subervi
Hi;
I have this in a page template:

html
body
table
 tr
  td tal:define=num python:here.scripts.getQuote
   span metal:use-macro=here/en-us/quotes/?num/macros/quote /br /
   div align=center
span class=text
 a href=quotes.pt target=_topbThe quotes/b/a
/span
   /div
  /td
 /tr
/table
/body
html

Now, I thought that was the correct way to call the variable num (that is,
with the question mark: ?num). Apparently, I'm mistaken. I've even tried
defining it this way:

  td tal:define=num python:str(11)
to make sure that num was properly assigned. What am I missing? Also, if I
have a dir called scripts in which getQuote exists, and scirpts is in
the path, shouldn't that notation work okay?
TIA,
Victor
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Defining a Variable

2008-01-02 Thread Andreas Jung



--On 2. Januar 2008 14:44:24 -0400 Victor Subervi [EMAIL PROTECTED] 
wrote:




  td tal:define=num python:here.scripts.getQuote


As in nearly all other programming languages methods are called
with parentheses - or?



   span metal:use-macro=here/en-us/quotes/?num/macros/quote /br /




Now, I thought that was the correct way to call the variable num (that
is, with the question mark: ?num). Apparently, I'm mistaken. I've even
tried defining it this way:


Not sure if using the '?' will working within a TALES expression. It will
at least work as the last item with an expression. However it will fail in 
general if 'num' is an integer.


-aj



pgppLEvqehHSY.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Best Practice for including Javascript in Zope Applications

2008-01-02 Thread Tim Nash
I am writing an application that uses extjs as the front end and zope
on the back and they work together really well.
I am using a webserver to server the extjs library and everything else
comes out of zope.  So far I have had no trouble with relative links
or files broken up in different locations. It may be because I have
fully committed to having an extjs front end. I typically serve a page
out of zope, it calls the extjs library as well as custom JavaScript
files. The web2.0 style page then makes multiple xhr calls back to
zope to load smaller html and json fragments. Works like a charm and
has the additional benefit of letting me cache the majority of the
front end in the webserver and in the users browser.

Have fun because you have just come across a wonderful
combination...extjs and zope!
Tim


On Jan 2, 2008 6:38 AM, Tom Von Lahndorff [EMAIL PROTECTED] wrote:

 On Jan 1, 2008, at 7:20 PM, Matt Hollingsworth wrote:

  Hello,
 
  I'm new to developing for zope, and I have a quick question
  regarding some best practices when using Javascript in zope
  applications.
 
  I would like to use Ext JS (http://www.extjs.com/ ) in an
  application that I am writing.  It is a fairly extensive library, so
  I didn't really want to copy/paste every single file into a dtml
  method.  I looked all over the place for some discussion on this
  subject, but only found things relating to plone (which apparently
  has a javascript registry); however, I wish to stay away from plone
  for this particular application.
 
  What should I do to use these libraries?  Is there a canned solution
  for this sort of thing?
 
  Thank you much!
 
  -Matt
  ___
  Zope maillist  -  Zope@zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )


 You can ftp the files to a static directory on the file system and
 use LocalFS to access them.
 http://wiki.zope.org/zope2/LocalFS___

 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )

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


RE: [Zope] Best Practice for including Javascript in Zope Applications

2008-01-02 Thread Matt Hollingsworth
Yep!  I have had very good luck with it so far; my little hack that I posted
works like a (klutzy) charm and ExtJS is great with zope.  The ExtJS folks
are very well organized, and the library is quite powerful.  It's working
great.  However, my application doesn't have quite the segregation that
yours does; ExtJS and zope (DTML in particular) are much more intermingled,
and can't be easily separated.  This application is actually a frontend for
a Java library that controls instruments at CERN (a research lab I work
for), and I love the solution that it has presented.  It works like a charm.
(in case you're curious, it makes use of a wonderful python library I ran
across called JPype (http://jpype.sourceforge.net) to execute the Java code)

I am going to be accessing Zope through apache with the VHM, but there are
multiple reasons why I don't want to serve the js through apache.  This same
principle is the reason that I don't want to upload things through FTP or
WebDAV.  I'm making a product, and I would like to keep it atomic, i.e., I
want the only install procedure to be copy product folder to
instance/Products.  Uploading via WebDAV, or hosting the javascript using
separate software, defeats that purpose.  

The solution that Tom proposed (LocalFS) seems to be what I want, but the
problem is that I think it is way too out of date; it crashed my zope server
(2.10.5) when I installed it.  It says nothing can be found after I add an
instance through the ZMI, and this is after I fixed a deprecated import (
from OFS.content_types import find_binary - from zope.app.content_types
import find binary).  I had to completely remove the product to get my Zope
instance to work again.  

I'm getting the feeling that there isn't really a (recent) canned solution
for accessing file system content, which is... strange at best, considering
all the power that zope has at its disposal.  You would think that accessing
the file system would be present just because it is so simple to do.  I'm
not complaining, as I'm *very* happy with zope, I'm just surprised :).  I
realize that zope's principle is to store everything in the database, but
this is unacceptable for content such as video files, right?  I mean the
ZODB file would be absolutely humongous (and slow?  I don't know for sure
how it's implemented).

If there isn't already a working solution, I would be happy to come up with
one; I could just hack out the parts of LocalFS that work, add a few
features, and repackage it into a new product.  It's not difficult to do (my
little trivial solution already would work fine if I did a non-dumb
implementation of the file-serving logic), and as much as I would like to
use it for other projects, it would be worth my time.  For example, I want
to make a little video/music server as a personal project unrelated to my
current one, and I really don't want to store things in the ZODB if I can
help it... 1 video = +1 gig ZODB? :S

I don't know much about zope obviously, so if I get some vehement objections
to this route, I'll pick another :)

Thanks!

-Matt 

-Original Message-
From: Tim Nash [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 02, 2008 2:03 PM
To: Tom Von Lahndorff
Cc: Matt Hollingsworth; zope@zope.org
Subject: Re: [Zope] Best Practice for including Javascript in Zope
Applications

I am writing an application that uses extjs as the front end and zope
on the back and they work together really well.
I am using a webserver to server the extjs library and everything else
comes out of zope.  So far I have had no trouble with relative links
or files broken up in different locations. It may be because I have
fully committed to having an extjs front end. I typically serve a page
out of zope, it calls the extjs library as well as custom JavaScript
files. The web2.0 style page then makes multiple xhr calls back to
zope to load smaller html and json fragments. Works like a charm and
has the additional benefit of letting me cache the majority of the
front end in the webserver and in the users browser.

Have fun because you have just come across a wonderful
combination...extjs and zope!
Tim


On Jan 2, 2008 6:38 AM, Tom Von Lahndorff [EMAIL PROTECTED] wrote:

 On Jan 1, 2008, at 7:20 PM, Matt Hollingsworth wrote:

  Hello,
 
  I'm new to developing for zope, and I have a quick question
  regarding some best practices when using Javascript in zope
  applications.
 
  I would like to use Ext JS (http://www.extjs.com/ ) in an
  application that I am writing.  It is a fairly extensive library, so
  I didn't really want to copy/paste every single file into a dtml
  method.  I looked all over the place for some discussion on this
  subject, but only found things relating to plone (which apparently
  has a javascript registry); however, I wish to stay away from plone
  for this particular application.
 
  What should I do to use these libraries?  Is there a canned solution
  for this sort of thing?
 
  Thank you much!
 
  -Matt
  

[Zope] looking for an easier way

2008-01-02 Thread David Bear
I'm writing an exteranl method to store data into a sql data base. In my
first attempts to do this I just had an external method dump whatever
zope gave it to a text file, then looked. I came up with the following
to split up the data the zope handed the external method and store it
an sql. This works. However, I'm thinking there must be an easier way
to capture what zope hands and external method.

Here's what I'm using now:

def ddmapper(data):
''' maps dictionary keys and vals handed from zope to
dictionary keys and vals which are attribute names of the table use to 
store the data
puts a pickle of all data into a zo -- zopeobject
nonce is a uniquifier
'''
now = DT.now()
pbuf = sio.StringIO()
pickle.dump(data, pbuf)
nonce = '%s:%s:%s:%s' % (now.year, now.month, now.day, now.second)
attribs = dict(fname=data['first-name'],
   lname=data['last-name'],
   email=data['email-address'],
   studentid=data['student-id-number'],
   accomodations=data['will-special-assistance-be-required'],
   describe=data['describe-special-accomodations-needed'],
   degree=data['degree'][0],
   number=data['number-attending'],
   key=nonce,
   zo=pbuf.getvalue()
   )
del(pbuf)
del(now)
return attribs


There must be an easier way to 'know' what zope is giving me and grab
the correct dictionary that has the form data in it. anyone have any
pointers?

-- 
David Bear
phone:  602-496-0424
fax:602-496-0955
College of Public Programs/ASU
University Center Rm 622
411 N Central
Phoenix, AZ 85007-0685
 Beware the IP portfolio, everyone will be suspect of trespassing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] looking for an easier way

2008-01-02 Thread Jonathan


- Original Message - 
From: David Bear [EMAIL PROTECTED]

To: zope Zope@zope.org
Sent: Wednesday, January 02, 2008 6:10 PM
Subject: [Zope] looking for an easier way

There must be an easier way to 'know' what zope is giving me and grab
the correct dictionary that has the form data in it. anyone have any
pointers?


A couple of ideas:

(i) use Zope marshalling to store all fields from an html form into a record 
(dictionary)

(ii) get all form fields via:  REQUEST.form.keys()


hth

Jonathan 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )