Re: [Zope] How can I import python script into another python script?

2006-08-31 Thread Gabriel Genellina

At Thursday 31/8/2006 18:11, Ferhat Ayaz wrote:


I have a Script (Python) called 'functions'.
I want to import this script into another Script
(Python).

import Include.Functions.requests

says

import of "Include.Functions.requests" is unauthorized


You don't import it; you can reference it as 
container.Include.Functions.whatever(args...)



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


___
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] How can I import python script into another python script?

2006-08-31 Thread Ferhat Ayaz
Hi,

I have a Script (Python) called 'functions'.
I want to import this script into another Script
(Python).

import Include.Functions.requests

says

import of "Include.Functions.requests" is unauthorized

Where am I wrong?

Thanks,
Ferhat

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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 )


Re: [Zope] DTML -> ZPT

2006-08-31 Thread Tino Wildenhain
Antonio Beamud Montero wrote:
> Is this the equivalence?
> 
> 
> 
> 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] Change the encoding of a single ZPT page

2006-08-31 Thread Andreas Jung



--On 31. August 2006 19:28:54 +0200 Dieter Maurer <[EMAIL PROTECTED]> 
wrote:



Luiz Fernando Bernardes Ribeiro wrote at 2006-8-30 14:08 -0300:

2006/8/29, Andreas Jung <[EMAIL PROTECTED]>:
...
After trying a lot of things, I found the problem is really in the
zpublisher realm, no matter what kind of encoding trick I use, even with
a python script, the output is converted to the default encoding if I
use any variable or dynamic value from the database.


If you were right (which I still hope you won't) than someone
severely misunderstood the meaning of "default".



I think he is not right.

-aj

pgpWj2XpNIGCc.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] DTML -> ZPT

2006-08-31 Thread Andreas Jung



--On 31. August 2006 20:36:32 +0200 Antonio Beamud Montero 
<[EMAIL PROTECTED]> wrote:



Is this the equivalence?





No.

-aj



pgpXRn0rh7dcJ.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 )


[Zope] DTML -> ZPT

2006-08-31 Thread Antonio Beamud Montero
Is this the equivalence?



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] Change the encoding of a single ZPT page

2006-08-31 Thread Dieter Maurer
Luiz Fernando Bernardes Ribeiro wrote at 2006-8-30 14:08 -0300:
>2006/8/29, Andreas Jung <[EMAIL PROTECTED]>:
> ...
>After trying a lot of things, I found the problem is really in the
>zpublisher realm, no matter what kind of encoding trick I use, even with a
>python script, the output is converted to the default encoding if I use any
>variable or dynamic value from the database.

If you were right (which I still hope you won't) than someone
severely misunderstood the meaning of "default".

   "default" means "use this unless you get get told to use something
   else".

   And if I tell the ZPublisher (in the "Content-Type" header),
   that the charset is different from its "default-zpublisher-encoding",
   then it has to respect this.

   If it does not, then please file a bug report.



-- 
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] accelerating Zope restart

2006-08-31 Thread Paul Winkler
On Thu, Aug 31, 2006 at 12:23:06PM +0100, Chris Withers wrote:
> [EMAIL PROTECTED] wrote:
> >My Data.fs is huge (21GB) because it contains many video files. This is 
> >not a
> >problem in itself, however, I recently had to reboot my machine and now 
> >zope
> >takes around 20-30 minutes to restart. Is a fstest automatically done ? How
> >could I accelerate the restarting, if possible ? 
> 
> Use ZEO.

I can see how that could let Zope restart faster.  But 
ZEO can have *severe* performance implications for large blobs
such as videos.  See the bottom of
http://www.slinkp.com/code/zopestuff/blobnotes
 
Maybe worth noting that DirectoryStorage starts up fast regardless of
storage size.  http://dirstorage.sourceforge.net/

It also does not require RAM proportional to storage size.
It is also very reliable and has some other nice features.
The downsides:
- You need a filesystem that can handle very large number of tiny files.
- Packing is VERY slow (21 GB could easily take all night).
- Somewhat slower than Filestorage in general.
- Requires more disk space (+30%).

