[Zope] Structured Text Question

2006-01-25 Thread Asad Habib
Is there any way to have multiple lines of empty space between two 
sections of text in a Structured Text document? I looked on Google but did 
not find any answers to this question. However, I did notice that others 
had asked the question as well. Is this a shortcoming of Structured Text? 
Any help would be appreciated. Thanks.


- Asad
___
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] Structured Text Question

2006-01-25 Thread Asad Habib
Well, this decision was not made by me and I cannot override it. Given 
that I have to use Structured Text, is there a solution to this problem? 
Thanks.


- Asad


On Wed, 25 Jan 2006, Jaroslav Lukesh wrote:


Is there any way to have multiple lines of empty space between two
sections of text in a Structured Text document? I looked on Google but did
not find any answers to this question. However, I did notice that others
had asked the question as well. Is this a shortcoming of Structured Text?
Any help would be appreciated. Thanks.


Why?

Use stylesheets or fulltext replacement of some shortword to DIV with
appropriate geometry.

JL.


___
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] Re: Java vs Zope

2006-01-06 Thread Asad Habib
Well, the class is simply a construct that Java uses to define an object. 
Also, the concept of object is well defined in Java which makes it easier 
for the programmer to know what can and cannot be done. In Python, it is 
not as explicit. Java is a programming language and hence cannot be 
compared directly to a scripting language such as Python or PHP. These 2 
types are designed for different purposes.


- Asad


On Fri, 6 Jan 2006, bruno desthuilliers wrote:


Rocky Burt wrote:

David H wrote:


Python is also object oriented.  In python, x = 10 creates an object not
a simple type - if I recall the same is true in Java.



In fact this is not quite right.  In java, int x = 10 produces a
primitive type.  Not a class instance at all.  In this case x has no
methods which can be invoked whatsoever.  This is something I always
despised about Java.  Java does have an Integer class but that is
generally only used when an object is absolutely required (which is not
often).  Java 1.5 did introduce autoboxing on primitive types so that
int's and Integer instances could be interchanged without knowing in
method calls, etc ... but x is still not an object with methods.

In fact I'd go as far as to say that Python seems *more* object-oriented
than Java.


s/seems/is/

Java is more class-oriented than object-oriented. It forces you to use
classes for everything, but not everything is an object. Python let you
use the paradigm that seems appropriate for the task at hand, but still
everything is an object (really everything : functions, classes and
modules too...)


--
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.com
___
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] Re: Java vs Zope

2006-01-06 Thread Asad Habib
Actually, that's not true. Languages such as Perl and Python were designed 
to write scripts, not to code entire applications. Python is an exception 
because it can be successfully used to code large applications, unlike 
some other scripting languages. So it's best to call Python a scripting 
programming language because it has this dual nature. All said and done, 
I prefer to use Java over Python for large applications simply because 
it's cleaner and has mechanisms in place that support reusability of 
components and extensibility. Also, OO concepts such as abstraction and 
inheritance are well defined in Java.


Also, both compiled and interpreted languages have their advantages and 
disadvantages.


- Asad


On Fri, 6 Jan 2006, Lennart Regebro wrote:


On 1/6/06, Asad Habib [EMAIL PROTECTED] wrote:

Well, the class is simply a construct that Java uses to define an object.
Also, the concept of object is well defined in Java which makes it easier
for the programmer to know what can and cannot be done. In Python, it is
not as explicit. Java is a programming language and hence cannot be
compared directly to a scripting language such as Python or PHP. These 2
types are designed for different purposes.


The difference between scripting languages and programming languages
are an illusion. :)

Python is intepreted while Java is compiled. That makes Python
superiour in many ways. ;-)

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/



___
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] Java vs Zope

2006-01-03 Thread Asad Habib
From my experience, Java development has been a lot faster when 
applications have middle to high level complexity. Since Java is 
inherently object-oriented, reusability is much easier to achieve then 
when using Zope. Also, Java has mature development and debugging 
environments and well organized API's. Zope is seriously lacking in this 
regard.


Zope is good for building simple interfaces but any application that does 
data processing and requires session management should be left for Java. 
The closest comparison to Zope that I can think of is PHP.


Again, this is just my opinion based on my own experiences.

- Asad


On Tue, 3 Jan 2006, Jonathan Cyr wrote:

I always found the bytecode aspect of Java annoying... having to compile 
without the advantages in speed of a compiled language.


Interesting, though, I host a WebSphere 6.0 app in Java... The Websphere 
install is littered with python files, for install/setup purposes...   hmm


two cents,

-Jon

David Johnson wrote:
Andreas and others, 
Thanks for your response.  I think my confusion lies in the idea that not

everyone uses Java (though they may talk about it). I do not see everyone
using Java.  In fact I see very few large or successful companies using it.
Even Sun and IBM develop their core components in C/C++.  GNU, Linux, MySQL
... all C/C++.  Ditto Oracle.  In my market, we've been able to easily
outpace and perform competitors going the J2EE route, and for a lot less
money.

In regards to web development, the list of technologies being implemented 
is
overwhelming.  It took extensive research to find and settle down to Zope. 
In my research, I found it took 57 complex files to develop a simple and

ugly J2EE application to display a list of cars from a database (various
Ant, xml, jar, war and other files).  In Zope this can be done in 2 
objects,

and it integrates nicely with apps like Dreamweaver, so it looks and feels
nice.

We often find the need to integrate with other products and when we do,
either the product's manufacturer a) is interested in market share, or b)
they avoid change. 
For companies who are into market share they often use a greatest common

denominator technology such as C, Perl, or HTTP.  Java does not play nicely
here.

Companies who avoid change usually do so because they produce large-scale 
or

small market systems, and change is too expensive and hard.  In this case
Java, again, does not play nicely.

In Java it seems that not only do you have to figure how to interface with
others, you have to figure out how to do it in Java as well (which is not
trivial).  Zope and Python seem better at translating thoughts into code,
and doing so with the right balance of object orientation, and scalability.

