[Zope-dev] Testing package & framework.py

2002-05-21 Thread Stefan H. Holek

I am in the process of modifying framework.py to support INSTANCE_HOME 
installations of Zope. This involves

a) Honouring SOFTWARE_HOME when locating the Testing package
b) Adding the instance's Products and lib/python dirs to
   Products.__path__ and sys.path respectively

You can look at a preliminary draft version here:
http://www.zope.org/Members/shh/Testing/framework.py

I am however unclear about the __name__ == '__main__' test at the beginning 
of the first half of framework.py. Is this just some kind of (redundant?) 
safeguard, or is framework.py actually ment to be imported (in some cases 
at least), contradicting the comments? And, if the latter is true, what is 
the second half supposed to do (or to avoid) when framework.py is imported 
as a module?

TIA,
Stefan

--
BLOWFISH, n. - Preference for beef


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



Re: [Zope-dev] call file.update-data question

2002-05-21 Thread Casey Duncan

On Monday 20 May 2002 09:27 pm, ch j liu wrote:
> hello ,everybody.
> 
> when I call file.update_data function ,zope need
> authenticate. even though I check all permission to a
> new user,but the user can not login .why ,what should
> I do ?
> thanks .
> zope 2.5.1 win2k professional

update_data is a private method not available in TTW code. Use 
manage_upload(file) instead.

hth,

-Casey

P.S. This is the wrong list for this question. Please direct questions about 
using Zope to [EMAIL PROTECTED]


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



[Zope-dev] ZEO & product installation Q

2002-05-21 Thread Jeremy Hylton

The documentation for ZEO contains the following note about product
installation.  The final sentence suggests that we intend to fix it,
but I don't understand the problem exactly or whether it has been
fixed.

Can anyone tell me if this warning is still relevant?

Jeremy

  Zope product installation

Normally, Zope updates the Zope database during startup to reflect
product changes or new products found. It makes no sense for
multiple ZEO clients to do the same installation. Further, if
different clients have different software installed, the correct
state of the database is ambiguous.

Zope will not modify the Zope database during product installation
if the environment variable ZEO_CLIENT is set.

Normally, Zope ZEO clients should be run with ZEO_CLIENT set so
that product initialization is not performed.

If you do install new Zope products, then you need to take a
special step to cause the new products to be properly registered
in the database.  The easiest way to do this is to start Zope
once with the environment variable FORCE_PRODUCT_LOAD set.

The interaction between ZEO and Zope product installation is
unfortunate.  In the future, this interaction will be removed by 



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



[Zope-dev] ExternalEditor & Windows

2002-05-21 Thread brian.r.brinegar.1

Hello,

I'm working on porting Casey Duncans ExternalEditor helper application to
work with Windows. I've got some stuff working, but it's far from
complete. I was wondering if anyone else was working on this? I would hate
to be duplicating efforts, but I would love to help.

-Brian





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



Re: [Zope-dev] ExternalEditor & Windows

2002-05-21 Thread Andy McKay

On May 21, 2002 09:29 am, brian.r.brinegar.1 wrote:
> Hello,
>
> I'm working on porting Casey Duncans ExternalEditor helper application to
> work with Windows. I've got some stuff working, but it's far from
> complete. I was wondering if anyone else was working on this? I would hate
> to be duplicating efforts, but I would love to help.

I was thinking of doing the same thing, but if you've done most of it... 
anything I can do to help, let me know.
-- 
  Andy McKay


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



[Zope-dev] Re: [ZODB-Dev] ZEO & product installation Q

2002-05-21 Thread Toby Dickenson

On 21 May 2002 11:25:07 -0400, Jeremy Hylton <[EMAIL PROTECTED]> wrote:

>Zope will not modify the Zope database during product installation
>if the environment variable ZEO_CLIENT is set.
>
>Normally, Zope ZEO clients should be run with ZEO_CLIENT set so
>that product initialization is not performed.