This page is old but maybe still useful:
http://cvs.zope.org/ZODB3/Doc/storages.html?rev=1

-- 

Paul Winkler
http://www.slinkp.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] Re: accelerating Zope restart

2006-08-31 Thread Rocky Burt
On Thu, 2006-31-08 at 12:18 +0100,
[EMAIL PROTECTED] wrote:
> Hi,
> 
> My Data.fs is huge (21GB) because it contains many video files. This is not a
> problem in itself, however, I recently had to reboot my machine and now zope
> takes around 20-30 minutes to restart. Is a fstest automatically done ? How
> could I accelerate the restarting, if possible ? 

I highly recommend you use some sort of external storage product to
store such large files.  Perhaps Chris McDonough's blob product might
fit well here.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
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: accelerating Zope restart

2006-08-31 Thread Rocky Burt
On Thu, 2006-31-08 at 12:52 +0100,
[EMAIL PROTECTED] wrote:
> > 
> > Zope does maintain a Data.fs.index file. If it becomes corrupt e.g. through 
> > an unclean shutdown then Zope will recreate it by scanning the whole 
> > Data.fs file when starting Zope the next time. This will take some 
> > timeso before rebooting you should shutdown down your Zope properly.
> > 
> 
> OK, I have two questions about shutting down zope:
> 
> - To cleanly shut down zope daemon, is "zopectl stop" enough ?

Yes.


> - If zope runs in the foreground, how to shut it down cleanly ? CTRL+C won't 
> do
> it I guess ?

I always thought CTRL+C would do it actually.  It's only a force kill
with -9 that will kill it without shutting down properly.  But you could
always go to the Control_Panel in the zmi and do a shutdown from there,
that is for certain safe.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
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 MsSQL from Zope blocks

2006-08-31 Thread robert rottermann
Hi there,
this is not really an Zope Questions, I just  hope somebody of you cold
give me a hint.
I already asked egenix (as we are using mxODBC) they could not think of
a good reason. (but said to try a comercial odbc bridge).

thanks for any pointers.
robert

using mxOdbc our database application embeded in zope often blocks when 
executing
a simple statement as the following:

query = "select fieldValue from tblATicketDetailDynamicForm \
where ticketDetailNoFk in (1683)"


calling sql_q_nil(query) (from the following class)
sometimes just never returns.


The problem seems to be, that after a certain amount of queries MsSQL is in a
state, that it does not allow any access to the querried database.

what we do in our application is:
- get a RedDbQuery object (class at the end of the posting)
- execute the statement with RedDbQuery.sql_q_nil(query)
- release the connection.

this approach worked fine using MySQL. However we did not cross any
OS bounderies and did not use ODBC.

we are using:

mxODBC Zope DA 1.0.8 License Information:
1 Zope Instance License for redcor <[EMAIL PROTECTED]> [6522021#1]
SuSE 9.3
UnixOdbc 2.8.8
freetds 0.64



class RedDbQuery:
  "All queries are routed through this class."

  def __init__( self ):
self._connection = getConnection()
#print 'getConnection() returns', _connection
self._cursor = self._connection.cursor()
#print 'cursor() returns', _cursor

  def dispose( self ):
releaseConnection( self._connection, self._cursor )

  def cursor( self ):
return self._cursor

  #
  # query level zero -- the one and only query execution method:
  #
  def sql_q_nil( self, query, verbose = None ):
"Generic SQL query, expecting no return."
if verbose: print( query )
r = self._cursor.execute( query )
#print 'execute() returns', r
return r

  more methods ..






begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
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] accelerating Zope restart

2006-08-31 Thread egf05
> 
> Zope does maintain a Data.fs.index file. If it becomes corrupt e.g. through 
> an unclean shutdown then Zope will recreate it by scanning the whole 
> Data.fs file when starting Zope the next time. This will take some 
> timeso before rebooting you should shutdown down your Zope properly.
> 

OK, I have two questions about shutting down zope:

- To cleanly shut down zope daemon, is "zopectl stop" enough ?

