Re: [Zope3-dev] test.py renamed

2005-10-10 Thread Martijn Faassen

Jim Fulton wrote:


A better change would be to arrange for the root directory to be excluded
from the Python path. In general, any script we use should, by default,
exclude its directory from sys.path.


Maybe this only turns up if you have a package layout where the 
__init__.py is in the same place as the test runner? See also my recent 
blog posting, which talks about related matters:


http://faassen.n--tree.net/blog/view/weblog/2005/10/07/0

Groeten,

Martijn

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: ZPT Macros

2005-10-10 Thread Tonico Strasser

Roger Ineichen schrieb:
Hi together 


I like to simplify the macro registration.
The target is to get rid of the mapping in a custom class
where we use right now (StandardMacros) and offer a directive
for register macros in ZCML.

See the proposal at:
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SimplifyMac
roRegistration

Can you tell me what you think?


The ZCML directive is invisible on the Wiki, this I copied from the HTML 
source:


browser:macros
  for=*
  name=standard_macros
  macros=page
  aliases=view:page dialog:page(only if we need to 
support the mapping)

  permission=zope.View
  template=template.pt
  layer=tiks.skins.basic.basic
  /

I Like that. I think it would be very useful to be able to configure 
macros and access them in Python, at least for my use cases.


Regarding: html metal:use-macro=macros:standard_macros/my_macro

I'm not sure I want another prefix in ZPT. I would prefer to provide (or 
push?) a custom namespace to the template and then use 
standard_macros/my_macro or simply macros/my_macro.


Tonico

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] zope fails to start

2005-10-10 Thread Michael Kerrin
This has just being fixed. Just run 'svn up' in your z3 directory and Zope 
should then start.

Michael

On Monday 10 October 2005 11:25, Andreas Reuleaux wrote:
 A clean checkout of zope3 from svn (revision 39029)
 fails to start

 I am using Python2.4 (as seems the default in the Makefile
 now) on Debian Sarge.

   $ svn co svn://svn.zope.org/repos/main/Zope3/trunk z3
   $ cd z3
   $ make
   ...
   cp sample_principals.zcml principals.zcml
   (some small changes in principals.zcml)

 And then:

 [EMAIL PROTECTED](~/z3)$ ./bin/runzope
 Traceback (most recent call last):
   File z3.py, line 63, in ?
 run()
   File z3.py, line 59, in run
 main(argv[1:])
   File /home/reuleaux/z3/src/zope/app/twisted/main.py, line 68, in main
 service = setup(load_options(args))
   File /home/reuleaux/z3/src/zope/app/twisted/main.py, line 114, in setup
 features=('twisted',))
   File /home/reuleaux/z3/src/zope/app/appsetup/appsetup.py, line 114, in
 config context = xmlconfig.file(file, context=context, execute=execute)
 File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 553, in
 file include(context, name, package)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 489,
 in include processxmlfile(f, context)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 344,
 in processxmlfile parser.parse(src)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 109, in parse xmlreader.IncrementalParser.parse(self, source)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py, line
 123, in parse self.feed(buffer)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 216, in feed self._parser.Parse(data, isFinal)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 364, in end_element_ns self._cont_handler.endElementNS(pair, None)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 325,
 in endElementNS self.context.end()
   File /home/reuleaux/z3/src/zope/configuration/config.py, line 553, in
 end self.stack.pop().finish()
   File /home/reuleaux/z3/src/zope/configuration/config.py, line 699, in
 finish actions = self.handler(context, **args)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 489,
 in include processxmlfile(f, context)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 344,
 in processxmlfile parser.parse(src)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 109, in parse xmlreader.IncrementalParser.parse(self, source)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py, line
 123, in parse self.feed(buffer)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 216, in feed self._parser.Parse(data, isFinal)
   File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
 364, in end_element_ns self._cont_handler.endElementNS(pair, None)
   File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 325,
 in endElementNS self.context.end()
   File /home/reuleaux/z3/src/zope/configuration/config.py, line 553, in
 end self.stack.pop().finish()
   File /home/reuleaux/z3/src/zope/configuration/config.py, line 698, in
 finish args = toargs(context, *self.argdata)
   File /home/reuleaux/z3/src/zope/configuration/config.py, line 1390, in
 toargs args[str(name)] = field.fromUnicode(s)
   File /home/reuleaux/z3/src/zope/configuration/fields.py, line 141, in
 fromUnicode raise schema.ValidationError(v)
 zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
 /home/reuleaux/z3/site.zcml, line 7.2-7.68 ZopeXMLConfigurationError:
 File
 /home/reuleaux/z3/zopeskel/etc/package-includes/buddydemo-configure.zcml,
 line 1.0-1.34 ConfigurationError: ('Invalid value for', 'package',
 Couldn't import wikification, No module named wikification)
 ___
 Zope3-dev mailing list
 Zope3-dev@zope.org
 Unsub:
 http://mail.zope.org/mailman/options/zope3-dev/michael.kerrin%40openapp.biz
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] test.py renamed