There is a problem that Zope and ZEO are using this one environment
variable to control two different things.

There was a proposal to fix this in Zope, which currently hasnt got
very far:

http://collector.zope.org/Zope/299  

Any thoughts on that proposed solution?

Toby Dickenson
[EMAIL PROTECTED]


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



Re: [Zope-dev] ExternalEditor & Windows

2002-05-21 Thread Casey Duncan

Gabriel Genellina <[EMAIL PROTECTED]> just today submitted a port 
that looks like it goes a long way toward Windows support. Attached is the 
helper app with her revisions.

Let me know if it works for you.

-Casey

On Tuesday 21 May 2002 01:08 pm, Andy McKay wrote:
> On May 21, 2002 09:29 am, brian.r.brinegar.1 wrote:
> > Hello,
> >
> > I'm working on porting Casey Duncans ExternalEditor helper application to
> > work with Windows. I've got some stuff working, but it's far from
> > complete. I was wondering if anyone else was working on this? I would hate
> > to be duplicating efforts, but I would love to help.
> 
> I was thinking of doing the same thing, but if you've done most of it... 
> anything I can do to help, let me know.
> -- 
>   Andy McKay


#!/usr/local/bin/python
##
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##

# Zope External Editor Helper Application by Casey Duncan
# Adapted for Win32 by Gabriel Genellina <[EMAIL PROTECTED]>

__version__ = '0.1'

import sys, os, stat
from time import sleep
from ConfigParser import ConfigParser
from httplib import HTTPConnection, HTTPSConnection


class Configuration:

def __init__(self, path):
# Create/read config file on instantiation
self.path = path
if not os.path.exists(path):
f = open(path, 'w')
f.write(default_configuration)
f.close()
self.changed = 0
self.config = ConfigParser()
self.config.readfp(open(path))


def __del__(self):
# Save changes on destruction
if self.changed:
self.save()

def save(self):
"""Save config options to disk"""
self.config.write(open(self.path, 'w'))
self.changed = 0


def set(self, section, option, value):
self.config.set(section, option, value)
self.changed = 1

def __getattr__(self, name):
# Delegate to the ConfigParser instance
return getattr(self.config, name)

def getAllOptions(self, meta_type, content_type):
"""Return a dict of all applicable options for the
   given meta_type and content_type
"""
opt = {}
sep = content_type.find('/')
general_type = '%s/*' % content_type[:sep]
sections = ('general', 
'meta-type:%s' % meta_type,
'content-type:%s' % general_type,
'content-type:%s' % content_type)
for section in sections:
if self.config.has_section(section):
for option in self.config.options(section):
opt[option] = self.config.get(section, option)
return opt
 

class ExternalEditor:

saved = 1

def __init__(self, input_file):
try:
# Read the configuration file
config_path = os.path.expanduser('~/.zope-external-edit')
self.config = Configuration(config_path)

# Open the input file and read the metadata headers
in_f = open(input_file, 'rb')
metadata = {}

while 1:
line = in_f.readline()[:-1]
if not line: break
sep = line.find(':')
key = line[:sep]
val = line[sep+1:]
metadata[key] = val
self.metadata = metadata

self.options = self.config.getAllOptions(metadata['meta_type'],
   metadata.get('content_type',''))

# Write the body of the input file to a separate file
if sys.platform == 'win32':
import random
import tempfile
tempfile.mktemp() # init module
from urllib import unquote