Zope provides a solid framework for development and scalability, while
providing mechanisms to include and deploy very custom and specific 
features

in a standardized way.



 -Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] Sent: Sunday, January 
01, 2006 4:03 PM

To: David Johnson; zope@zope.org
Subject: Re: [Zope] Java vs Zope



--On 1. Januar 2006 14:04:16 -0600 David Johnson [EMAIL PROTECTED] 
wrote:




Good afternoon.  I am new to Zope and I am excited about its
possibilities. We are an ASP and plan to use Zope to improve our
development process. I see that many people use J2EE based environments.
Does anyone
understand why?  Why would anyone use Java?



Because everyone uses Java! When you work in an environment were Java is 
already used then you usually use Java instead of Python. And there are 
environments where Python is possibly the better solution. You just need to 
compare the efforts to integrate an existing environment with your 
solution...then you choose your tools.


-aj

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




--
Jonathan Cyr
http://www.cyr.info
http://www.weddingweblog.com
[EMAIL PROTECTED]



___
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] Saving a Rendered DTML Document

2005-12-08 Thread Asad Habib
Hello. The PHP script that I use relies on a path to locate the HTML file 
on the file system and since the DTML document is a Zope object, it does 
not have access to that. I also tried using a Zope File object as well as 
a DTML document that is part of a Local File System. Using a Zope File 
object does not work since the ouput of a rendered DTML document is text 
and providing the PHP script a Zope File filled with plain text does not 
work. The same goes for a DTML document that is part of a Local File 
System, once the document is rendered it is plain text.


- Asad


On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote:


Asad Habib wrote:


Hello. I have a DTML document which contains some DTML, but mostly HTML. I
want to save the HTML contents of this DTML document once it is rendered by 
Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this 
document will only contain HTML offcourse and must be since it will be used 
by a PHP script). Is there a way to do this so every time the former 
changes, the latter is updated as well? Any help would be appreciated. 
Thanks.


How does the PHP read the file? Why can't PHP read the file through the web, 
where it will be rendered.


Robert Munro

Ps. ZPT is a replacement for DTML, and is no help with your problem.



___
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] Saving a Rendered DTML Document

2005-12-08 Thread Asad Habib

Hello. Thanks for your input. I tried doing this but it didn't work.

- Asad


On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote:


Asad Habib wrote:

Hello. The PHP script that I use relies on a path to locate the HTML file 
on the file system and since the DTML document is a Zope object, it does 
not have access to that. I also tried using a Zope File object as well as a 
DTML document that is part of a Local File System. Using a Zope File object 
does not work since the ouput of a rendered DTML document is text and 
providing the PHP script a Zope File filled with plain text does not work. 
The same goes for a DTML document that is part of a Local File System, once 
the document is rendered it is plain text.


Normally in PHP if you replace the file path with a URL starting http:// (or 
ftp:// etc.) it will fetch the file from the web instead of the file system, 
no problem.


Robert Munro



___
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] Broken Pipe Error

2005-12-08 Thread Asad Habib
Hi Dieter. Thanks for the input. Why would the reader die, though? I am 
running Mac OS X Tiger, if that helps any. Thanks.


- Asad


On Thu, 8 Dec 2005, Dieter Maurer wrote:


Asad Habib wrote at 2005-12-7 16:47 -0500:

I am using Maik Jablonski's python script to convert from html to pdf in
conjunction with the htmldoc product. FYI, I am running Mac OS X
Tiger. When I run the script, I get the following error which is being
generated by line 20 of the script:

IOError: [Errno 32] Broken pipe


This means that you try to write into a pipe when the reading end
of this pipe was closed (probably because the reader died).

--
Dieter


___
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] Saving a Rendered DTML Document

2005-12-07 Thread Asad Habib
Hi. I have never used ZPT before, but from what I read, it seems like I 
can include the contents of a rendered DTML document (i.e. HTML only) in a 
Page Template by using tal:content. Am I correct? Also, if you could 
point me to an example, that would help. Thanks.


- Asad


On Wed, 7 Dec 2005, Chris Withers wrote:

Is there any particular reason why you posted this message twice, 5 hrs 
apart?


Asad Habib wrote:

Hello. I have a DTML document which contains some DTML, but mostly HTML. I
want to save the HTML contents of this DTML document once it is rendered by 
Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. 


Just render it into a File object using a python script. Run the python 
script as part of your processing that changes the DTML document or what the 
DTML document renders


You could, of course, stop hurting yourself and replace the DTML document 
with a ZPT...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
  - http://www.simplistix.co.uk



___
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] Broken Pipe Error

2005-12-07 Thread Asad Habib
I am using Maik Jablonski's python script to convert from html to pdf in 
conjunction with the htmldoc product. FYI, I am running Mac OS X 
Tiger. When I run the script, I get the following error which is being 
generated by line 20 of the script:


IOError: [Errno 32] Broken pipe

line 20 is as follows: stin.write(html)

The script is as follows:

import AccessControl, os

def html2pdf(self):
 html2pdf converts a HTML-Page to a PDF-Document 

securityContext=AccessControl.getSecurityManager()

if securityContext.checkPermission('View', self):

if self.meta_type=='Folder':
			html = 
self.index_html(self,self.REQUEST,self.REQUEST.RESPONSE)

else:
			html = 
self(self,self.REQUEST,self.REQUEST.RESPONSE)


		(stin,stout) = os.popen2('htmldoc --footer  :  --webpage 
-t pdf --quiet --jpeg -')

stin.write(html)
stin.close()
pdf = stout.read()
stout.close()


self.REQUEST.RESPONSE.setHeader('Content-type','application/pdf')

self.REQUEST.RESPONSE.setHeader('Content-disposition','inline; 
filename=%s.pdf' % (self.getId()))


return pdf

else:
raise AccessControl.Unauthorized

Any help would be appreciated. Thanks.

- Asad
___
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] Saving a Rendered DTML Document

2005-12-06 Thread Asad Habib
Hello. I have a DTML document which contains some DTML, but mostly HTML. I 
want to save the HTML contents of this DTML document once it is rendered 
by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. 
this document will only contain HTML offcourse and must be since it will 
be used by a PHP script). Is there a way to do this so every time the 
former changes, the latter is updated as well? Any help would be 
appreciated. Thanks.


