[Zope] DateTime and TimeZone

2005-09-05 Thread Mark Gibson
I installed zope 2.7.6 on a windows 2000 machine.   This machine is set
to the pacific timezone.

When I run python from the command line, and check DateTime, I get: 

>>> from DateTime import DateTime
>>> DateTime()
DateTime('2005/09/06 23:55:29.620 GMT-7')

The 'GMT-7' is the Mountain timezone.  The actual time should read
 DateTime('2005/09/06 23:55:29.620 GMT-8') for the Pacific timezone.

What controls the default timezone behavior of DateTime on Windows?  How
can I get this working correctly?

Thanks,
Mark
-- 
Mark Gibson <[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] Re: StructuredDocument size reduced after 2.5.1 to 2.7.5 upgrade

2005-09-05 Thread Jaroslav Lukesh
Dne pondělí, 5. září 2005 7:59 John Schinnerer <[EMAIL PROTECTED]> 
napsal(a):
> Aloha,
>
> > maybe form trasport method too, see POST vs. GET.
>
> Form transport method is the same as before the upgrade from 2.5.1 to
> 2.7.5 - I changed nothing in my products or other code, only zope was
> upgraded.

did you use POST or GET? If yoou use GET, use POST. If you use POST, then I 
dont know.

> Did something about form transport method that would affect
> programmatic file upload size change between these two zope versions ?

With POST you can upload unlimited amount of data. With GET it is limited to 
maximal ULR length of some programs (browser/proxy/server).

-- 

Jaroslav Lukesh
  ---
  This e-mail can not contain any viruses because I use Linux
___
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: Zope scalabilty and problems

2005-09-05 Thread Dieter Maurer
Florent Guillaume wrote at 2005-9-5 16:49 +0200:
> ...
>> It is just that the CMF is unable to fix a year long bug
>
>It's not "CMF"'s fault, it's only the responsibility of Windows developers 
>running CMF. I for one couldn't care less.

Really?

   That the CMF makes an hierarchical filesystem scan for
   each access to a filesystem directory view
   should be the responsibility of the Windows developers running CMF?
   
   There are no bugs: if you meat one, it proves that you
   use the wrong system...

> ...
>>   then each access to a "filesystem directory view" triggers
>>   a hierarchical file system scan.
>> 
>>   The result is a slowdown by several orders of magnitude.
>
>I believe Tres has now fixed this.

It was not yet fixed when I made an svn checkout of the CMF 1.5 branch
about 2 weeks ago.

-- 
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] writing permissions broken

2005-09-05 Thread Dieter Maurer
Michael Lindner wrote at 2005-9-5 15:08 +1000:
>Hi, for some reason I can no longer use any scripts to create zope
>objects, including the example scripts.
>Whenever I try to create new objects, incluging using the guest-book or
>file-library examples zope asks me to login again, and does not accept
>any logins, including admin.

Cancel the login dialog and look at the error page (you hopefully get).

-- 
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] Truncating strings with DTML

2005-09-05 Thread Peter Bengtsson
easy:

You don't need to use _.string.legacy() functions. Just put your
python expression inside the quotation marks. If you're new to python,
don't let DTML be your place to learn python. Use a nice editor like
IDLE.

PS. Which scripting language did you work with before you came to Zope?

On 9/5/05, Aaron Gillette <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I'd like to take a string like:
> 
> /Computers/Data_Formats/Almost_Every_File_Format_in_the_World
> 
> and cut it down to:
> 
> /Computers/Data_Formats
> 
> using DTML.
> 
> I've tried to count to the last "/", and then truncate the string with
> ljust, like so:
> 
> 
> 
> 
> However, ljust/rjust won't truncate the string.
> 
> In the case above, I know that I want to truncate the string to 23
> characters (/Computers/Data_Formats). Is there a way to accomplish this
> in DTML? If not, any suggestions?
> 
> Thanks in advance,
> Aaron
> ___
> 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 )
> 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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] Truncating strings with DTML

2005-09-05 Thread Aaron Gillette
Hi All,

I'd like to take a string like:

/Computers/Data_Formats/Almost_Every_File_Format_in_the_World

and cut it down to:

/Computers/Data_Formats

using DTML.

I've tried to count to the last "/", and then truncate the string with
ljust, like so:




However, ljust/rjust won't truncate the string.

In the case above, I know that I want to truncate the string to 23
characters (/Computers/Data_Formats). Is there a way to accomplish this
in DTML? If not, any suggestions?

Thanks in advance,
Aaron
___
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: Zope scalabilty and problems

2005-09-05 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Florent Guillaume wrote:
> Dieter Maurer wrote:
> 
>>> I am setting up sites using Plone and am concerned to read some of the
>>> comments on it. Is it really that bad performance wise?
>>
>> No, it is not.
>>
>> It is just that the CMF is unable to fix a year long bug
> 
> 
> It's not "CMF"'s fault, it's only the responsibility of Windows
> developers running CMF. I for one couldn't care less.
> 
>> which affects Windows only when Zope is run in debug mode:
>>
>>   then each access to a "filesystem directory view" triggers
>>   a hierarchical file system scan.
>>
>>   The result is a slowdown by several orders of magnitude.