2005-10-10 Thread Jim Fulton

Martijn Faassen wrote:

Jim Fulton wrote:


A better change would be to arrange for the root directory to be excluded
from the Python path. In general, any script we use should, by default,
exclude its directory from sys.path.



Maybe this only turns up if you have a package layout where the 
__init__.py is in the same place as the test runner?


No.  In fact, in this case, the problem had nothing to do
with relative package imports and everything to do with the
fact that there were 2 top-level test modules/packages
on the Python path, Zope's test runner, and Python's test
package.  This only occurs because, by default, when Python
runs a script, it adds the directory including the script to
the Python path. That policy is often convenient, but it isn't
convenient for Zope.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] zope fails to start

2005-10-10 Thread Andreas Reuleaux
Works fine now, thanks.

By the way: ftp on port 8021 used to be commented out and is now
turned on again. Shouldn't it be commented out?

-Andreas


On Mon, Oct 10, 2005 at 12:39:38PM +, Michael Kerrin wrote:
 This has just being fixed. Just run 'svn up' in your z3 directory and Zope 
 should then start.
 
 Michael
 
 On Monday 10 October 2005 11:25, Andreas Reuleaux wrote:
  A clean checkout of zope3 from svn (revision 39029)
  fails to start
 
  I am using Python2.4 (as seems the default in the Makefile
  now) on Debian Sarge.
 
$ svn co svn://svn.zope.org/repos/main/Zope3/trunk z3
$ cd z3
$ make
...
cp sample_principals.zcml principals.zcml
(some small changes in principals.zcml)
 
  And then:
 
  [EMAIL PROTECTED](~/z3)$ ./bin/runzope
  Traceback (most recent call last):
File z3.py, line 63, in ?
  run()
File z3.py, line 59, in run
  main(argv[1:])
File /home/reuleaux/z3/src/zope/app/twisted/main.py, line 68, in main
  service = setup(load_options(args))
File /home/reuleaux/z3/src/zope/app/twisted/main.py, line 114, in setup
  features=('twisted',))
File /home/reuleaux/z3/src/zope/app/appsetup/appsetup.py, line 114, in
  config context = xmlconfig.file(file, context=context, execute=execute)
  File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 553, in
  file include(context, name, package)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 489,
  in include processxmlfile(f, context)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 344,
  in processxmlfile parser.parse(src)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  109, in parse xmlreader.IncrementalParser.parse(self, source)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py, line
  123, in parse self.feed(buffer)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  216, in feed self._parser.Parse(data, isFinal)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  364, in end_element_ns self._cont_handler.endElementNS(pair, None)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 325,
  in endElementNS self.context.end()
File /home/reuleaux/z3/src/zope/configuration/config.py, line 553, in
  end self.stack.pop().finish()
File /home/reuleaux/z3/src/zope/configuration/config.py, line 699, in
  finish actions = self.handler(context, **args)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 489,
  in include processxmlfile(f, context)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 344,
  in processxmlfile parser.parse(src)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  109, in parse xmlreader.IncrementalParser.parse(self, source)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py, line
  123, in parse self.feed(buffer)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  216, in feed self._parser.Parse(data, isFinal)
File /usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py, line
  364, in end_element_ns self._cont_handler.endElementNS(pair, None)
File /home/reuleaux/z3/src/zope/configuration/xmlconfig.py, line 325,
  in endElementNS self.context.end()
File /home/reuleaux/z3/src/zope/configuration/config.py, line 553, in
  end self.stack.pop().finish()
File /home/reuleaux/z3/src/zope/configuration/config.py, line 698, in
  finish args = toargs(context, *self.argdata)
File /home/reuleaux/z3/src/zope/configuration/config.py, line 1390, in
  toargs args[str(name)] = field.fromUnicode(s)