- Asad
___
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] Saving a Rendered DTML Document

2005-12-06 Thread Asad Habib

Hello. I have a DTML document which contains some DTML, but mostly HTML. I
want to save the HTML contents of this DTML document once it is rendered 
by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. 
this document will only contain HTML offcourse and must be since it will 
be used by a PHP script). Is there a way to do this so every time the 
former changes, the latter is updated as well? Any help would be 
appreciated. Thanks.


- Asad

___
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] Accessing a Subfolder of a Parent Folder

2005-12-05 Thread Asad Habib
How do I access the subfolder of a parent folder? I am using the following 
but cannot seem to access the folder object:


dtml-call REQUEST.set('parentFolder', PARENTS[2].id + 'Test')
dtml-call REQUEST.get('parentFolder').initialize_vars()

I get the following error:

Error Type: AttributeError
Error Value: 'str' object has no attribute 'initialize_vars'

I understand that a DTML method cannot be called on a string, but how do I 
obtain the object that represents the subfolder 'Test'? Any help would be 
appreciated. Thanks.


- Asad


___
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] Re: PHPGateway Issues

2005-12-01 Thread Asad Habib
Hello Wei. Okay, please keep me posted when you determine what the problem 
is. If anyone else on the Zope group has experienced a similar 
problem, please let me know. Thanks.


On Thu, 1 Dec 2005, Wei He wrote:


Quoting Asad Habib [EMAIL PROTECTED]:


Hello. The message came from Mac OS X. Also, how do I resolve this issue?
I am currently also running phpMyAdmin so I know for a fact the PHP-CGI is
present. Also, PHP is currently running on its own (i.e. not behind
Apache).


It looks like I'll have to get a Mac OS X box to find out how PHP is running on
it.
Will take some time.

Best,

--
Wei He
IT Manager
IED (Institute for Environment  Development)
Tel: +86-10-51319216
Web: http://www.ied.org.cn




___
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] Re: PHPGateway Issues

2005-12-01 Thread Asad Habib
Okay, so now I am getting the following error when trying to serve 
phpmyadmin via PHPGateway:


File not found!
The URL you have loaded has not been found on this server.

The docroot is set to '/Library/WebServer/Documents/phpmyadmin' and 
phpmyadmin has an index.php file. Any help would be greatly appreciated.


- Asad


On Thu, 1 Dec 2005, Asad Habib wrote:

Hello Wei. Okay, please keep me posted when you determine what the problem 
is. If anyone else on the Zope group has experienced a similar problem, 
please let me know. Thanks.


On Thu, 1 Dec 2005, Wei He wrote:


Quoting Asad Habib [EMAIL PROTECTED]:


Hello. The message came from Mac OS X. Also, how do I resolve this issue?
I am currently also running phpMyAdmin so I know for a fact the PHP-CGI is
present. Also, PHP is currently running on its own (i.e. not behind
Apache).


It looks like I'll have to get a Mac OS X box to find out how PHP is 
running on

it.
Will take some time.

Best,

--
Wei He
IT Manager
IED (Institute for Environment  Development)
Tel: +86-10-51319216
Web: http://www.ied.org.cn




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


[Zope] Re: PHPGateway Issues

2005-12-01 Thread Asad Habib
I think I may have to compile PHP with the 'cgi-recirect' option enabled. 
I created a PHParser object, placed a 'Hello World' PHP script in it, and 
then tried to view it. I got the same error as before:


'/usr/bin/php' may not be a PHP-CGI program. The result from the program 
is empty(0 byte).


Do you know if this will interfere with the Apache PHP module in any way? 
Also, it is okay to have two PHP's installed on a single machine? 
And what are the security implications of running PHP this way? Thanks.


On Thu, 1 Dec 2005, Wei He wrote:


Hi,

'[EMAIL PROTECTED]' is a mailing list of some PHParser/PHPGateway users.

Does anyone on the list have some experiences on running PHParser on Mac OS X?


Quoting Asad Habib [EMAIL PROTECTED]:


Hello Wei. Okay, please keep me posted when you determine what the problem
is. If anyone else on the Zope group has experienced a similar
problem, please let me know. Thanks.

On Thu, 1 Dec 2005, Wei He wrote:


Quoting Asad Habib [EMAIL PROTECTED]:


Hello. The message came from Mac OS X. Also, how do I resolve this issue?
I am currently also running phpMyAdmin so I know for a fact the PHP-CGI

is

present. Also, PHP is currently running on its own (i.e. not behind
Apache).


It looks like I'll have to get a Mac OS X box to find out how PHP is

running on

it.
Will take some time.

Best,

--
Wei He
IT Manager
IED (Institute for Environment  Development)
Tel: +86-10-51319216
Web: http://www.ied.org.cn








--
Wei He
IT Manager
IED (Institute for Environment  Development)
Tel: +86-10-51319216
Web: http://www.ied.org.cn




___
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] PHPGateway Issues

2005-11-30 Thread Asad Habib
Hello. I am trying to use PHPGateway with Zope but I get the following 
error:


'/usr/bin/php' may not be a PHP-CGI program. The result from the program 
is empty(0 byte).



Also, sometimes I get the error 'File Not Found' that is thrown by 
the browser. Has anyone successfully used this product with Zope and are 
there documents which cover common errors and solutions?


Lastly, I am running on Mac OS X Tiger Server which comes 
with PHP 4 and I am running Zope 2.7.0. Can I use this copy of PHP or do I 
have to download and build my own from source? Any help would be 
appreciated. Thanks.