It got *much* worse when CMF shifted to use subversion, which has many
more bookkeeping files in the .svn directories.  Plone developers who
work on Windows sent up an anguished cry just after we switched over,
while they were trying to prepare their 2.1 release candidate.

> I believe Tres has now fixed this.

I applied a tourniquet, which was the major reason for pushing out the
1.5.3 release.  Mark Hammond volunteered (at the Plone Symposium in New
Orleans) to look at the feasibility of a better solution which would use
the native Win32 file monitoring APIs:

  http://www.zope.org/Collectors/CMF/367

As Chris noted, running with 'debug-mode off' also avoids this issue, if
you can't upgrade CMF for some reason (and you *should* be running this
way if performance matters, anyway).


Tres
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDHHG6+gerLs4ltQ4RAl49AJ9+R/aUhA/2UvEWEsRZKIqMnf7fRwCglVT9
4iuXchoDl+Bx6rLMrvd91JI=
=Gx7s
-END 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] Stepper1.1.0 Released!

2005-09-05 Thread Chris Withers

Stepper is a framework for performing asynchronous tasks on Zope servers.

This is a new release fixing some minor bugs and introducing some new 
features.


The major changes for this release were:

- a new 'finalise' hook has been added to steps

- an option has been added such that processing of a sequence can
  continue even if an error occurs during the processing of a particular
  object

For more information, please see: 
http://www.simplistix.co.uk/software/zope/stepper


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 )


[Zope] Re: Defining and creating a temporary storage for each user

2005-09-05 Thread Marco Bizzarri
Yes, it is this kind of problems thats most probably led us to think to
put objects on a temporary folder rather than in memory...

Regards
Marco
On 9/5/05, Florent Guillaume <[EMAIL PROTECTED]> wrote:
Marco Bizzarri wrote:> You mean mantaining just in the memory... uhmmm I should double check> with the fact that the object in memory should mantain some reference to an> object on the ZODB... which should be no problem at all.
Beware, an object stored in the ZODB cannot be used by another connection tothe database. That means, by another thread, in the most common case. Exceptif you're very sure about what you're doing, the only kinds of references to
persistent objects you should have in memory are their paths.Florent--Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D+33 1 40 33 71 59   http://nuxeo.com
   [EMAIL PROTECTED]-- Icube Srlhttp://www.icube.it/
___
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: Defining and creating a temporary storage for each user

2005-09-05 Thread Florent Guillaume

Marco Bizzarri wrote:
You mean mantaining just in the memory... uhmmm I should double check 
with the fact that the object in memory should mantain some reference to an 
object on the ZODB... which should be no problem at all.


Beware, an object stored in the ZODB cannot be used by another connection to 
the database. That means, by another thread, in the most common case. Except 
if you're very sure about what you're doing, the only kinds of references to 
persistent objects you should have in memory are their paths.


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.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 )


[Zope] Re: Zope scalabilty and problems

2005-09-05 Thread Florent Guillaume

Dieter Maurer wrote:



I am setting up sites using Plone and am concerned to read some of the
comments on it. Is it really that bad performance wise?



No, it is not.

It is just that the CMF is unable to fix a year long bug


It's not "CMF"'s fault, it's only the responsibility of Windows developers 
running CMF. I for one couldn't care less.



which affects Windows only when Zope is run in debug mode:

  then each access to a "filesystem directory view" triggers
  a hierarchical file system scan.

  The result is a slowdown by several orders of magnitude.


I believe Tres has now fixed this.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.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] Zope startup error: Archetypes: IndexError: list index out of range

2005-09-05 Thread Chris Withers

Paul Sue wrote:

OK ... But surely, there must be some way to get Zope/Plone working on Solaris!

I think we have Windows Server 2003 box I can try :) 


I'd suggest that is a better option than Solaris, there are more people 
doing it in the real world, and so you're more likely to get help if 
something DOES go wrong...


Your best bet though, if to get a commodity linux box, which that 
Win2003 box could easily be turned into ;-)


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] Python editor in zope?

2005-09-05 Thread Chris Withers

Sean Dunn wrote:

I'm new to Zope, and am getting tired of using textarea's to edit my
Python/[HD]TML code. My space-bar thumb is starting to get an unnatural
twitch, from hitting it multiple times at the beginning of every line of
code. :-) 


My advice, if you're on Windows, would be to use any editor of your 
liking (emacs is mine ;-) via WebDrive using WebDAV to get to your Zope 
server...


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] Defining and creating a temporary storage for each user

2005-09-05 Thread Marco Bizzarri
You mean mantaining just in the memory... uhmmm I should double
check with the fact that the object in memory should mantain some
reference to an object on the ZODB... which should be no problem at all.

Thanks for your input, I have to think about this possibility.

Regards
Marco
On 9/5/05, Chris Withers <[EMAIL PROTECTED]> wrote:
Marco Bizzarri wrote:> Since these are temporary data, we would like to create them in a temporay> storage, either one for each user or one for all of them.If they are temporary, then why do they need ot be stored in a storage
at all?Chris--Simplistix - Content Management, Zope & Python Consulting- http://www.simplistix.co.uk
-- Icube Srlhttp://www.icube.it/
___
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: Can I use datetime and timedelta in zope?