body_file = unquote(self.metadata['url'][7:])
p = body_file.rfind('/')
if p>0: body_file=body_file[p+1:]
ext = self.options.get('extension')
if ext and not body_file.endswith(ext):
body_file = body_file + ext
body_file_full = os.path.join(tempfile.tempdir, body_file)
ok = not os.access(body_file_full, os.F_OK)
i = 10
while (not ok) and (i>0):
body_file_full = os.path.join(tempfile.tempd

Re: [Zope-dev] ExternalEditor & Windows

2002-05-21 Thread Joachim Schmitz

Hi,

great to hear, I just wanted to write a mail to the list asking for a joint 
effort for bringing ExternalEditor to Windows. I personally cannot offer 
any help, except testing it, since I am working on linux.
I have EE installed and it works like charm, it is the solution for a 
problem, Zope has suffered from for a long time, and which gives a total 
new view to the Zope-IDE issue.

One hint thought for the Windows-helper app, it should possibly not require 
python at least not with tkinter build in. If it would run and install one 
"pure" windows, that would be best.




--On Dienstag, Mai 21, 2002 11:29:39 -0500 "brian.r.brinegar.1" 
<[EMAIL PROTECTED]> wrote:

> Hello,
>
> I'm working on porting Casey Duncans ExternalEditor helper application to
> work with Windows. I've got some stuff working, but it's far from
> complete. I was wondering if anyone else was working on this? I would hate
> to be duplicating efforts, but I would love to help.
>
> -Brian
>
>
>
>
>
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )



Mit freundlichen Grüßen  Joachim Schmitz

AixtraWare Ingenieurbüro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven
Telefon: +49-2464-8851, FAX: +49-2464-905163

Key fingerprint = DA10 CC82 62F8 1DBB 39A1  1EDC 725B 3317 A8D7 C3A6
Keyserver: http://www.keyserver.net/en/


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



Re: [Zope-dev] ExternalEditor & Windows

2002-05-21 Thread Casey Duncan

On Tuesday 21 May 2002 01:39 pm, Joachim Schmitz wrote:
> Hi,
> 
> great to hear, I just wanted to write a mail to the list asking for a joint 
> effort for bringing ExternalEditor to Windows. I personally cannot offer 
> any help, except testing it, since I am working on linux.
> I have EE installed and it works like charm, it is the solution for a 
> problem, Zope has suffered from for a long time, and which gives a total 
> new view to the Zope-IDE issue.
> 
> One hint thought for the Windows-helper app, it should possibly not require 
> python at least not with tkinter build in. If it would run and install one 
> "pure" windows, that would be best.

I totally agree. And I still intend to deliver one that runs native on 
windows, probably just using the windows scripting host. 

This version will hopefully tide people over for the time being. 

I also am thinking along the same lines with this being a new way to approach 
an IDE. from the bottom up if you will, built as smaller pieces working 
together with the web rather than trying to write it in one broad stroke 
(which has always failed thus far).

-Casey


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



Re: [Zope-dev] ExternalEditor & Windows

2002-05-21 Thread Joachim Schmitz



--On Dienstag, Mai 21, 2002 14:00:59 -0400 Casey Duncan <[EMAIL PROTECTED]> 
wrote:

> On Tuesday 21 May 2002 01:39 pm, Joachim Schmitz wrote:
>> Hi,
>>
>> great to hear, I just wanted to write a mail to the list asking for a
>> joint  effort for bringing ExternalEditor to Windows. I personally
>> cannot offer  any help, except testing it, since I am working on linux.
>> I have EE installed and it works like charm, it is the solution for a
>> problem, Zope has suffered from for a long time, and which gives a total
>> new view to the Zope-IDE issue.
>>
>> One hint thought for the Windows-helper app, it should possibly not
>> require  python at least not with tkinter build in. If it would run and
>> install one  "pure" windows, that would be best.
>
> I totally agree. And I still intend to deliver one that runs native on
> windows, probably just using the windows scripting host.
>
> This version will hopefully tide people over for the time being.
>
> I also am thinking along the same lines with this being a new way to
> approach  an IDE. from the bottom up if you will, built as smaller pieces
> working  together with the web rather than trying to write it in one
> broad stroke  (which has always failed thus far).

you exactly express my ideas ;-)



Mit freundlichen Grüßen  Joachim Schmitz

AixtraWare Ingenieurbüro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven
Telefon: +49-2464-8851, FAX: +49-2464-905163