___
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] Error Executing runzope Command

2005-11-29 Thread Asad Habib
Hello. I just installed Zope 2.7.0 on Mac OS X Tiger and I running it with 
MacPython 2.3.3. I installed Zope in /usr/local. Now, when I try to 
execute './runzope' or './zopectl start', I receive the following error:


Fatal Python error: PyThreadState_Get: no current thread

Has anyone experienced this before? If so, could you please tell me why 
this error is being thrown? Thank you.


- Asad
___
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] Error Executing runzope Command

2005-11-29 Thread Asad Habib
Thanks for your input. So, I went ahead and installed Zope 2.8.4 and the 
configuration script used Python 2.3.5 which comes installed with Mac OS X 
Tiger. Now, when I try to execute ./runzope, I get the following error:


File /usr/local/lib/python/persistent/interfaces.py, line 19, in ?
from zope.interface import Interface
ImportError: No module named zope.interface

Why is this module missing?

- Asad


On Tue, 29 Nov 2005, Andreas Jung wrote:




--On 29. November 2005 10:43:23 -0500 Asad Habib [EMAIL PROTECTED] 
wrote:



Hello. I just installed Zope 2.7.0 on Mac OS X Tiger and I running it
with MacPython 2.3.3. I installed Zope in /usr/local. Now, when I try to
execute './runzope' or './zopectl start', I receive the following error:


Zope 2.7.0? This version is *very* ancient. Try a recent version (2.8.4) and 
possibly use a Python version compiled from the Python sources directly.


-aj



___
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] Zope Version

2005-11-28 Thread Asad Habib
How do I determine which version of Plone/Zope I am using? Is there a 
version file somewhere in the Zope hierarchy? I can't seem to find one.

Any help would be appreciated. Thanks.

- Asad
___
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] Zope Version

2005-11-28 Thread Asad Habib
Hi. I looked in there already but it does not state the version. This is 
what it says:


Zope Version (unreleased version, python 2.3.3, darwin)

- Asad


On Mon, 28 Nov 2005, Doyon, Jean-Francois wrote:


Just look in the Management Interface, in the Control Panel ...

J.F.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Asad
Habib
Sent: November 28, 2005 3:54 PM
To: zope@zope.org
Subject: [Zope] Zope Version

How do I determine which version of Plone/Zope I am using? Is there a
version file somewhere in the Zope hierarchy? I can't seem to find one.
Any help would be appreciated. Thanks.

- Asad
___
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] HTML to PDF.

2005-11-23 Thread Asad Habib
Fernando, take a look at HTML_ToPDF (www.rustyparts.com). It's free and it 
works.


- Asad


On Wed, 23 Nov 2005, Fernando Lujan wrote:


Andreas Jung wrote:



--On 23. November 2005 16:08:42 -0200 Fernando Lujan 
[EMAIL PROTECTED] wrote:



Chris Withers wrote:


A tool to do what, specifically?



A Front-End to design the PDF format. Like Jasper Reports, but one which
works with python and reporlab. :)



Did you look at XSLFO as suggested. It really works


Yes and I found this product: 
http://www.stylusstudio.com/xml_screenshots.html


With this tool, I can create a HTML export to a XML. And with this XML, can I 
generate dinamic PDF files on the fly with the reportlab's software?


Thanks in advance.

Fernando Lujan
___
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] HTML to PDF.

2005-11-23 Thread Asad Habib
Fernando. There is a python equivalent of the PHP script HTML_ToPDF.php 
that you can use as well. And it's free as well!


- Asad


On Wed, 23 Nov 2005, Fernando Lujan wrote:


Andreas Jung wrote:



--On 23. November 2005 16:45:00 -0200 Fernando Lujan 
[EMAIL PROTECTED] wrote:




Yes and I found this product:
http://www.stylusstudio.com/xml_screenshots.html



You should read my former answer carefully. I pointed you to the
tool CSSTOXSLFO and the Xinc PDF converter (www.lunasil.com).
Both are Java based applications and can be integrated into Python
and Zope.


Hi Andreas,

Yes... I saw this tool. But the company wants a python solution for this... 
:(


Thanks anyway. :)

Fernando Lujan

___
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] HTML to PDF.

2005-11-23 Thread Asad Habib

No need to bake a pie when you can buy one at the grocery store!

Asad :)

On Wed, 23 Nov 2005, Andreas Jung wrote:




--On 23. November 2005 17:05:36 -0200 Fernando Lujan 
[EMAIL PROTECTED] wrote:



Yes... I saw this tool. But the company wants a python solution for

this... :(



Then bake one :-)

-aj

___
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] HTML to PDF.

2005-11-23 Thread Asad Habib

Absolutely! Google is a man's best friend.

- Asad


On Wed, 23 Nov 2005, Tino Wildenhain wrote:


Am Mittwoch, den 23.11.2005, 14:29 -0500 schrieb Asad Habib:

No need to bake a pie when you can buy one at the grocery store!


You can? Where is the store where I can buy the python wrapped
render/print lib of gecko/mozilla please?





___
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] Passing Parameters to External Methods

2005-11-17 Thread Asad Habib
Actually, I not receiving an error anymore but a pdf is not being 
generated either. When I test my External Method directly through the 
ZMI the only thing that is returned is the following line:


__builtin__.html2pdf instance at 0x4a1e8f0

I have tried passing in the parameters using the request object as well as 
hard-coding them in but in both cases a pdf is not generated and there is 
no traceback. The code for my External Method is as follows:


# Added by Asad Habib to allow use as an External Method from Zope
def createHtmlToPdf(self):
   return 
html2pdf('/Applications/Plone2/Library/Software/Zope270/Zope/error.html', 
'orbweaver.engin.umich.edu', 
'/Applications/Plone2/Library/Software/Zope270/Zope/error.pdf')