File /home/reuleaux/z3/src/zope/configuration/fields.py, line 141, in
  fromUnicode raise schema.ValidationError(v)
  zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
  /home/reuleaux/z3/site.zcml, line 7.2-7.68 ZopeXMLConfigurationError:
  File
  /home/reuleaux/z3/zopeskel/etc/package-includes/buddydemo-configure.zcml,
  line 1.0-1.34 ConfigurationError: ('Invalid value for', 'package',
  Couldn't import wikification, No module named wikification)
  ___
  Zope3-dev mailing list
  Zope3-dev@zope.org
  Unsub:
  http://mail.zope.org/mailman/options/zope3-dev/michael.kerrin%40openapp.biz
 
 
 !DSPAM:434a52e932711592313986!
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Zope3 trunk degenerating on Windows

2005-10-10 Thread Michael Kerrin
Hi Tim,

On Monday 10 October 2005 14:28, Tim Peters wrote:
 I'll attach a (long) list of current errors.
Ah no!

 Most seem related to 
 twisted, and may ultimately stem from that there is no fcntl module on
 Windows.
Agreed - I am assuming then from looknig at the trace back that Zope is not 
starting because of this. I don't have a Windows box handy to run this 
myself.

I have just created a bug report for the Twisted guys at 
http://twistedmatrix.com/bugs/issue1270 and I am about to ask them about 
another problems we should be ware off about running twisted on windows.

 The buildbot hasn't been of any help here, since the Windows box has
 failed during its initial svn step non-stop since last Friday:

 http://buildbot.zope.org/
(Nice - I didn't know about this)

 where every run on Windows 2000 fred-win dies in its checkout step with

 Failure: exceptions.AttributeError: ShellCommand instance has no
 attribute 'commandFailed'
This seems to be buildbot itself.

 The

 Failure in test doctest_RecordingProtocol (zope.app.recorder.tests)

 looks unrelated to twisted; I'll take a look.
OK.

 The profiling.txt failure is (still) due to using a Windows-buggy
 snapshot of zope.testing.

 I see the new functional-test warning

 RuntimeWarning: PyCrypto not installed, but continuing anyways!

 on Linux too.  Is installing PyCrypto now a prerequisite for Zope3?
PyCrypto is required if you want to run HTTP over SSL. If you don't want to do 
this then this can be safely ignored.

Michael
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: Zope3 trunk degenerating on Windows

2005-10-10 Thread Tim Peters
[Tim Peters]
 I'll attach a (long) list of current errors.  Most seem related to
 twisted, and may ultimately stem from that there is no fcntl module on
 Windows.

Still true.

 The buildbot hasn't been of any help here, since the Windows box has
 failed during its initial svn step non-stop since last Friday:

http://buildbot.zope.org/

 where every run on Windows 2000 fred-win dies in its checkout step with

Failure: exceptions.AttributeError: ShellCommand instance has no
attribute 'commandFailed'

Still true.

 The

Failure in test doctest_RecordingProtocol (zope.app.recorder.tests)

 looks unrelated to twisted; I'll take a look.

I fixed that one.

 The profiling.txt failure is (still) due to using a Windows-buggy
 snapshot of zope.testing.

And I fixed that one.
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



RE: [Zope3-dev] Re: ZPT Macros

2005-10-10 Thread Roger Ineichen
Hi Tonico

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Tonico Strasser
 Sent: Monday, October 10, 2005 1:22 PM
 To: zope3-dev@zope.org
 Cc: [EMAIL PROTECTED]; 'Stephan Richter'
 Subject: [Zope3-dev] Re: ZPT Macros
 
 Roger Ineichen schrieb:
  Hi together 
  
  I like to simplify the macro registration.
  The target is to get rid of the mapping in a custom class
  where we use right now (StandardMacros) and offer a directive
  for register macros in ZCML.
  
  See the proposal at:
  
 http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitectu
 re/SimplifyMac
  roRegistration
  
  Can you tell me what you think?
 
 The ZCML directive is invisible on the Wiki, this I copied 
 from the HTML 
 source:
 
 browser:macros
for=*
name=standard_macros
macros=page
aliases=view:page dialog:page(only if we need to 
 support the mapping)
permission=zope.View
template=template.pt
layer=tiks.skins.basic.basic
/
 
 I Like that. I think it would be very useful to be able to configure 
 macros and access them in Python, at least for my use cases.

After the sprint, I think the problem with such implementations
is, that we are to far away from the development right now. 
Such concept are usefull if the target is UI and skin development,
other wise we don't get feedback and nobody is interessted to
think about it.

I will implement a macro registration in the Tiks framework first,
so we can show this to other developers before we perhaps
move it to the z3 trunk later.

 Regarding: html metal:use-macro=macros:standard_macros/my_macro
 
 I'm not sure I want another prefix in ZPT. I would prefer to 
 provide (or 
 push?) a custom namespace to the template and then use 
 standard_macros/my_macro or simply macros/my_macro.

I know what you mean, but like we discuss at the sprint that are 
two different concepts.

We only can provide a TALES namescape like macros:... otherwise
we have to use a own page template implementation where uses a macro
namespace as a constructor argument.
But then we can't use the browser:page and all this directives for the
registration out of the box.

I prefere a macro namspace for TAL. Otherwise we have to implement
different new ZCML registration directives where are using a custom
page template implementation.

Tonico's vision of templates (see zope3.org):
But note that's not the right solution for what you need. If we 
implement the macro registration and a TALES expression, you only 
can use the registration. For your idea, you will need a own page
template implementation additionaly to the ZCML macro regsitration.

Perhaps the push templates, where I presented at the sprint, are a 
better solution for simplify the page assembling for the future.

Regards
Roger Ineichen

Projekt01 GmbH
www.projekt01.ch
_
END OF MESSAGE  


 Tonico
 
 ___
 Zope3-dev mailing list
 Zope3-dev@zope.org
 Unsub: 
 http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch
 
 

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: ZPT Macros

2005-10-10 Thread Tonico Strasser

Roger Ineichen schrieb:

I'm not sure I want another prefix in ZPT. I would prefer to 
provide (or 
push?) a custom namespace to the template and then use 
standard_macros/my_macro or simply macros/my_macro.



I know what you mean, but like we discuss at the sprint that are 
two different concepts.


We only can provide a TALES namescape like macros:... otherwise
we have to use a own page template implementation where uses a macro
namespace as a constructor argument.
But then we can't use the browser:page and all this directives for the
registration out of the box.

I prefere a macro namspace for TAL. Otherwise we have to implement
different new ZCML registration directives where are using a custom
page template implementation.


Ok, I don't really understand what this all means. I have trivial use 
cases and don't understand why everything has to be so complicated.


Tonico

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



RE: [Zope3-dev] Re: ZPT Macros

2005-10-10 Thread Roger Ineichen
Hi Tonico

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Tonico Strasser
 Sent: Monday, October 10, 2005 10:49 PM
 To: zope3-dev@zope.org
 Cc: zope3-dev@zope.org
 Subject: [Zope3-dev] Re: ZPT Macros
 
 Roger Ineichen schrieb:
 
 I'm not sure I want another prefix in ZPT. I would prefer to 
 provide (or 
 push?) a custom namespace to the template and then use 
 standard_macros/my_macro or simply macros/my_macro.
  
  
  I know what you mean, but like we discuss at the sprint that are 
  two different concepts.
  
  We only can provide a TALES namescape like macros:... otherwise
  we have to use a own page template implementation where uses a macro
  namespace as a constructor argument.
  But then we can't use the browser:page and all this 
 directives for the
  registration out of the box.
  
  I prefere a macro namspace for TAL. Otherwise we have to implement
  different new ZCML registration directives where are using a custom
  page template implementation.
 
 Ok, I don't really understand what this all means. I have trivial use 
 cases and don't understand why everything has to be so complicated.

It's only because the macros registration via ZCML and the TALES 
expression isn't the right concept for what you where shoing at the
sprint.

For your idea, you need to implement a custom page template where 
provides a macros namspace. Then you can call macros in TAL like:

metal:block use-macro=macros/myMacro /

If we like to use the standard page template we don't have this 
macro namespace and need a TALES expression for the macro 
lookup like:

metal:block use-macro=macros:myMacro /

Right now without a macros ZCML directive we use macros via a 
additional page (view) hook like:

metal:block use-macro=context/@@macros/myMacro /

In this case the @@macros is a view registred with a own python 
class inherited from the class Macros. Most the time called
StandardMacros (see Rotterdam skin).

I only propose to get rid of this additional python class 
implementation and view registration and like to offer a 
ZCML directive and a TALES namespace explicit for macros.

Regards
Roger Ineichen

 Tonico
 
 ___
 Zope3-dev mailing list
 Zope3-dev@zope.org
 Unsub: 
 http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch
 
 

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com