2005-09-05 Thread Max M

jai alai wrote:

Kaixo;

I try to use datetime and timedelta in Zope and
returns a error

Error Type: ImportError
Error Value: import of "datetime" is unauthorized

I try use datetime and timedelta in an External Method
and returns an error to 

Error Type: ImportError
Error Value: No module named datetime

There's any way to import this module in Zope or I
must create a new product for it.



Use the DateTime module in Zope. If you need datetime and timedelta, you 
can convert between DateTime and datetime with (untested):



from DateTime import DateTime
from datetime import tzinfo

ZERO = timedelta(0)
HOUR = timedelta(hours=1)
STDOFFSET = timedelta(seconds = -_time.timezone)
if _time.daylight:
DSTOFFSET = timedelta(seconds = -_time.altzone)
else:
DSTOFFSET = STDOFFSET
DSTDIFF = DSTOFFSET - STDOFFSET

class LocalTimezone(tzinfo):

"""
Timezone of the machine where the code is running
"""

def utcoffset(self, dt):
if self._isdst(dt):
return DSTOFFSET
else:
return STDOFFSET

def dst(self, dt):
if self._isdst(dt):
return DSTDIFF
else:
return ZERO

def tzname(self, dt):
return _time.tzname[self._isdst(dt)]

def _isdst(self, dt):
tt = (dt.year, dt.month, dt.day,
  dt.hour, dt.minute, dt.second,
  dt.weekday(), 0, -1)
stamp = _time.mktime(tt)
tt = _time.localtime(stamp)
return tt.tm_isdst > 0


def dt2DT(dt):
"Converts Python datetime to Zope DateTime"
try:
# convert dt to local timezone
ltz = dt.astimezone(LocalTimezone())
return DateTime(*ltz.timetuple()[:6])
except:
return DateTime(dt.year, dt.month, dt.day, 0, 0, 0)


def DT2dt(DT):
"""
Converts Zope DateTime to Python datetime, Zope DateTime is allways utc
"""
return datetime.fromtimestamp(DT.timeTime(), LocalTimezone())



--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

___
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 and creating a temporary storage for each user

2005-09-05 Thread Chris Withers

Marco Bizzarri wrote:
Since these are temporary data, we would like to create them in a temporay 
storage, either one for each user or one for all of them.


If they are temporary, then why do they need ot be stored in a storage 
at all?


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] Re: Zope scalabilty and problems

2005-09-05 Thread Chris Withers

michael nt milne wrote:

I am setting up sites using Plone and am concerned to read some of the
comments on it. Is it really that bad performance wise? 


"it depends", unless you have a lot of experience with it, Zope and CMF, 
you might well find yourself with a slow site on your hands and not many 
apparent options ;-)



I'm using
CMFMember also-why is it 'apalling'?


It's an incredibly heavyweight and inefficient solution to a problem 
that requires an extremely fast and efficient solution: user object are 
used a LOT in most Zope apps, CMFMember makes them slow, in a numbner of 
ways. Generating writes which result in AT-based member objects being 
reindexed and often resulting in conflicterrors that dramatically slow 
down a site is not a good thing...


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] Re: Zope scalabilty and problems

2005-09-05 Thread Chris Withers

Hi Dieter,

Dieter Maurer wrote:

I am setting up sites using Plone and am concerned to read some of the
comments on it. Is it really that bad performance wise?


No, it is not.


...I agree, if it is correctly set up and optimised, which isn't the 
case if someone is here complaining about performance, which sadly, new 
users blown away by Plone's functionality often are...



It is just that the CMF is unable to fix a year long bug
which affects Windows only when Zope is run in debug mode:

  then each access to a "filesystem directory view" triggers
  a hierarchical file system scan.

  The result is a slowdown by several orders of magnitude.


FWIW, my experiences with Plone are predominantly on Linux, and that's 
what my comments are based on...



The problem disappears when you either:

  *  turn off "debug mode"


Yes, this is a biggie. Thankfully, I believe newer versions of Zope ship 
with this turned off by default?


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] Can I use datetime and timedelta in zope?

2005-09-05 Thread Jonathan


- Original Message - 
From: "jai alai" <[EMAIL PROTECTED]>


I try to use datetime and timedelta in Zope and
returns a error

Error Type: ImportError
Error Value: import of "datetime" is unauthorized

I try use datetime and timedelta in an External Method
and returns an error to 

Error Type: ImportError
Error Value: No module named datetime

There's any way to import this module in Zope or I
must create a new product for it.


Have a look at:

http://zopelabs.com/cookbook/990690237


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 )


[Zope] Can I use datetime and timedelta in zope?

2005-09-05 Thread jai alai
Kaixo;

I try to use datetime and timedelta in Zope and
returns a error

Error Type: ImportError
Error Value: import of "datetime" is unauthorized

I try use datetime and timedelta in an External Method
and returns an error to 

Error Type: ImportError
Error Value: No module named datetime

There's any way to import this module in Zope or I
must create a new product for it.

Joseba.

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