# This is based on a php script (c) Jason Rust [EMAIL PROTECTED]
# See that script for licensing
# Convert an HTML file to a PDF file using html2ps and ps2pdf

from tempfile import gettempdir, mkstemp
import os
import re
from re import IGNORECASE, DOTALL
from copy import copy

class html2pdf:
  def __init__(self, in_htmlFile, in_domain, in_pdfFile = None):
Constructor

in_htmlFile The full path to the html file to convert
in_domain The default domain name for images that have a relative path
in_pdfFile (optional) The full path to the pdf file to output. If not 
given then we create a temporary name.



self.htmlFile = '' #The full path to the file we are parsing
self.pdfFile = '' #The full path to the output file
self.tmpDir = gettempdir() #The temporary directory to save 
intermediate files

self.debug = False #Whether or not we are in debug mode
self.htmlErrors = False #Whether we output html errors
self.defaultDomain = '' #The default domain for relative images
self.html2psPath = '/usr/bin/html2ps' #The path to the html2ps 
executable

self.ps2pdfPath = '/usr/bin/ps2pdf' #The path to the ps2pdf executable
self.getUrlPath = '/usr/bin/curl -i' #The path to your get URL 
program, including options to get headers
self.useCSS = True #Whether or not to try and parse the CSS in the 
html file and use it in creating the pdf

self.additionalCSS = '' #Other styles to use when parsing the page
self.pageInColor = True #Show the page in color?
self.grayScale = False #Show the images be in grayscale?
self.scaleFactor = 1 #Scale factore for the page
self.underlineLinks = None #Whether to underline links or not
self.headers ={} #The header information  # self.headers was 
array('left' = '$T', 'right' = '$[author]')
self.footers ={} #The footer information  #self.footers was 
array('center' = '- $N -')

self.html2psrc = 
option:
  titlepage: 0; /* do not generate a title page */
  toc: 0;   /* no table of contents */
  colour: %pageInColor%; /* create the page in color */
  underline: %underlineLinks%; /* underline links */
  grayscale: %grayScale%; /* Make images grayscale? */
  scaledoc: %scaleFactor%; /* Scale the document */
}
package:
  geturl: %getUrlPath%; /* path to the geturl */
}
showurl: 0; /* do not show the url next to links */
 #Default html2ps configuration that we use (is parsed before being 
used, though)

self.makeAbsoluteImageUrls = True
Whether HTML_ToPDF should replace all relative image paths in the
  input HTML document with the default domain or not. Switch this to
  false if you want to convert a HTML file which is located locally in 
the

  file system and is not reachable via HTTP but all the images used
  in the HTML file are located correctly according to their relative
  paths.
self.ps2pdfIncludePath = '' #Include path for ps2pdf (-I option), for 
example to specify where to search for font files, etc.
self._htmlString = ''; #We use this to store the html file to a string 
for manipulation


self.htmlFile = in_htmlFile
self.defaultDomain = in_domain

if in_pdfFile is None:
  tempFile = mkstemp(prefix = 'PDF-', dir = self.tmpDir)
  os.close(tempFile[0]) #close the file handle which is opened by 
mkstemp

  self.pdfFile = tempFile[1]
else:
  self.pdfFile = in_pdfFile


#==
  def addHtml2PsSettings(self, in_settings):
Adds on more html2ps settings to the end of the default set of 
settings.

self.html2psrc += \n + in_settings


#==
  def setDebug(self, in_debug):
Sets the debug variable: true (debugging on) or false (debugging 
off).

self.debug = in_debug


#==
  def setHeader(self, in_attribute, in_value):
Sets a header.

@param string $in_attribute One of the header attributes that html2ps 
accepts.  Most

[Zope] Passing Parameters to External Methods

2005-11-16 Thread Asad Habib
Hello. I am trying to use the Python version of the PHP script written by 
Jason Rust called 'HTML_ToPDF.php'. I have represented this script using 
an External Method since it uses functions, such as open, which cannot be 
used in Zope Python scripts for security reasons. The python code for the 
script consists of a class definition and so I have had to create a python 
function which instantiates an object of this class. However, I am having 
toruble passing parameters to this function which are needed by the 
class constructor to instantiate an object of this class. Can parameters 
be passed to external methods? Whenever I try to pass parameters to 
function 'createHtmlToPdf', Zope returns an error stating that no such 
function exists. Other on the hand, if I pass no parameters this call is 
successful but the init function fails complaining that three parameters 
are expected. I have provided a snippet of my code below. Any help would 
be greatly appreciated. Thanks.


- Asad



def createHtmlToPdf(in_htmlFile, in_domain, in_pdfFile):
   return html2pdf(in_htmlFile, in_domain, in_pdfFile)

# This is based on a php script (c) Jason Rust [EMAIL PROTECTED]
# See that script for licensing
# Convert an HTML file to a PDF file using html2ps and ps2pdf

from tempfile import gettempdir, mkstemp
import os
import re
from re import IGNORECASE, DOTALL
from copy import copy

class html2pdf:
  def __init__(self, in_htmlFile, in_domain, in_pdfFile = None):
Constructor

in_htmlFile The full path to the html file to convert
in_domain The default domain name for images that have a relative path
in_pdfFile (optional) The full path to the pdf file to output. If not 
given then we create a temporary name.


___
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] Passing Parameters to External Methods

2005-11-16 Thread Asad Habib

Hi Cameron. You are right but the self parameter is implicitly passed.

- Asad


On Wed, 16 Nov 2005, J Cameron Cooper wrote:


Asad Habib wrote:
Hello. I am trying to use the Python version of the PHP script written by 
Jason Rust called 'HTML_ToPDF.php'. I have represented this script using an 
External Method since it uses functions, such as open, which cannot be used 
in Zope Python scripts for security reasons. The python code for the script 
consists of a class definition and so I have had to create a python 
function which instantiates an object of this class. However, I am having 
toruble passing parameters to this function which are needed by the class 
constructor to instantiate an object of this class. Can parameters be 
passed to external methods? Whenever I try to pass parameters to function 
'createHtmlToPdf', Zope returns an error stating that no such function 
exists. Other on the hand, if I pass no parameters this call is successful 
but the init function fails complaining that three parameters are expected. 
I have provided a snippet of my code below. Any help would be greatly 
appreciated. Thanks.