Key fingerprint = DA10 CC82 62F8 1DBB 39A1  1EDC 725B 3317 A8D7 C3A6
Keyserver: http://www.keyserver.net/en/


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



[Zope-dev] Presider la France en grand et autrement !

2002-05-21 Thread Mailer

Chers compatriotes,

Le 5 mai dernier au soir, vous vous etes tous rejouis
comme nous de voir
triompher, avec Jacques Chirac, les traditionnelles
valeurs de tolerance
et d'hospitalite de la Republique contre le fascisme au
front bas, et
d'abord contre l'exclusion raciste de nos amis immigres,
qui ne
representent - somme toute - que l'avant-garde de la
misere du monde et
auxquels il importe donc d'ouvrir au large, des a present,
les portes de
notre societe, ainsi qu'en temoigne largement l'actualite,
surtout celle
des faits divers.

Reprenant a son compte - et a celui de la droite d'extreme
centre-gauche
- les meilleures propositions de la Gauche Plurielle, ce
en quoi il ne
faisait d'ailleurs que repondre au voeu de la
quasi-totalite des
Francais, le Premier Ministre, Jean-Pierre Raffarin, s'est
prononce sans
ambiguite - avec l'appui explicite, naturellement, du
President de la
Republique - POUR LE DROIT DE VOTE DES ETRANGERS. Il
importe donc - en
vue d'assurer le succes de cette reforme bienvenue parmi
d'autres - de
plebisciter les candidats de l'Union de la Majorite
Presidentielle aux
prochaines elections legislatives.

Cet appel s'adresse surtout a vous, Francais qui
travaillez et payez des
impots (et qui - malheureusement - etes encore
majoritaires pour quelque
temps dans votre pays). Sans votre adhesion active et
enthousiaste,
cette reforme citoyenne serait vouee a l'echec. Vous aurez
donc a coeur
de repondre "Present" pour en permettre l'adoption, comme
vous saurez
repondre "Present" lorsqu'il s'agira d'en gerer les
incidences
previsibles ou non. A cette fin, vous voterez tous
ensemble, tous
ensemble pour les candidats de la majorite presidentielle,
qui ne vous
proposent ni plus ni moins que le maintien de l'excellent
cap pris par
la France depuis vingt ans et davantage en ce qui concerne
l'integration des immigres (vous n'etes pas sans savoir
combien le
modele d'"integration a la francaise" fait l'admiration du
monde
entier).

On ne saurait trop insister sur la puissante motivation
que donnera aux
jeunes desoeuvres des banlieues et aux malheureux
deracines de Sangatte
- tous en proie au racisme hideux de la population locale
et aux
inadmissibles brutalites d'une police de plus en plus
arrogante - le
fait de savoir qu'ils ne sont plus rejetes et qu'ils
peuvent compter sur
le soutien sans faille d'une immense majorite de la
population
francaise, a commencer par les forces vives du pays.

Ainsi aurez-vous l'assurance, chers compatriotes, que vos
impots seront
bien depenses, comme il le sont deja en vacances a la
neige, a la plage
ou a la montagne pour les pauvres jeunes des quartiers
sensibles, en
attendant la generalisation et la systematisation de ce
genre de mesure,
qui releve de la plus elementaire justice sociale.

Souvenez-vous que nous devons a Jacques Chirac le
regroupement familial,
qui a tant fait pour l'enrichissement du pays par l'apport
d'immigres
travailleurs, pacifiques, honnetes et patriotes envers
leur Algerie
natale ! Faites en sorte que la France s'engage enfin
resolument a
devenir davantage pluriethnique, multiculturelle,
metissee, tolerante,
citoyenne et genereuse ; faites en sorte qu'elle regarde
l'avenir avec
confiance : votez pour les candidats de l'Union de la
Gauche de la
Majorite Presidentielle !

Union de la Majorite Presidentielle,
Tous ensemble avec Jacques Chirac.



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