- If zope runs in the foreground, how to shut it down cleanly ? CTRL+C won't do
it I guess ?

Eric
___
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] accelerating Zope restart

2006-08-31 Thread Jonathan


- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Thursday, August 31, 2006 7:18 AM
Subject: [Zope] accelerating Zope restart



Hi,

My Data.fs is huge (21GB) because it contains many video files. This is 
not a
problem in itself, however, I recently had to reboot my machine and now 
zope
takes around 20-30 minutes to restart. Is a fstest automatically done ? 
How

could I accelerate the restarting, if possible ?



You may also want to have a look at the localfs product which would allow 
you to store your large video files on the local file system instead of 
inside the ZODB (but still access them as if they were stored in the ZODB).


http://sourceforge.net/projects/localfs


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 )


Re: [Zope] accelerating Zope restart

2006-08-31 Thread egf05
> Zope does maintain a Data.fs.index file. If it becomes corrupt e.g. through 
> an unclean shutdown then Zope will recreate it by scanning the whole 
> Data.fs file when starting Zope the next time. This will take some 
> timeso before rebooting you should shutdown down your Zope properly.
> 
> -aj

OK, thanks.

Eric
___
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] accelerating Zope restart

2006-08-31 Thread Chris Withers

[EMAIL PROTECTED] wrote:

My Data.fs is huge (21GB) because it contains many video files. This is not a
problem in itself, however, I recently had to reboot my machine and now zope
takes around 20-30 minutes to restart. Is a fstest automatically done ? How
could I accelerate the restarting, if possible ? 


Use ZEO.

Make sure the storage server shuts down properly so it saves its indexes 
to disk.


cheers,

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 )


Re: [Zope] accelerating Zope restart

2006-08-31 Thread Andreas Jung



--On 31. August 2006 12:18:24 +0100 [EMAIL PROTECTED] wrote:


Hi,

My Data.fs is huge (21GB) because it contains many video files. This is
not a problem in itself, however, I recently had to reboot my machine and
now zope takes around 20-30 minutes to restart. Is a fstest automatically
done ? How could I accelerate the restarting, if possible ?



Zope does maintain a Data.fs.index file. If it becomes corrupt e.g. through 
an unclean shutdown then Zope will recreate it by scanning the whole 
Data.fs file when starting Zope the next time. This will take some 
timeso before rebooting you should shutdown down your Zope properly.


-aj

--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope & Plone development, Consulting


pgppYVpplEYVN.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 )


[Zope] accelerating Zope restart

2006-08-31 Thread egf05
Hi,

My Data.fs is huge (21GB) because it contains many video files. This is not a
problem in itself, however, I recently had to reboot my machine and now zope
takes around 20-30 minutes to restart. Is a fstest automatically done ? How
could I accelerate the restarting, if possible ? 

Thanks a lot for any advice,
Eric
___
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: Packing Data.fs

2006-08-31 Thread Chris Withers

Jens Vagelpohl wrote:

It's also f'ing slow and doesn't scale ;-)


Translation: In our experience, large databases with a lot of objects 
can lead to very slow operations, such as packing and backing up the 
data. This might be improved by using a file  system designed for many 
small files, but on ext3 the whole thing became a terrible dog. This 
slowness also appears when doing automated buildouts which create lots 
of objects. Even simple stuff like just instantiating a Plone portal 
from the ZMI was noticeably slower.


I thought my version was much more understandable ;-)

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] LocalFS cut and paste across LocalFS instaces

2006-08-31 Thread Dennis Allison

I have a zope system (Zope 2.9.2) that needs to be able to cut and paste
between different instances of LocalFS.  Specifically, I have two LocalFS
instances, LFS1 and LFS2.  The two local files systems are disjoint and
image different parts of the local file directory tree.  What I need to be
able to do is to cut and paste files and directories fom one instance to
the other.  The clipboard object appears to be missing adequate contest to
cut and paste across instances.  Has anyone modified the LocalFS product
to handle, say, cutting a a file from LFS1 and pasting it into LFS2?


-- 

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