def createHtmlToPdf(in_htmlFile, in_domain, in_pdfFile):
   return html2pdf(in_htmlFile, in_domain, in_pdfFile)


Functions in external methods generally start with the 'self' parameter. Your 
description of the error messages doesn't entirely support my supposition, 
but you could try it.


--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
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 )


[Zope] htmltopdf

2005-11-14 Thread Asad Habib
Has anyone successfully used htmltopdf, a PHP script written by Jason Rust 
(www.rustyparts.com) to convert an HTML file to PDF, with Zope? In 
particular, I wanted to find out if anyone had used the python equivalent 
of this PHP script. I am currently in the process of trying this and if 
anyone has already done it, their input/help would be appreciated. Thanks.


- Asad
___
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] Database Connections

2005-08-10 Thread Asad Habib
Has anyone had problems with Zope hanging on to database connections? I am
using MySQL with Zope and when I last checked there were 25 connections
(both active and sleeping connections included). I only have 5
Zope database objects so I don't know how so many connections were
created. Any help would be greatly appreciated. Thanks.

- Asad
___
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] Traceback Lines for Send Mail Error

2005-07-25 Thread Asad Habib
Well, nothing has changed in the mail server setup so I don't know why
this error is being thrown. Where can I access smtplib (I cannot locate
this Python library in my Zope hierarchy)? Someone else also reported
receiving this error as I discovered on Google but the issue was not
resolved. Any help would be appreciated. Thanks.

- Asad


On Sun, 24 Jul 2005, Dieter Maurer wrote:

 Asad Habib wrote at 2005-7-22 09:19 -0400:
 If it helps, the last lines in the traceback are as follows:
 
 Module DocumentTemplate.DT_String, line 474, in __call__
 Module Products.MailHost.SendMailTag, line 116, in render
 Module Products.MailHost.MailHost, line 125, in send
 Module Products.MailHost.MailHost, line 144, in _send
 Module smtplib, line 254, in __init__
 gaierror: (7, 'No address associated with nodename')

 This error comes from your mail server.
 Checks its (the mail server's) documentation to make sense of it.


 --
 Dieter

___
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] Traceback Lines for Send Mail Error

2005-07-25 Thread Asad Habib
Maurer, I am certain that this is a Zope issue that has not been figured
out as yet. I was even able to connect to my SMTP server via the Terminal
application on a Mac. Do I have any other options?

- Asad

___
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] Traceback Lines for Send Mail Error

2005-07-25 Thread Asad Habib
Thanks Dieter. You hit the nail on the head. socket.gethostname() is not
returning the full canonical name of the machine. But how do I correct
this? Any idea?

- Asad


On Mon, 25 Jul 2005, Dieter Maurer wrote:

 Asad Habib wrote at 2005-7-25 09:24 -0400:
 Well, nothing has changed in the mail server setup so I don't know why
 this error is being thrown.

 I have been wrong. The message does not originate from your
 mail server.

 Where can I access smtplib (I cannot locate
 this Python library in my Zope hierarchy)?

 smtplib is part of the Python runtime library.

 Someone else also reported
 receiving this error as I discovered on Google but the issue was not
 resolved. Any help would be appreciated.

 Looking at the smtplib source and your traceback reveals:

   smtplib.SMTP.__init__ is trying to determine the
   local hostname. The code looks like this:

 if local_hostname is not None:
 self.local_hostname = local_hostname
 else:
 # RFC 2821 says we should use the fqdn in the EHLO/HELO verb, and
 # if that can't be calculated, that we should use a domain literal
 # instead (essentially an encoded IP address like [A.B.C.D]).
 fqdn = socket.getfqdn()
 if '.' in fqdn:
 self.local_hostname = fqdn
 else:
 # We can't find an fqdn hostname, so use a domain literal
 addr = socket.gethostbyname(socket.gethostname())
 # your exception is raised in the line above
 self.local_hostname = '[%s]' % addr


 This means that you local system is in a strange state.
 Probably, it is unable to determine its hostname.

 Try (in an interactive Python interpreter):

 import socket
 socket.gethostname()
 socket.gethostbyname(socket.gethostname())


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


[Zope] Send Mail Tag

2005-07-22 Thread Asad Habib
My current Zope setup uses SSL and FastCGI. For some reason,
dtml-sendmail is no longer working for me. The error I get is the
following:

Exception Type  gaierror
Exception Value (7, 'No address associated with nodename')

I have confirmed the name of our mail server with IT staff so the problem
is not in the nodename but for some reason the name is not being mapped to
the correct address. Is this because of FastCGI? Has anyone experienced
something similar?

If this continues to be a problem, what are my other options?

Any help would be greatly appreciated. Thanks.

- Asad
___
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] Traceback Lines for Send Mail Error

2005-07-22 Thread Asad Habib
If it helps, the last lines in the traceback are as follows:

Module DocumentTemplate.DT_String, line 474, in __call__
Module Products.MailHost.SendMailTag, line 116, in render
Module Products.MailHost.MailHost, line 125, in send
Module Products.MailHost.MailHost, line 144, in _send
Module smtplib, line 254, in __init__
gaierror: (7, 'No address associated with nodename')

Thanks.


- Asad
___
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] String Replacement Function

2005-07-14 Thread Asad Habib
Is it possible to replace more than 1 type of character in a string
simultaneously? If so, what is the correct syntax for this? I am currently
using the following:

dtml-var _.string.replace(testString, _.chr(10), 'br /')

For this string, I want to replace both newlines and carriage returns
(_.chr(13)) with the break tag.

Any help would be appreciated. Thanks.

- Asad
___
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] Z MySQL Database Connections

2005-07-13 Thread Asad Habib
I have two Z MySQL database connection objects that I have to use in the
same DTML method. How do I specify that I want to use one or the other?
Any help would be appreciated. Thanks.

- Asad
___
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] Z MySQL Database Connections

2005-07-13 Thread Asad Habib
Hello. Please disregard my previous message as this is specified in the Z
SQL method. Thanks.

- Asad


On Wed, 13 Jul 2005, Asad Habib wrote:

 I have two Z MySQL database connection objects that I have to use in the
 same DTML method. How do I specify that I want to use one or the other?
 Any help would be appreciated. Thanks.

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


[Zope] Checking for an Integer Argument

2005-06-30 Thread Asad Habib
Is there any way to check if an argument is an integer in Python?
Offcourse, there is the int function but it chokes when passed an argument
that is not a string and then the user is inconvenienced (it throws a
ValueError to be specific). I guess I could check each digit of the
integer to determine if its ASCII value falls within the appropriate range
and if each digit passed this test, then the entire number would be an
integer. Does anyone know of a simpler way that involves use of a
predefined Python function? Likewise, does anyone know if a similar
function exists to detect floating point numbers? Any help would be
appreciated. Thanks.

- Asad
___
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] Exiting a Loop

2005-06-15 Thread Asad Habib
Is there a way to exit a dtml-in based loop? I searched numerous
resources but did not find anything on this topic that relates to the
dtml-in tag. Any help would be greatly appreciated. Thanks.

- Asad
___
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] Exiting a Loop

2005-06-15 Thread Asad Habib
Yes, I should not be doing this but I am using DTML not ZPT and since DTML
provides programming functionality and in this case the ability to loop,
there should be a way to exit a loop as well.

- Asad


On Wed, 15 Jun 2005, J Cameron Cooper wrote:

 Asad Habib wrote:
  Is there a way to exit a dtml-in based loop? I searched numerous
  resources but did not find anything on this topic that relates to the
  dtml-in tag. Any help would be greatly appreciated. Thanks.

 There is no such provision. You shouldn't be doing such a thing anyway:
 that sounds like programming. Keep logic in programming languages (like
 Python scripts) and display the results in a template (ZPT or DTML).

   --jcc

 --
 Building Websites with Plone
 http://plonebook.packtpub.com/

 Enfold Systems, LLC
 http://www.enfoldsystems.com

___
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] Z SQL Methods and the SQL LIMIT clause

2005-05-11 Thread Asad Habib
Is there a reason why Z SQL methods do not allow the use of the LIMIT
clause? I am absolutely certain that my query has the right syntax since I
executed it against the MySQL server and it gave me the correct results.
FYI, I have provided the query below:

SELECT course_id FROM course
WHERE course_id  991000
ORDER BY course_id DESC LIMIT 1

Furthermore, Zope throws the following error when I try to test this query
via the ZMI and also when I use it in my application:

(1064, You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'LIMIT 1000' at line 3)

Any help would be appreciated. Thank you.

- Asad
___
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] Session Variable Error

2005-04-28 Thread Asad Habib
I have a session variable called 'undergraduateProjectsDirected' that I
declare using the following syntax:

dtml-call REQUEST.SESSION.set('undergradProjectsDirected', [ ])

When I try to append items to this list variable, I get the following
error:

AttributeError: 'NoneType' object has no attribute 'append'

I know for a fact that this variable exists since flushing the SESSION
attribute of the REQUEST variable using dtml-var REQUEST.SESSION
yields its name and shows that it is initially empty.

I am using the following statement to append items:

dtml-call 
(REQUEST.SESSION.get('undergraduateProjectsDirected')).append([student_name, 
description])

The strange thing is that when I change the name of this variable to
'undergradProjectsDirected', the error does not occur anymore.

Has anyone experienced something similar? I think a variable with the same
name exists (perhaps I created one in another one of my intranet
applications) and Zope is referring to the old copy instead of the newly
created one. I tried flushing the transient object container as well but
it did not make a difference.

Any help would be greatly appreciated. Thank you.

- Asad
___
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] Session Variable Error

2005-04-28 Thread Asad Habib
Actually, it does exist as I mentioned in my original message. If it did
not exist, then dtml-var REQUEST.SESSION would yield a value of None
for it. Also, if this were the case, then simply changing the name of the
variable would not solve the problem.

- Asad


On Thu, 28 Apr 2005, Andreas Jung wrote:



 --On Donnerstag, 28. April 2005 13:44 Uhr -0400 Asad Habib
 [EMAIL PROTECTED] wrote:

  I have a session variable called 'undergraduateProjectsDirected' that I
  declare using the following syntax:
 
  dtml-call REQUEST.SESSION.set('undergradProjectsDirected', [ ])
 
  When I try to append items to this list variable, I get the following
  error:
 
  AttributeError: 'NoneType' object has no attribute 'append'
 
  I know for a fact that this variable exists since flushing the SESSION
  attribute of the REQUEST variable using dtml-var REQUEST.SESSION
  yields its name and shows that it is initially empty.
 
  I am using the following statement to append items:
 
  dtml-call
  (REQUEST.SESSION.get('undergraduateProjectsDirected')).append([student_n
  ame, description])
 
  The strange thing is that when I change the name of this variable to
  'undergradProjectsDirected', the error does not occur anymore.

 Check the spelling of your session key! Of course you're getting an
 error when you are trying to append to something that does not exist.

 -aj


___
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] Session Variable Error

2005-04-28 Thread Asad Habib
Andreas, you misunderstood me. What I said is that #1 does not work but
#2 does.

#1. dtml-call REQUEST.SESSION.set('undergraduateProjectsDirected', [])

#2. dtml-call REQUEST.SESSION.set('undergradProjectsDirected', [ ])

- Asad


On Thu, 28 Apr 2005, Andreas Jung wrote:


 You said you set the variable through:

 dtml-call REQUEST.SESSION.set('undergradProjectsDirected', [ ])


 You wrote that this does not work:

 dtml-call
 (REQUEST.SESSION.get('undergraduateProjectsDirected')).append([student_name,
 description])

 Of course it does not work because in both cases the names of the session
 vars are completely different..
 so why should this work?

 -aj



 --On Donnerstag, 28. April 2005 13:56 Uhr -0400 Asad Habib
 [EMAIL PROTECTED] wrote:

  Actually, it does exist as I mentioned in my original message. If it did
  not exist, then dtml-var REQUEST.SESSION would yield a value of None
  for it. Also, if this were the case, then simply changing the name of the
  variable would not solve the problem.
 
  - Asad
 
 
  On Thu, 28 Apr 2005, Andreas Jung wrote:
 
 
 
  --On Donnerstag, 28. April 2005 13:44 Uhr -0400 Asad Habib
  [EMAIL PROTECTED] wrote:
 
   I have a session variable called 'undergraduateProjectsDirected' that I
   declare using the following syntax:
  
   dtml-call REQUEST.SESSION.set('undergradProjectsDirected', [ ])
  
   When I try to append items to this list variable, I get the following
   error:
  
   AttributeError: 'NoneType' object has no attribute 'append'
  
   I know for a fact that this variable exists since flushing the SESSION
   attribute of the REQUEST variable using dtml-var REQUEST.SESSION
   yields its name and shows that it is initially empty.
  
   I am using the following statement to append items:
  
   dtml-call
   (REQUEST.SESSION.get('undergraduateProjectsDirected')).append([studen
   t_n ame, description])
  
   The strange thing is that when I change the name of this variable to
   'undergradProjectsDirected', the error does not occur anymore.
 
  Check the spelling of your session key! Of course you're getting an
  error when you are trying to append to something that does not exist.
 
  -aj
 
 




___
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-dev] Changing the Appearance of the Contents of a Local File System Object

2003-12-12 Thread Asad Habib
Hello. I have a folder that I have created at the root
level and inside this folder I have placed one Local
File System object. The Local File System object
contains two File objects. When I view the Local File
System object by clicking on the 'View' option
provided by the management interface, I can see that
it contains two File objects. What I would like to do
is to change the way that these File objects are
displayed. Specifically, I would like to show only
certain attributes that these File objects have and
hide others. Right now, the following attributes are
shown: type, icon, size, and last modified
time(mtime). I would like to hide the size and last
modified time(mtime) attributes. I want these
attributes to be set but I do not want their values to
show.

FYI, I am using the Local File System Product. Any
help would be greatly appreciated. Thanks.

- Asad


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


[Zope-dev] Environment for Python Development

2003-12-12 Thread Asad Habib
Hello. Do any of you know of an IDE(preferably open source) that I can use
to develop/debug/test python code in? Thanks.

- Asad


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


[Zope-dev] Creating a Zope Product

2003-12-12 Thread Asad Habib
Does anyone know how to create a Zope Product? One example would be the
Local File System Object that I am using. If you could point me to some
resources that would be great. Thanks.

- Asad


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


[Zope-dev] Changing the Appearance of a Local File System Object

2003-12-11 Thread Asad Habib
Hello. I have a folder that I have created at the root
level and inside this folder I have placed one Local
File System object. The Local File System object
contains two File objects. When I view the Local File
System object by clicking on the 'View' option
provided by the management interface, I can see that
it contains two File objects. What I would like to do
is to change the way that these File objects are
displayed. Specifically, I would like to show only
certain attributes that these File objects have and
hide others. Right now, the following attributes are
shown: type, icon, size, and last modified
time(mtime). I would like to hide the size and last
modified time(mtime) attributes. I want these
attributes to be set but I do not want their values to
show. 

FYI, I am using the Local File System Product. Any
help would be greatly appreciated. Thanks.

- Asad 

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


[Zope-dev] Information on ZpdfDocument and Zpdf

2003-12-02 Thread Asad Habib
Hello. I am looking for extensive documentation on
both ZpdfDocument and Zpdf. I checked out www.zope.org
but did not find anything substantial on these
products. Your help would be greatly appreciated.
Thanks.

-Asad

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


[Zope-dev] Testing a value returned from a Zope Python Script

2003-02-04 Thread Asad Habib
Hello. I am trying to test a value returned from a
Python script using the following syntax:

dtml-if expr=dtml-call
expr=checkRowLength(fileObject_index, rowLength) ==
0
/dtml-if

checkRowLength is the name of the script. Apparently
Zope flags me with an error saying that this is an
invalid attribute tag for a dtml-if. Is there any
other way of achieving this? Any help would be
appreciated. 

-Asad

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



[Zope-dev] Creating a variable in a DTML method that may be modified

2003-02-04 Thread Asad Habib
Hello. Does anyone know how to create a variable in a
DTML method which may be updated by a Python script? I
am currently using the set method of the REQUEST
object to create a variable. However, creating a
variable in this fashion renders it permanent. Any
help would be appreciated. Thanks.

-Asad

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



[Zope-dev] Running Python Scripts via the Management Interface

2003-02-03 Thread Asad Habib
Hello. Does anyone know why the following script
stalls when I run it in Zope's Management Interface
using the 'Test' command? 

context.manage_addProperty(propertyId, propertyValue,
propertyType)

All it does is add a property to a folder. The script
does function properly and doesn't stall when I access
it from a DTML method. However, it stalls when I run
it directly. Any help would be appreciated. Thanks.

-Asad

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



[Zope-dev] Adding Properties to Folder Objects via a Zope Python Script

2003-01-30 Thread Asad Habib
Hi. I was wondering whether any of you know if it is
possible to create properties for Folder objects using
a Zope Python script that can then be invoked from a
DTML method. I know that this is possible using Zope's
management interface, but this procedure is not
scalable. Any input would be appreciated. Thanks.

-Asad

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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