Re: [Zope-dev] Puzzle re zope.pytest

2012-05-20 Thread Jeff Rush
Hi Uli,

Thanks for your reply to clarify the history of zope.pytest.


On 05/17/2012 07:22 AM, Uli Fouquet wrote:
 
 On Wed, 16 May 2012 03:40:17 -0500 Jeff Rush wrote:
 
 5) the unit tests for zope.pytest itself are failing with:
   from zope.interface.interfaces import ComponentLookupError
 E   ImportError: cannot import name ComponentLookupError
 
 You need at least zope.interface 3.8.0. Looks like you're using an older
 version.

Yes, for backward compatibility with existing packages, we are using
Zope 2.12.x which has an older zope.interface in its ZTK.


 I admit, though, that I am not too deep into py.test. If you're an
 experienced py.test user, we might could work out something together and
 make it more usable. I'd be happy to learn more about py.test from
 someone more experienced.

No, I'm new to py.test.  We had heard good things about it and, a post
here on-list (from Jim Fulton) that zope.testrunner should be replaced
with a more modern testrunner.  I'm not the right one to enhance
zope.pytest to better integrate with py.test though.


 If, however, you're after a quick, ready-to-use, comprehensive framework
 for testing Zope applications, you might be better off with other
 approaches like the regular Zope testrunner and related libs.

Yes, we've been using zope.testrunner here, but some of the developers
on the team who are less familiar with Zope don't care for the
zope-specific coding in our tests.  They had hoped to move us forward
with a more general test framework but I guess it can't happen right now.

I'm wondering if there is a way to run the improved test APIs of py.test
while running it under the zope.testrunner.  That way we'd get some of
the benefit of py.test, to move away from the various self.assertEqual()
calls and to the cleaner way of py.test.  Initial investigation says
not, that the API benefits of py.test are closely tied to its
testrunner.  I thought we could create a py.test-specific testsuite()
and use the API internally.

-Jeff
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Puzzle re zope.pytest

2012-05-16 Thread Jeff Rush
Are many folks using zope.pytest?  We're looking into it but, for such a
small amount of code, are finding it a bit odd and seemingly broken.

Breaking down the basic creation of an application object, here is what
the code does, with indentation to show what a method call performs:

create_app()
  db = setup_db()
storage = DemoStorage(name)
db = DB(storage, database_name=name)
db.setActivityMonitor( ZODB.ActivityMonitor.ActivityMonitor() )
notify( zope.processlifetime.DatabaseOpened(db) )
return db
  connection = setup_connection(db)
return db.open()
  connection.root()[ZopePublication.root_name]['test'] = site_root

My issues are:

1) the DatabaseOpened event is sent out _before_ the ZODB is actually
opened, making it hard to use handlers to initialize a test layout in
the ZODB.

2) there are no other events emitted, such as after root is initialized.

3) there is a key lookup of ZopePublication.root_name inside
connection.root() before any code has _set_ such a key, raising a key
lookup exception in my basic evaluation pgm.

4) there are no examples of tests that use the 'test' subscript, and I'm
puzzled by the extra level of indirection instead of just using
ZopePublication.root_name in test_XXX functions.

5) the unit tests for zope.pytest itself are failing with:
   from zope.interface.interfaces import ComponentLookupError
E   ImportError: cannot import name ComponentLookupError

I've googled to find others using zope.pytest, to see examples of
correct usage in a ZODB-based testing environment, without luck.

-Jeff
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Sanity Check on zope.sessions and Zope 2.12.x

2012-04-11 Thread Jeff Rush
I'm chasing a problem when trying to use zope.sessions with Zope 2.12.x, 
and I'm beginning to think that they are an incompatible mix of Zope2 
and Zope3 technologies.


Can anyone confirm either way, so I know whether I'm wasting my time.

What is happening is when I adapt the request I receive to IClientId, 
the CookieClientIdManager within zope.sessions code (logically) wants to 
invoke request.response.getCookie().  However the response object my 
view is receiving is a ZServerHTTPResponse, which lacks such a method. 
Considering that Zope 2.12.x runs ZServer, it makes sense I'm seeing 
ZServerHTTPRequest/ZServerHTTPResponse objects, but that means the 
ClientIdManager inside zope.session is just not compatible with ZServer.


Am I missing something?  Is there some magic someplace that fixes up the 
incompatibility in some way I'm missing?


I'm guessing my only solution is to re-implement a ClientIdManager 
utility that restricts itself to the API provided by 
ZServerHTTPRequest/ZServerHTTPResponse.


-Jeff
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Request Clarification of Five Support for Z3 Roles

2010-12-20 Thread Jeff Rush
I'm backporting a Zope3 app to Zope2 and hit the snag that I define the
various possible roles in ZCML using the role id=... tag.

Can anyone confirm that there is nothing in/around Five to support that
tag and so all role definition has to be done the old Zope2 way?

We have the permission id=... tag in Zope 2.12.* but I guess neither
the role or grant tags, right?

-Jeff
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope3docs

2009-02-02 Thread Jeff Kowalczyk
On Mon, 02 Feb 2009 09:16:38 -0800, Paul Carduner wrote:
 it would be nice if these docs could somehow magically appear on the
 plone site (I'm told plone has some product for syncing content from
 subversion?).

http://dev.plone.org/collective/browser/FSReST


___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] git mirror of svn://svn.zope.org/repos/main ?

2008-06-11 Thread Jeff Kowalczyk
I was going to ask this question anyway, but perhaps it's more timely with
the scheduled server move:

Has anyone made a git clone of svn://svn.zope.org/repos/main suitable for
public mirroring on github, etc.?

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Re: Zope on Python 2.5?

2007-11-01 Thread Jeff Kowalczyk
Would it be possible to have a non-system python installed (by default
into /opt/python24) by the system python easy_install? I think it would be
useful to have eggs that provide commands on the path such as
easy_install_nonsystem24, virtualenv_nonsystem24, python_nonsystem24. With
a better spelling, of course.

Perhaps if non-system pythons were packaged in a way that setuptools could
install them, they might become ordinary dependencies of Zope/Plone eggs,
which could detect and configure to use them in a virtualenv at setup
time.

I don't know if setuptools is currently capable of installing packages
completely separate from the running environment, or executing another
python during setup. However, It seems to me that the most expedient way
to encourage widespread use of non-system python is to make them available
as a dependency for applications and frameworks that prefer them.

After my distribution (Gentoo) updated to python2.5, I made the overdue
switch to a buildout-based non-system python. I greatly appreciate the
fact that it has no packages installed and never changes, obliging me to
use buildout or virtualenv always.

I'd like to have the best-practice setup available as an easy_installable
package. On my distribution, tools are already available to package
complete/correct PyPI entries.

Thanks.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Re: PILwoTk egg to PyPI?

2007-10-19 Thread Jeff Kowalczyk
Jim Fulton wrote:
 Binaries, except for Windows, should never never be uploaded to PyPI (or
 download.zope.org).  There are just too many variables to building
 binaries.

Yes, that's what I meant to ask for, PILwoTk-1.1.6.3 to PyPI as a source
release. I'm currently using
http://download.zope.org/distribution/PILwoTk-1.1.6.3.tar.gz

 A more interesting questions is whether the source release should be
 uploaded.  I wish someone could convince Fredrik Lundh to make a saner
 release of PIL. Maybe someone could pursue this on the image- sig
 mailing list (http://mail.python.org/pipermail/image-sig/).

Yes, that's what I was hoping to avoid asking ;) since I don't know the
PIL packaging rationale. The effbot.org release pages are so thorough, I
presumed that PIL was going to continue to be packaged as-is.

Thanks.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] PILwoTk egg to PyPI?

2007-10-19 Thread Jeff Kowalczyk
Would someone be willing to add the PILwoTk-1.1.6.3(-py2.4-linux-i686).egg
to PyPI?

If PILwoTk becomes a PyPI entry, I'd like to ask a follow-up on the Plone
list to see if ploneout buildouts can/should by default depend on PILwoTk
to satisfy Plone-3.0's PIL dependency.

I'm able to use PILwoTk for this purpose while still running from a python
with no installed pacakges, making ploneout very easy to use.

Thanks.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Representation for Zope at PyCon 2007

2006-10-22 Thread Jeff Rush
PyCon 2007 will be held in Addison (Dallas) from Feb 23 to 25, and we're fast
approaching the talk submission deadline of Oct 31.  I'd like to encourage
talks about Zope, particularly how to get started with Zope and also the new
technologies coming out of Zope 3.  Information on both of those topics has
been in very short supply at PyCons.

We're also approaching the deadline, Nov 15, for half-day tutorials taught on
Feb 22.  Attendees register separately for these and teachers can earn up to
$1500 per half-day, depending upon the number of students.  The tutorial
format would be ideal for getting someone up to speed on either Zope 2 or Zope
3.  Teach a basic intro in the morning and advanced material in the afternoon.
 And if you're nervous about such a commitment, tutorials are a great
opportunity to partner with another teacher or class helper.

As a longtime advocate of Zope (both 2 and 3) I'd very much like to see
extensive coverage this year of getting started with Zope 3.  Zope has a PR
problem, partly from the immense power that comes with it, and the difficulty
in getting your arms around it all.  It evokes strong feelings and has a
distinct philosophy and design tradeoff that you have to understand before
you're productive.  And with the recent formation of the Zope Foundation,
putting forth your best image and getting new members into the community
should be a priority.  PyCon is a significant opportunity for the Zope
community to evangelize.

In the PyCon's I've attended one challenge is breaking Zope down into teaching
chunks that can be taught in 30-40 minutes.  It is very easy to leave the
audience behind in the buzzwords and concepts of Zope.  So please don't try to
teach all of Zope + Plone in 30 minutes. ;-) ;-)

One possible talk I think would fit, would help someone just getting into Zope
3 and I wish someone would tackle is the Zope 3 component architecture -
nothing about the web or databases or security.  Start with the abstract
concept of interfaces and adapters, as exists in the zope/interface package,
and then layer on it the idea of registries, as implemented in the
zope/component package.  And wrap up with the reasons why interfaces are
better than abstract base classes and what kind of problems adapters are good
at solving, including some _non-abstract_ examples.

If you'd like to get involved, check out the following conference pages:

  http://us.pycon.org/TX2007/CallForProposals

  http://us.pycon.org/TX2007/CallForTutorials

Django and TurboGears will be at PyCon in force; I hope Zope will be too.

Jeff Rush
PyCon 2007 Co-Chair
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Twice-annual releases and bugfixes?

2006-01-08 Thread Jeff Kowalczyk
What does the twice-annual release policy say about bugs and/or packaging
errors that are identified and fixed within a very short time of the
official release announcement?

Log message for revision 41228:
  Merge r41227 from 2.9 branch:
Update Five to bugfix release 1.3.1.
Changed:
  U   Zope/trunk/lib/python/Products/Five/CHANGES.txt U  
  Zope/trunk/lib/python/Products/Five/site/localsite.py U  
  Zope/trunk/lib/python/Products/Five/site/tests/sitemanager.txt U  
  Zope/trunk/lib/python/Products/Five/tests/adapters.py U  
  Zope/trunk/lib/python/Products/Five/version.txt
(...)
+* Fix an adapter look-up bug in the local site implementation
+that was due to an oversight during the port to Zope 3.2.

I'm building from svn, so it doesn't make much difference to me, but I was
curious whether the circumstances (if any) that would trigger bugfix
releases were documented anywhere.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Re: [RfC] Removal of old stuff in Zope 2.10

2005-12-20 Thread Jeff Kowalczyk
Andreas Jung wrote:
 I'll raise the question again: what are the benefits of the HelpSys for
 a Zope user?

I can't recall clicking on top frame of the ZMI or a 'Help!' link in the
past few years, either. Perhaps an equivalent or greater benefit would be
to rip out locally installed static help facilities, and spend the effort
migrating* zope.org to a plone version that could run PloneHelpCenter:

http://plone.org/documentation


* or a clean-slate docs.zope.org, just as well.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zope-2.9 r40780 make install doesn't finish, files missing from bin

2005-12-17 Thread Jeff Kowalczyk
I didn't receive any feedback on zope-general, but it could just be a
problem with my environment that fails silently. Can anyone confirm that
this isn't pilot error before I file a bug? Thanks.

---

I'm having some trouble with the 'make install' stage of Zope-2.9 svn.
Using python-2.4.2 on Gentoo linux. Zope-2.9.0b1 installed fine, but I
needed the fix for get_transaction() ASAP.

URL: svn://svn.zope.org/repos/main/Zope/branches/2.9
Revision: 40853

# ./configure --prefix=/usr/lib/zope-2.9.0
# make
# make install
(...)
copying lib/python/zope/app/recorder/zope.app.recorder-configure.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc/package-includes
copying 
lib/python/zope/app/pluggableauth/zope.app.pluggableauth-configure.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc/package-includes
copying lib/python/zope/app/securitypolicy/securitypolicy-meta.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc/package-includes
copying lib/python/zope/testbrowser/testbrowser-ftesting.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc/package-includes
copying lib/python/zope/formlib/formlib-configure.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc/package-includes
copying lib/python/zope/app/securitypolicy/securitypolicy.zcml - 
/usr/lib/zope-2.9.0/zopeskel/etc
[ -f /usr/lib/zope-2.9.0/bin/python ] || ln -sfn /usr/bin/python 
/usr/lib/zope-2.9.0/bin/python

Zope binaries installed successfully.
Now run '/usr/lib/zope-2.9.0/bin/mkzopeinstance.py'

This leaves (most visibly) many missing files in /usr/lib/zope-2.9.0/bin/.
Only the 'python' symlink, and 'zconfig  zconfig_schema2html  zdctl.py
zdrun.py' are installed there. Other files may be missing if they came
afterwards, I don't have information on that.

Is this line indicating a terminating error in make install?

[ -f /usr/lib/zope-2.9.0/bin/python ] || ln -sfn /usr/bin/python 
/usr/lib/zope-2.9.0/bin/python


Subsequent runs don't resume installing the remaining files:

# make install
/usr/bin/python /home/jtk/software/svn/Zope/setup.py  \
   build_ext -i \
   install --home=/usr/lib/zope-2.9.0
running build_ext
running build_headers
running install
running build
running build_py
running build_scripts
running install_lib
running install_headers
running install_scripts
changing mode of /usr/lib/zope-2.9.0/bin/zconfig to 755
changing mode of /usr/lib/zope-2.9.0/bin/zconfig_schema2html to 755
changing mode of /usr/lib/zope-2.9.0/bin/zdctl.py to 755
changing mode of /usr/lib/zope-2.9.0/bin/zdrun.py to 755
running install_data
[ -f /usr/lib/zope-2.9.0/bin/python ] || ln -sfn /usr/bin/python 
/usr/lib/zope-2.9.0/bin/python

Zope binaries installed successfully.
Now run '/usr/lib/zope-2.9.0/bin/mkzopeinstance.py'

Thanks for any insight on the issue. I don't think I want to run Zope
in-place from the working copy.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Editing using Firefox

2005-04-15 Thread Jeff Nielsen








Sorry in advance if this issue has been covered a bzillion
times already



Im playing with editing my Zope site using Firefox as
I can open Document and Method objects in tabbed windows and switch back and
forth between them. However, the tab title, based on the page title, for each
object is just Zope. Is there a way to get the object name to be
used as the page title and hence the tab title? Ive searched about a bit
for an answer and no joy so far.



Jeff Nielsen

UgoFast

http://www.UgoFast.com

[EMAIL PROTECTED]








___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Re: CVS Head: Error Value: iterable argument required when adding objects

2004-01-17 Thread Jeff Kowalczyk
I forgot to check event.log, that gives information about the problem.
Thanks.

2004-01-17T17:07:23 PROBLEM(100) ZODB FS FS21  warn: Ignoring
index for /var/zope/var/Data.fs
--
2004-01-17T17:07:24 INFO(0) Zope Ready to handle requests
--
2004-01-17T17:07:48 PROBLEM(100) Zope Security Policy
'PermissionRole object at 0x40940db8' passed as roles during
validation of 'manage_access' is not a sequence.
--
2004-01-17T17:07:48 PROBLEM(100) Zope Security Policy
'PermissionRole object at 0x40940db8' passed as roles during
validation of 'manage_access' is not a sequence.
--
2004-01-17T17:08:04 PROBLEM(100) Zope Security Policy
'PermissionRole object at 0x40e4cec0' passed as roles during
validation of 'manage_addFolder' is not a sequence.



___
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] FileStorage instance has no attribute '_serial'

2004-01-04 Thread Jeff Kowalczyk
I'm not sure whether the collector issue 1164 I posted is simply a 
missing configuration step on my part. At any rate, I'm still unable to
start the current checkout of Zope HEAD. The only edit I make to
/var/zope/etc/zope.conf is 'effective-user zuser', and the problem below
also occurs if I then bin/runzope as root.

Can anyone tell me if I'm missing something, or is this a bug?

Thanks.

[EMAIL PROTECTED] Zope]$ ./configure
[EMAIL PROTECTED] Zope]$ make
[EMAIL PROTECTED] Zope]$ make install
[EMAIL PROTECTED] var]# /opt/Zope-2.8/bin/mkzopeinstance.py
[EMAIL PROTECTED] Zope]# chown -R zuser /var/zope/var
[EMAIL PROTECTED] Zope]# chgrp -R zuser /var/zope/var
[EMAIL PROTECTED] Zope]$ /var/zope/bin/runzope
--
2004-01-04T23:06:08 INFO(0) ZServer HTTP server started at Sun Jan  4 23:06:08 2004
Hostname: localhost.localdomain
Port: 8080
--
2004-01-04T23:06:08 INFO(0) ZServer FTP server started at Sun Jan  4 23:06:08 2004
Hostname: laptop
Port: 8021
--
2004-01-04T23:06:10 DEBUG(-200) FileStorage create storage 
/var/zope/var/Data.fsTraceback (most recent call last):
  File /opt/Zope-2.8/lib/python/Zope/Startup/run.py, line 49, in ?
run()
  File /opt/Zope-2.8/lib/python/Zope/Startup/run.py, line 19, in run
start_zope(opts.configroot)
  File /opt/Zope-2.8/lib/python/Zope/Startup/__init__.py, line 50, in start_zope
starter.startZope()
  File /opt/Zope-2.8/lib/python/Zope/Startup/__init__.py, line 218, in startZope
Zope.startup()
  File /opt/Zope-2.8/lib/python/Zope/__init__.py, line 46, in startup
_startup()
  File /opt/Zope-2.8/lib/python/Zope/App/startup.py, line 54, in startup
DB = configuration.dbtab.getDatabase('/', is_root=1)
  File /opt/Zope-2.8/lib/python/DBTab/DBTab.py, line 96, in getDatabase
db = self._createDatabase(name, is_root)
  File /opt/Zope-2.8/lib/python/DBTab/DBTab.py, line 113, in _createDatabase
db = factory.open()
  File /opt/Zope-2.8/lib/python/Zope/Startup/datatypes.py, line 172, in open
DB = self.createDB()
  File /opt/Zope-2.8/lib/python/Zope/Startup/datatypes.py, line 169, in createDB
return ZODBDatabase.open(self)
  File /opt/Zope-2.8/lib/python/ZODB/config.py, line 101, in open
version_cache_size=section.version_cache_size)
  File /opt/Zope-2.8/lib/python/ZODB/DB.py, line 98, in __init__
storage.store('\0\0\0\0\0\0\0\0', None, file.getvalue(), '', t)
  File /opt/Zope-2.8/lib/python/ZODB/FileStorage.py, line 791, in store
newserial=self._serial
AttributeError: FileStorage instance has no attribute '_serial'

[EMAIL PROTECTED] var]$ ls -l /var/zope/var
total 24
-rw-rw-r--1 zuser   zuser 4 Jan  4 23:06 Data.fs
-rw-rw-r--1 zuser   zuser   103 Jan  4 23:06 Data.fs.index
-rw-rw-r--1 zuser   zuser 5 Jan  4 23:06 Data.fs.lock
-rw-rw-r--1 zuser   zuser 0 Jan  4 23:06 Data.fs.tmp
-rw-r--r--1 zuser   zuser   299 Jan  4 23:01 README.txt
-rw-rw-r--1 zuser   zuser 4 Jan  4 23:06 Z2.lock
-rw-rw-r--1 zuser   zuser 4 Jan  4 23:06 Z2.pid




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


Re: [Zope-dev] How to trigger Zope externally (mail)

2003-02-26 Thread Jeff Youel
On Wed, 2003-02-26 at 16:16, Ross Boylan wrote:
 1. Incoming mail goes to a pipe, which is a program that processes the
 message.
 
 I think the main drawback of this approach is that I would need to run
 Zope on top of ZEO so that multiple processes could access the
 database safely.  I'm also not sure how hard it would be to
 reestablish the context of my product outside of regular Zope.
 
 Aside from these concerns, this seems the most natural approach.
 

Instead of writing to the ZODB directly, I would post the message to a
form hosted by your Zope server using the ZPublisher.Client.

Jeff


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


Re: [Zope-dev] Re: [Zope] PCGI?

2003-02-13 Thread Jeff Rush
Having only ever used Zope-behind-PCGI myself, if we drop it, what would 
be the prevailing approach for running Zope behind Apache?  Has everyone 
switched to FastCGI (or Quixote's SCGI) but me?

Be aware that there are Zope-specific patches (some of which I provided) 
in the version of PCGI that Zope ships with, so you can't refer everyone 
to the non-Zope version of PCGI available elsewhere on the web.  The 
patches relate to error handling and meaningful reporting, not core 
functionality.

-Jeff


Dieter Maurer wrote:
Jim Fulton wrote at 2003-2-13 11:30 -0500:
  I'm wondering how PCGI should be supported in Zope moving forward.
Do we still need it?

I would prefer to drop it (to reduce complexity).



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


Re: [Zope-dev] Re: [Zope] PCGI?

2003-02-13 Thread Jeff Rush
I had thought (obviously incorrectly) that mod_proxy was hard to 
configure correctly to pass all headers, particularly in complex virtual 
hosting scenarios.  But I'm no Apache expert.

And I thought that mod_redirect added overhead to every request, doing 
the redirect cycle via the browser.  It also exposed the port 8000-based 
Zope to direct access, which some admin's might not want.

But mostly I thought PCGI (and FastCGI) was the preferred way, since it 
is covered in detail in Zope's doc/WEBSERVER.TXT and neither mod_proxy 
nor mod_redirect are mentioned in there. ;-)

I just figured PCGI was cleaner and let me delegate responsibility to 
each hosting client, to manage their own CGI-BIN stuff w/o access to 
Apache's config files..

So if we drop PCGI, we'll need an action item to rework that file and 
perhaps ZopeBook et. al.

-Jeff



Tim Hoffman wrote:

I have always run Zope behind Apache utilising mod_proxy.

I have to admit I never tried or really even evaluated pcgi, and don't 
build it when I install Zope.

Is there a benefit of pcgi over using mod_proxy ?


Guido van Rossum wrote:

 AFAIK most people use Apache's mod_redirect to a Zope HTTP server
 running at (e.g.) port 8000.  No additional software needed.


On Fri, 2003-02-14 at 09:16, Jeff Rush wrote:


Having only ever used Zope-behind-PCGI myself, if we drop it, what would 
be the prevailing approach for running Zope behind Apache?  Has everyone 
switched to FastCGI (or Quixote's SCGI) but me?



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


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

2003-02-04 Thread Jeff Rush
Other than explictly passing arguments, the shareable namespace, _, is 
the logical place to exchange such variables btw DTML and 
Script(Python).  However, the namespace object, a TemplateDict, only 
allows you to PUSH/POP spaces, not set/change variables, so you have to 
find or provide something in the namespace that is mutable.  You found 
REQUEST, and there is also SESSION.  And you can provide your own 
mutable namespace as a dictionary:

- cut here - DTML Method
dtml-let myvars={ 'somevar': 5 } !-- Create My Own Namespace --
  dtml-with myvars mapping !-- and Push onto the Search Stack --

Before: dtml-var somevar
dtml-call mypython
After: dtml-var somevar

  /dtml-with
/dtml-let

- cut here - Script(Python) Method
## Script (Python) mypython
##bind container=container
##bind context=context
##bind namespace=_
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
_['myvars']['somevar'] = 7

When the DTML Method is invoked, this will print:

  Before: 5
  After: 7

When the end of the DTML-WITH is reached, the namespace will be 
popped/discarded, so it won't be permanent, as you wish to avoid.

Hope this helps,

Jeff Rush


Asad Habib wrote:
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.



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


Re: [Zope-dev] Can't return / publish object of a dictionary?

2003-01-20 Thread Jeff Rush
Yeah, the new property type in Python 2.2 is pretty cool, but out of 
range for use under Zope at the moment.  The ExtensionClass requirement 
for persistence eliminates using it with new style Python classes.

Plus... the Lars, the original poster, said he was a Python newbie and 
he certainly doesn't need to get lost wandering around in bleeding edge 
versions.

I think Zope 2.7 or 3.0 is supposed to support new style classes and 
persistence.  But not today...

-Jeff


Leonardo Rochael Almeida wrote:
On Sat, 2003-01-18 at 17:44, Seb Bacon wrote:


Jeff Rush wrote:


I use a form of the following to compute dynamic titles for Zope
objects, where the 'title' attribute is the result of a method call.
Modifying it slightly for your case...

from ComputedAttribute import ComputedAttribute

Class B(A):
   def getMyObjects(self):
   ...
   myObjects = ComputedAttribute(lambda self: self.getMyObjects())



In Python 2.2 (which is unfortunately not yet an option unless you are 
using a bleeding edge Zope) you can also use the new property type:


I might be wrong but I believe class properties only work with new-style
classes, and I don't know if Zope ExtensionClass-based objects
qualify...

Cheers, Leo



___
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] Can't return / publish object of a dictionary?

2003-01-17 Thread Jeff Rush
Lars Heber wrote:


I've got two other questions:

1. Say we have a Class A with an attribute myObjects which is just a
list.
Now, I'd like to write my own Class B(A) - it extends A.
But, in Class B, myObjects has to be a method because it has to be
rebuild everytime it is called.
So, how can I do something like:
myObjects = getMyObjects() ?
I tried to do this in the class itself, didn't work.
Also tried self.myObjects = self.getMyObjects() - result wasn't what I
wanted, myObjects got (of course) the resulting list of getMyObjects(),
but I need myObjects to be a reference to getMyObjects()


I use a form of the following to compute dynamic titles for Zope
objects, where the 'title' attribute is the result of a method call.
Modifying it slightly for your case...

from ComputedAttribute import ComputedAttribute

Class B(A):
def getMyObjects(self):
...
myObjects = ComputedAttribute(lambda self: self.getMyObjects())




2. Class A has another attribute, say data, which I want to control in
Class B(A),
i. e. everytime data is accessed (reading or writing), I want to
intercept those actions.
If it was just reading, I could use the strategy from 1., but I also
want to control made changes to that attribute. Do I absolutely have to
rewrite all the methods which access the wanted attribute, or is there
another possibility with some kind of references, perhaps similar to
software interrupts in DOS?


I'm not sure about this one, but I suspect an override of the 
__getattr__() method will let you intercept the lookup of the 'data' 
attribute, do any pre/post actions you wish, then return the real 
'data'.  You might try a ComputedAttribute arrangement instead and see 
if it works for your case since that would be easier.  __getattr__
overrides can get into infinite loops w/o careful designs.

Jeff Rush


___
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] Can I run 2 zope servers on one machine?

2003-01-13 Thread Jeff Rush
Yes, I do it all the time, as a Zope-hosting ISP.

1. You can forgo FTP (-f -) and just run HTTP, on different
   ports.

2. You can use the -f option to Z2.py and run FTP on a
   different IP address or port.

3. You can run HTTP only via some flavor of CGI, and then
   use Apache to map portions of the URL space to different
   servers, Zope or non-Zope.  This retains a single-webspace
   appearance to outside clients.

4. You can also do (3) using the proxy features of Apache.

The weak spot is always FTP, which doesn't support virtual
hosting or URL/filesystem space splicing, whereas Apache does
do both.

-Jeff


Tena Sakai wrote:

Folks,

Can I run 2 zope servers on one machine?
I have a machine that runs zope 2.5.1.  I want to run zope 2.6
on the same machine without taking 2.5.1 down.  Is this possible?

2.5.1 runs on port 7117 and I chose 7118 for 2.6. port.  What I got
was:

   2003-01-13T14:39:44 PANIC(300) z2 Startup exception
   Traceback (innermost last):
 Module __main__, line 726, in ?
 Module ZServer.FTPServer, line 602, in __init__
 Module ZServer.medusa.ftp_server, line 727, in __init__
 Module ZServer.medusa.asyncore, line 306, in bind
   error: (125, 'Address already in use')

Would it be possible to run 2.6 on port 7118 and specify that
ftp for this zope server to use a specific ftp port?

[I'm just mumbling...  In the file ZServer/medusa.ftp_server
there is a definition of port=21 (line 701).  What happens if
I hack this and put some big number like 9221 instead?]

Regards,

Tena Sakai


___
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 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] Proper Use of __init__ inside Zope Products?

2002-12-12 Thread Jeff Rush
Can a Zope-internals guru provide some enlightenment regarding the
mysteries of __init__?  I'm writing some zproducts that subclass the
existing Folder class, and then are themselves subclassed.  What I've
got works, but I'm not sure its _correct_.  As I'm writing a Zope
Best Practices document, I'd like to get it right.

As I understand it, the use of __init__ should be avoided when
possible, since it isn't invoked (necessarily) when persistent
objects are reloaded from disk.  Therefore Zope tends to do instance
init within manage_addMYPRODUCT global-to-Zope functions, although
this doesn't seem to be fully consistent throughout the Zope
community contributions.

The scenario is something like the following:

def manage_addFolder(self, id, title='', ...):
instance = Folder()
instance.id = str(id)
instance.title = title
self._setObject(id, instance)

class Folder(...):
   # no __init__ method


def manage_addLargeFolder(self, id, title='', ...):
instance = LargeFolder()
instance.id = str(id)
instance.title = title
self._setObject(id, instance)

class LargeFolder(Folder):
def __init__(self):
# parent class has no __init__ so don't call it!
#Folder.__init__()

self._tree = OOBTree()


def manage_addSpecialLargeFolder(self, id, title='', ...):
instance = SpecialLargeFolder()
instance.id = str(id)
instance.title = title
self._setObject(id, instance)

class SpecialLargeFolder(LargeFolder):
def __init__(self):
# parent class DOES have an __init__ so call it
LargeFolder.__init__()

self._other = OOBTree()

(A) I reluctantly found it necessary to add an __init__ to my
LargeFolder class because if I init'd self._tree in
manage_addLargeFolder(), then it won't get init'd when
manage_addSpecialLargeFolder() is used to create instances.
manage_addLargeFolder doesn't get invoked in that case.

(B) Currently the Folder class lacks an __init__ so I cannot
call it from LargeFolder.__init__, but if someday ZC decides
to add one, my code will fail to init Folder and break.  Is
this correct?  I wish Python auto-provided a default no-nothing
__init__ for this case so I could always call it.

So the Guiding Rule seems to be initialize those attributes
that are common to all Zope objects, e.g. id and title, within
the factory functions, but init any attributes you introduce
using an __init__ method.  Correct?

-Jeff Rush

___
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] Contents of Initial Data.fs in Zope Distribution?

2002-11-13 Thread Jeff Rush
Working on updating my ZOPE and ZEO RPMs I got
to wondering...

What's in the default data.fs that ships with
Zope?  I mean, ZEO (actually ZODB) auto-creates
a data.fs when one isn't found, so why does
Zope come with one?

Or if there -is- something Zope-specific in
data.fs, then shouldn't there be a warning
in the ZEO notes that when ZEO is used
_underneath_ Zope, be sure to copy the
data.fs that comes with it?

My experience has always been with ZEO and
StandaloneZODB, not ZEO+Zope so I'm puzzled.

-Jeff

___
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] Contents of Initial Data.fs in Zope Distribution?

2002-11-13 Thread Jeff Rush
I don't quite understand -- so there *are* root
level elements specific to Zope that need to
be copied into a Zope-over-ZEO environment?
(hm, how do those elements get into a
non-FileStorage Zope-over-ZEO environment?)

And do those elements interfere even a little in
a non-Zope-just-ZEO environment?  The only way I
can imagine, other than simplistic name clashes
would be if a full iteration of such a ZODB would
cause unghosting of objects lacking Zope .pyc
and raise unnecessary exceptions.

I ask because I'm trying to decide whether two
ZEO RPMs are needed re ZEO-wo-Zope-2.0-1.i386.rpm
and ZEO-w-Zope-2.0-1.i386.rpm, or just one.
Somewhat similar to how the Zope RPMs have
separate ZServer and PCGI flavor packages.

-Jeff Rush


Casey Duncan wrote:

It is only there due to lack of time to take it out. We had planned to take it 
out for 2.6, but time was never made to replace it with code to bootstrap an 
empty storage with the proper root level elements still residing in 
Data.fs.in.

-Casey

On Wednesday 13 November 2002 02:22 pm, Jeff Rush wrote:

Working on updating my ZOPE and ZEO RPMs I got
to wondering...

What's in the default data.fs that ships with
Zope?  I mean, ZEO (actually ZODB) auto-creates
a data.fs when one isn't found, so why does
Zope come with one?

Or if there -is- something Zope-specific in
data.fs, then shouldn't there be a warning
in the ZEO notes that when ZEO is used
_underneath_ Zope, be sure to copy the
data.fs that comes with it?

My experience has always been with ZEO and
StandaloneZODB, not ZEO+Zope so I'm puzzled.

-Jeff



___
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] ZSQLMethod/Z Database Connection namespace

2002-10-29 Thread Jeff Coleman
Hi,
I have a product that stores customer information in mysql using
ZSQLMethods. 
I would like each customer to have a different mysql database (same
structure), but all use the same ZSQLMethods for access.
So, I tried the following:
/ - root contains ZSQLMethods and default DB Connector (seems to be
required for editing the methods)
/CustomerA - contains DB Connector with same name as in root, but uses
different mysql database
/CustomerB - contains DB Connector with same name as in root, but uses
different mysql database

And assumed that /CustomerA/showdata would use the DB Connector in the
'CustomerA' directory, but no matter what it uses the DB Connector in
the root directory.  It seems that the ZSQLMethods namespace is put on
top and any other DB Connectors are ignored.
Is this intentional or a bug?

I can patch Shared.DC.ZRDB.DA with the following:

try: nsCid = getattr(aq_parent(self), self.connection_id)
except: ns = self
else: ns = aq_parent(self)

#try: dbc=getattr(self, self.connection_id) --- old code
try: dbc=getattr(ns, self.connection_id)

Is this the only way to solve the problem? 
I hate to add a patch to get what would seem to me to be the correct
functionality.

Thanks,
Jeff

___
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] Best practice for Zope-private copy of Python 2.1 on Linux?

2002-05-06 Thread Jeff Kowalczyk

With the RH7.3 release today, the default Python2 installation is that
much more likely to be Python 2.2 (it's the base package in RH7.3),
instead of Python 2.1.

Rather than ask the FAQ of why and what parts of Zope can't handle
Python 2.2, I'll ask if there is, or suggest if there isn't, a shift due
in the installation procedures on Linux to optionally use a private copy
of Python 2.1, much like the Windows version of Zope does. That version
allows me to use Python 2.2 without any interference. I'd prefer that
the file layout matched WinZope as closely as possible. In this case,
I'm willing to give up some disk space to have a sandbox that Zope can
run in with its configuration uninterrupted.

FWIW, I'd like to see an expanded tarball of Zope available that builds
the whole thing, including its own Python and the most common
c-extensions, in a unified makefile. Maybe that would get the
possibility of RPM releases back on track, too.

Can anyone suggest a best practice to get Zope 2.5.1 on Linux running
with a private Python2.1, keeping the new Python releases separate from
the one Zope will use?



___
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] Threaded Database Access

2002-05-02 Thread Jeff Nielsen / UgoFast

Thanks for the info guys. It looks like these might do the trick.

-Original Message-
From: Paul Browning [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 02, 2002 10:55 AM
To: Casey Duncan
Cc: Jeff Nielsen / UgoFast; zope-dev
Subject: Re: [Zope-dev] Threaded Database Access




--On 02 May 2002 10:08 -0400 Casey Duncan [EMAIL PROTECTED] wrote:

 ZPsycopgDA (for postgres) is definitely multi-threaded. I think 
 zPopyDA is  too.

http://www.zope.org/Members/glpb/solaris says:

 The report also investigates in a cursory way the effects of adding a 
 database adapter to the equation. A test was carried out to compare 
 the effect of changing the threading model on a site doing queries 
 against an Oracle database using DCOracle2. It was found that queries 
 that involved writes on the database were forced to be completed in 
 serial (this is unsuprising), whilst read requests could be carried 
 out in parallel. In addition, ZSQL Methods have the ability to cache 
 the rows they fetch from a database for a given query. The results 
 show that caching of SQL queries can produce a significant performance

 boost.

HTH

Paul

--
 The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK
   E-mail: [EMAIL PROTECTED]  URL: http://www.bris.ac.uk/




___
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] Threaded Database Access

2002-05-01 Thread Jeff Nielsen / UgoFast

I'm using Zope/Zserver 2.2.4, ZODBCDA v3.1.0b2 and SQL Server 2000. I've
noticed that pages generated from database querries are definitely
single threaded, and these pages are the bulk of my site. My poking
around seems to indicate that ZODBCDA is the single-threaded culprit,
and some emails from the list over the last couple months seem to
confirm that.

The volume of my site and the size of the database (hence query response
times) are getting to the point that this is a concern. So I'm
investigating my options, including:
1) Cluster the web site with multiple single processor machines.
2) Move to a database that Zope supports multi-threaded access to.
3) ?

I've been considering a move to Oracle or PostgreSQL/MySQL for other
reasons, but I'm not going to do it just for yucks. Extending and
populating my site gives better return than porting the database. I'd
like to make sure I'll get return on my time investment.

I saw an document on the Zope web site from 1999 that talked about
labeling Zope DAs Level 1,2 or 3 based on their sophistication, but I
don't see any of the current DAs labeled as such. There was text in the
Oracle and MySQL DA descriptions that seem to imply multi-threaded
behaivor though.

I'm looking for the info from the community on:
1. Is the ZODBCDA single-threaded and might that change anytime soon?
2. Can someone confirm that the Oracle, PostgreSQL or MySQL DAs are
multi-threaded.
3. Does the multi-threading require using the Zope Session facility or
some other feature? (My site uses FSSession.)

Thanks in advance for any input.

Jeff Nielsen / UgoFast
http://www.UgoFast.com
[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] Medusa 0.5.1 maint release, planned for inclusion in Zope?

2002-03-30 Thread Jeff Kowalczyk

From the Daily-URL: Andrew Kuchling: Medusa 0.5.1 released: Medusa is a
framework for writing asynchronous socket-based servers. It was
originally written by Sam Rushing. However, no new releases have been
made in about a year. I've therefore taken the original Medusa package,
and reformatted the code, removed various outdated modules, ran
PyChecker over it, wrote a Distutils script, and made a new maintenance
release of Medusa.

[Jeff] Will this version of the Medusa code be making its way into the
Zserver core for the 2.5.x maintenance releases, or the 2.6 timeframe?


___
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] Medusa 0.5.1 maint release, planned for inclusion in Zope?

2002-03-30 Thread Jeff Kowalczyk

[Chris] Does Zope 3 use Medusa at all?

[Stephan] No. Shane rewrote all of the HTTP Server and I am writing
right now the FTP 
server (which copies some of the Medusa code, but much is cleaned). We
added interfaces and made it more component-based.

[Jeff] That's good news about an interface refactoring, it was a little
confusing researching the present customized version. My interest in
(the Medusa revision) was to keep alive the idea of setting up hooks for
developers to build support for other protocols (IMAP, NNTP, Jabber,
SMTP, SMS etc.) in a standard, configurable way in Zope3. Will your
rewritten components form on a general-purpose server framework like
Medusa? Ideally, the support would be as easily added as other 3rd party
Zope3 product/components, inheriting from the base components you guys
are writing now.

The topic kind of thudded when I brought it up last week, but I think it
is important to keep an open mind about it while Zope3 is still brewing.
Interfaces to external mail and other servers is only part of it, since
that makes workflow programming on the messages much less direct, and
reduces the cross-platform flexibility of Zope deployments, where most
extensibility is done in Python.

Lots of *small* businesses need what MS Exchange offers, but can't
afford it nor safely maintain its staggering complexity. As these python
protocol implmentations crop up, I'd like to see Zope3 offer those
writers a mature, cross-platform back-end to store their messages in, if
they are willing to implement a few well-defined interfaces.


___
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] ZMI: IE6 TextArea width bug: fix on tap for 2.6?

2002-03-17 Thread Jeff Kowalczyk

I was wondering if there was any consensus on how best to fix or
compensate for the unfortunate behaviour of IE6 with regards to the
width calculation of textarea boxes. For anyone who hasn't seen it, the
full-width texareas that are everywhere in the ZMI suddenly started
pushing the width out in IE6, causing the horizontal scrollbar to become
active, and generally making ZMI editing life miserable.

Would it be possible to include in 2.6 (or 2.5.1, even better) a user
preference, sitewide configuration setting, or other means of
suppressing a few pixels/percent of that default width? I'm loathe to
apply a massive search-replace to put 95% in my local ZMI source, and
IE6 must be a common enough platform for Zope users to warrant a
workaround. I wouldn't hold my breath that MS would fix IE or anything
sensible like that.

It would be a shame to slow the whole thing down with browser detection
logic for this one bug, unless that opened up the door for some of the
Javascript/DHTML editors as a per-user preference for editing certain
metatypes.


___
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] Impact of additional protocols handled by Zope?

2002-03-17 Thread Jeff Kowalczyk

I'm curious what the impact on overall performance would be if products
eventually came into existence that extended Zope to directly handle
additional protocols and their data requirements, primarily intended for
low-volume workgroup kind of traffic.

Jabber, IMAP and LDAP are the ones that come to mind immediately, since
you'd be that much closer to having Zope fulfill a role that MS Exchange
really doesn't; inexpensive, easily maintained groupware for small
organizations that need custom workflow app development.

Is it practical to consider that Zope might extend into other protocols
this way, and can it be done with modular products, or does integration
require deep Zope modifications (beyond adding a few lines to Z2.py?)

Just a hypothetical, I guess. FWIW, it would be really cool to see a
general, host-a-protocol-here hook for plugin products as Zope3 takes
shape, configuration in the ZMI if the product writer goes that far.
Something that would define a standard interface for Zope3 events to
respond to signals the protocol handler might generate, and vice-versa.




___
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] Impact of additional protocols handled by Zope?

2002-03-17 Thread Jeff Kowalczyk

[Eron] Yeah, this is something I'd be very interested in knowing, too.
In fact, this particular ability could make or break a community project
I'm going to be developing with Zope in the near future. Do you mean
like the pluggable access that ZServer provides? I imagine there would
also have to be some kind of pass-through backend storage to the actual
service layer (like IMAP, for instance). This is definitely something
I've been thinking about. [Eron] Getting my gears turning, Eron

My thinking is that the protocol(s) that people might develop would be
action-interfaces to Zope objects and methods. The canon example is
IMAP, I guess. Someone might finish up something like
http://www.zope.org/Members/michel/MyWiki/IMAPServer , and
access/create/control Zope objects persisted directly in ZODB, using
variations on the classes people already have for the various Zope Email
Clients. Add Binari's IMAP Plug-In to the ubiquitous Outlook, and you've
got a poor-man's Exchange Server*. To get public folder workflow, you'd
need to use CMF (or Openflow), but that should change by the time Zope3
takes shape, workflow will apparently be native to Zope. (Can't wait)

Jabber (or IRC, etc.) would be a slightly different use case.
Jabber.py's maturation might mean that you could have a small number of
users conferences authenticated against Zope's users. The users would
use normal Jabber clients, but this should make web-chat interfaces very
doable, too. A Zope Jabber protocol server might implement active
conversations in session memory, and persist to Zope objects in response
to a Jabber command. Jabber's logging idioms produce XML documents in
the jabber.org implementation, ours would be Zope objects or whatever
was needed by the developer. The back-end would be all Zope's turf.

As for LDAP, existing LDAP products connect to external LDAP servers.
But wouldn't it be useful if Zope's user database, and other folderish
resources could be exposed as LDAP, with Zope as the server? A Dynamic
DNS protocol handler could pump authenticated user's IP info into the
LDAP tree, and so on.

I'm probably getting ahead of myself here, its not like python
implementations of these sophisticated protocols grow on trees. But they
do seem to get started in the python community from time to time, and if
Zope offered an easy way to hook a budding protocol implementation in to
a mature application server, there might be a lot of can-do attitude to
getting them beyond alpha stage. The key would be if the developer could
add/delete/configure protocol products as easily as content products. As
I said, It wouldn't take much for Zope to be a great Exchange drop-in
replacement in your typical small business. It wouldn't really matter
that much if python implementations of these protocols didn't have the
scalability of their C-based brethren, lots of small Zopes doing
big-server work would be a nice thing to develop against.

* Better than Exchange, IMHO, because you'd have to be nuts to deploy
Exchange or Small Business Manager in a real small business with no
on-site IS Manager to handle backups or Active Directory admin duties.



___
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] ZMI textareas on Windows IE6 are '100%+' wide, cause scrolling inconvenience

2002-02-09 Thread Jeff Kowalczyk

[Jeff] You're right, I wonder if this is a documented change in IE6, or
a bug they plan to fix? I can't imagine in what universe that including
the scrollbar-obscured area in the 100% width makes sense. I'd hate to
see all browsers' HTML get munged to cover this bug up. But given the
pervasiveness of IE6, maybe the ZMI should make some accomodation for a
preference that 9x%'s the width of the right frame.


[Joachim] I think the problem is more severe. IE 6 has obviously changed
behaviour compared to IE 5.5. I'd call it a bug. It now always
calculates 100% with the right-hand bar's width INCLUDED, so there are
other side-effects than the one you are describing, like the last tab on
the right being partially covered by the scroll bar.

So if we change the HTML, it should limit the width of the WHOLE
right-hand frame, not just the textarea's width ...

Unfortunately this will only work automatically with some browser
detection ...

Joachim


___
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] ZMI textareas on Windows IE6 are '100%+' wide, cause scrolling inconvenience

2002-02-08 Thread Jeff Kowalczyk

On my Zope 2.5.0 running on WindowsXP/IE6, the ZMI's textarea boxes, for
things like editing PageTemplates, becomes too wide for the frame when
the vertical scrollbar is required, causing an inconvenient
side-scrolling behavior. The frame must be scrolled sideways to view the
text areas's scrollbars, which then obsures the far left of the
textarea.

This is the code in question (for a PT edit page, there are many others)
  Expand macros when editing
/td
  /tr
  tr
td align=left valign=top colspan=4
  div style=width: 100%;
  textarea name=text:text wrap=off style=width: 100%;
cols=40 rows=15lt;html metal:define-macro=pagegt;

Would it not help to make the textarea and div width 90% or so to
account for the potential width of the side-scroll bar on the right-hand
ZMI frame? Or even better, this could become a preference setting, since
some users will have very narrow scrollbars or extreme vertical
resolutions. After all, there is a cols/rows insertion right next to it,
perhaps a new preference setting is easy enough to add...


___
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] Create directory in LocalFS

2001-09-24 Thread Jeff Nielsen / UgoFast

Can anyone tell me how to create a subdirectory programmatically under a
LocalFS folder? I have a LocalFS folder called images. When I add a new
promoter to my site, I'd like to automatically add a directory that
would hold that promoter's images. If the promoter's ID number is 187, I
want to create a subdirectory '187' under images/Companies/100.

Jeff Nielsen / UgoFast
http://www.UgoFast.com
[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] RE: Experiments with ORMapping

2001-06-28 Thread Jeff Kowalczyk

 I was thinking there would be a default table where everything gets 
 stored by default.  A programmer then tells the ORMapping about 
 specific classes and how to store them.

I wouldn't think it would be practical to use unless the ORMapping
managed the tables by examining the class signature as metadata. ADO.NET
has this in reverse, the tools can define classes that mirror a SQL
recordset. Similarly, references to other objects would need to be
supported with joins.

BTW, I was going to mention this article
http://www.vbpj.com/upload/free/features/vbpj/2001/07jul01/sqlpro0107/re
in0107/rein0107p.asp
As a 'rah-rah zope' example of RDBMS complexity Zope/ZODB spares us, but
now it brings up something the ORMapping layer would have to do (perhaps
with more savvy) to support mixed folder hierarchy among class
instances.


___
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: [Zope] CatalogAware

2001-06-26 Thread Jeff Sasmor


Subject: [Zope] CatalogAware


 CatalogAware has been blamed for alot of problems. Its three
 weaknesses I am aware of are:
snip 
 
 b. It uses URLs not paths, and so doesnt play right with
virtual hosting
 

*

I ran into this problem using VHMonster with my EventFolder product
and found a work-around, just for anyone who might be struggling with this

See http://www.netkook.com/Members/jeff/ef/faq/document_view#vhost

This article discusses how to use _vh_ with  VHM. 
(boy does that sound cryptic...)

Jeff Sasmor
[EMAIL PROTECTED]
www.netkook.com





___
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] A simple dtml-if question...

2001-06-07 Thread Jeff Nielsen / UgoFast

Hey thanks. That works.

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 4:43 AM
To: Jeff Nielsen / UgoFast
Cc: Christian Theune; Zope-Dev@Zope. Org
Subject: Re: [Zope-dev] A simple dtml-if question...


 Thanks Christian, but it didn't work. I went with the long way:
 
 dtml-if expr=LoginResults=='Pass'
   dtml-if expr=PATH_INFO=='/Maintain/Results'
 Valid response
   dtml-else
 False response
   /dtml-if
 dtml-else
 False response
 /dtml-if

dtml-if expr=LoginResults=='Pass' and PATH_INFO=='/Maintain/Results'
  Valid Response
dtml-else
  Fasle Response
/dtml-if

cheers,

Chris


___
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] Name space in a Script (python)

2001-06-06 Thread Jeff



Hi all,
I'm trying to get variables from the name space in 
a python script without much luck... 
I think I am missing something very simple, but 
after hours of searching I'm at wits end.

This is what I am trying:
A DTML document has several properties defined on 
it.
It calls a python script that needs to access these 
properties.

No matter what I try, I can not get the properties 
from the calling DTML document in the python script...
What am I missing?

Thanks,
Jeff


RE: [Zope-dev] A simple dtml-if question...

2001-06-06 Thread Jeff Nielsen / UgoFast

Thanks Christian, but it didn't work. I went with the long way:

dtml-if expr=LoginResults=='Pass'
  dtml-if expr=PATH_INFO=='/Maintain/Results'
Valid response
  dtml-else
False response
  /dtml-if
dtml-else
False response
/dtml-if

Jeff

-Original Message-
From: Christian Theune [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 1:05 AM
To: Jeff Nielsen / UgoFast
Subject: Re: [Zope-dev] A simple dtml-if question...



 dtml-if expr=LoginResults=='Pass' .and. expr=PATH_INFO=='/'

hmm ... just guessing:

dtml-if expr=( LoginResults=='adsf'  PATH_INFO=='/')

Think so: It has to be a complete boolean expression .. so try to
combine boolean operators ...
Tell me if it worked ... :)

--
Christian Theune - [EMAIL PROTECTED]
gocept gmbh  co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,map(lambda
x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))


___
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] A simple dtml-if question...

2001-06-06 Thread Jeff Nielsen / UgoFast

Thanks Eric, I tried it and it didn't work. I went with the long way:

dtml-if expr=LoginResults=='Pass'
  dtml-if expr=PATH_INFO=='/Maintain/Results'
Valid response
  dtml-else
False response
  /dtml-if
dtml-else
False response
/dtml-if

Jeff

-Original Message-
From: E. Seifert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 2:02 AM
To: Jeff Nielsen / UgoFast
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-dev] A simple dtml-if question...


Hi Jeff,

Jeff Nielsen wrote:
 How do I construct a dtml-if statement with two conditions joined by and
 logic? I want to do something like this:

 dtml-if expr=LoginResults=='Pass' .and. expr=PATH_INFO=='/'

Did you try
dtml-if expr=LoginResults=='Pass' and PATH_INFO=='/'

Regards
Eric




___
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] A simple dtml-if question...

2001-06-05 Thread Jeff Nielsen / UgoFast

How do I construct a dtml-if statement with two conditions joined by and
logic? I want to do something like this:

dtml-if expr=LoginResults=='Pass' .and. expr=PATH_INFO=='/'

Jeff Nielsen / UgoFast
http://www.UgoFast.com
[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] Escaping double quotes

2001-05-16 Thread Jeff



Hi,
I have been searching for a way to escape double 
quotes in DTML and have not found it

The following is what I would like to 
do:
table dtml-var name="table_attribs" 
missing="  cellspacing="0" cellpadding="0" border="0" 
width="100%""

Anyone have any ideas?
Thanks,
Jeff


Re: oodb philosophics ;) was: Re: [Zope-dev] Experiments with ORMapping

2001-05-14 Thread Jeff

From: Joachim Werner [EMAIL PROTECTED]

  This is true in the ZODB, but can be complicated by acquisition. If an
  object can acquire itself, it can cause issues. Plus it becomes
  difficult to know whether objects are clones or just identical
  instances, although this can be mitigated by exposing their Python
  instance id.

 Acquisition is very cool, but it sometimes really sucks ... AFAIK you can
 easily switch it off in your own Python products. But I am still
fighting
 with only getting private variables (i.e. not acquired ones) in DTML ...



From DTML I have used 2 different methods for this:
1) 
dtml-with expr=object only
 .
/dtml-with

or
2) 
dtml-if expr=_.hostattr(object.aq_explicit('attribute')
   ...
/dtml-if

In both cases 'object' is the thing with the 'private variables' and in 2),
'attribute' is the 'variable' name.
Jeff




___
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] Object dereferancing Question

2001-05-08 Thread Jeff



Hi ya'll,

I have created a product with a zclass that 
contains a zclass; classAcontains classB. 
Bothuse 'Folder' as bases class.
I want the classB objects to have a 'default 
rendering' capability so I added a DTML Method named index_html to classB with 
the following code:

dtml-var expr="_.getitem(template, 
1)"

Where 'template' is a property of the object that 
hasa method name in it.
So far so good, if I navigate to a classB object 
the correct method is called and the object is rendered.

Now for the part I don't 
understand.
I have a page where I would like dynamically 
display a classB object. I used the following:

dtml-var expr="_.getitem(index_object, 
1)"

Where 'index_object' is the id of a classB object 
within the name space (same folder).
I thought that this would call the 'default 
rendering' for the named object, but instead returns the object.
The following code worked:

dtml-with expr="_.getitem(index_object, 
0)"dtml-var index_html/dtml-with
Why does the "_.getitem(index_object, 1)" not return the rendered 
object?
Thanks,
Jeff


[Zope-dev] Bug in careful_getattr()?

2000-08-22 Thread Jeff Hoffman

Hello,

I have been fighting a problem with PythonMethods/ZClasses. I have a
ZClass, MyTestClass, which has four methods:

  method1 (DTML Method)
  method2 (DTML Method)
  showMethods (DTML Method)
  showMethods2 (PythonMethod)

showMethods is defined as:

  dtml-var standard_html_header
  p
  method1 = dtml-var "_.hasattr(this(), 'method1')"br
  method2 = dtml-var "_.hasattr(this(), 'method2')"br
  nullmethod = dtml-var "_.hasattr(this(), 'nullmethod')"
  /p
  dtml-var standard_html_footer

and showMethods2 is defined:

  print getattr(self, 'method1')
  print getattr(self, 'method2')
  print getattr(self, 'nullmethod')
  return printed

showMethods, when invoked on an instance of my ZClass, returns:

  method1 = 1
  method2 = 1
  nullmethod = 0

Bingo. showMethods2, the PythonMethod, results in an AttributeError in
DT_Util.py:135. Digging into the Zope source, I see:

  validate=md.validate  # line 135

  if validate is None: return v

By inserting some print statements, I notice that md is an empty 
dictionary ([]) when careful_getattr() is called. Therefore, the
validate=md.validate line throws an AttributeError.

I fixed the "problem", and my code as a result, by changing this to read:

  try: validate=md.validate
  except: validate=None

  if validate is None: return v

I have a really strong feeling, though, that I just opened a whole can of
worms. Does my change break an intended behavior of Zope? Is it supposed
to throw an AttributeError when md does not have a 'validate'? If so, is
there a bug in PythonMethods that is causing md to not be initialized
properly before the call to careful_getattr()?

I am pressed for time on this project, and could really use some insight,
here. I am fresh out of ideas, and have hit the limits of my knowledge.

Thanks,

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Interaction between new (2.2) ZCatalog and Renderable

2000-07-27 Thread Jeff Sasmor

Hi Zdevs,

I posted a message to [EMAIL PROTECTED] and then later
figured out the problem and now feel that the issue
belongs in Zope-Dev, so here it goes.

Submitted for your approval...


I think that I have found an interaction between changes made in
manage_addZCatalog (lib/python/Products/ZCatalog/ZCatalog/py)
and the Renderable ZClass product.  It's also possible that this
interaction will affect other things as well.

The new version of method 'manage_addZCatalog' has calls to str()
near its beginning.  The older (2.1.6) does not.  The Renderable
product overrides str to do its work.  This gets _very_ messy
when you initialize a catalog in the xxx_add dtml method for a
ZClass (that is, if you create an instance of the ZClass and the _add
method instantiates a ZCatalog instance.) and the ZClass itself is
renderable.

The manage_addZCatalog method ends up invoking the str() method
that's in the Renderable product.  This code attempts to publish(?) the
a dtml method named render (this is what it does by default).
In my case, the dtml method tries to query the created ZCatalog instance.

This does not work! since the ZC instance isn't actually created since the
_add method has not completed(?).
So the render dtml method borks with an attribute error.
Correct me if I have reverse-engineered these conclusions from looking
at the traceback and made a logic error

As one can see from the traceback attached to the end of this email,
the manage_add methof (I put X near where this mess begins)
warps into the render dtml method at line 112 of manage_addZCatalog,
which is the first str() (can be seen in the src).  This ends up in
an External Method, rendercal.py (last line of traceback).  If you were
to look there you'd se that it's doing a Catalog.searchResults().

**SO** it appears as if you cannot instantiate a ZCatalog in the _add
dtml method of a ZClass IFF the ZClass inherits from Renderable AND
if the render dtml method of the class (required by Renderable) uses
the ZCatalog.

This interaction may very well affect other products as well. But right now
my brain hurts.  Excuse me if someone else reported this, but I haven't
seen mention of it so far.

This should be easy to reproduce.  On a 2.2 system that has the Renderable
ZClass product installed, install EventFolder (it's on Zope.org, there's a .zexp
and some External Methods in the tgz file, just untar it in the Zope root and
copy the .zexp to the import dir and import it).  Try to create an
instance and you should get this error.

It seems to me the only solution is to recreate the class without the
Renderable inheritance.  Not a big deal to lose  But what other
schizoZopia is waiting in the future.


Jeff Sasmor
[EMAIL PROTECTED]


Traceback (innermost last):
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 222, in publish_module
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /usr/local/Zope220/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
(Object: RoleManager)
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /usr/local/Zope220/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 112, in call_object
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/OFS/DTMLMethod.py, line 167, in __call__
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_String.py, line 502, in 
__call__
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Let.py, line 147, in render
(Object: folder="EventFolder.createInObjectManager(REQUEST['id'], REQUEST)")
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_With.py, line 146, in render
(Object: folder)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval
(Object: 
manage_addProduct['ZCatalog'].manage_addZCatalog(this(),'Catalog','EventCatalog' ))
(Info: this)
  File string, line 0, in ?
 it begins
  File /usr/local/Zope220/lib/python/Products/ZCatalog/ZCatalog.py, line 112, in 
manage_addZCatalog
how did we get here 
  File /usr/local/Zope220/lib/python/Products/Renderable/Renderable.py, line 17, in 
__str__
(Object: Renderable)
  File /usr/local/Zope220/lib/python/OFS/DTMLMethod.py, line 167, in __call__
(Object: render)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_String.py, line 502, in 
__call__
(Object: render)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_With.py, line 146, in render
(Object: ZopeTime)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Let.py, line 147, in render
(Object: tdate="'%s/%s/1' % (tyear,tmonth) "
  this_month="'%s/%s' % (tyear,tmonth) "
  ddate="_.DateTime(tdate)")
  File /usr/local/Zope2

Re: [Zope-dev] Python 2.0

2000-07-24 Thread Jeff K. Hoffman

On Mon, 24 Jul 2000, Toby Dickenson wrote:

 On Fri, 21 Jul 2000 16:29:23 +0100, Toby Dickenson
 [EMAIL PROTECTED] wrote:
 
 This problem goes away if I don't compile python with garbage
 collection support. I guess I shouldn't be suprised.

Python 2.0? Garbage collection? Huh? What?

Last I checked, Python 1.5.2 was the newest stable release, with 1.6 being
under development. 1.7 due out by the end of the year, and Python 3000
being a redesign from the ground up.

Is there a 2.0 somewhere that I don't know about?

 Toby Dickenson
 [EMAIL PROTECTED]

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Python 2.0

2000-07-24 Thread Jeff K. Hoffman

On Tue, 25 Jul 2000, Anthony Baxter wrote:

 What was once known as 1.6 is now called 2.0.
 
 There's probably more at the pythonlabs website.
 ah, here we go
 
 http://www.pythonlabs.com/tech/python2.html
 
 
 Note that the release is currently held up for some reasons to do
 with the python team all leaving CNRI and going to BeOpen - sounds
 like some sort of licensing or copyright ugliness.
 
 The python development's moved to sourceforge in the meantime, so you
 can track it in CVS if you feel so inclined.

Ahh hah. I had looked on python.org and found nothing, but this explains
why.

That clears it up. Thanks.

 Anthony

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] default__class_init__

2000-07-19 Thread Jeff K. Hoffman

Hello,

Should I call default__class_init__ on all of my Python products that care
about permissions? Or are there some times when it is not required?

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

Hello,

What is the easiest way for me to get ahold of the Application object at
run-time?

I am writing a Product that needs to access some things in the
Control_Panel, and need the app object to get there.

I know how to do it given a reference to an object in the ZODB
(getPhysicalRoot(), etc.), but need a way to do it given no references. I
need something like:

  import AppSingleton

  app = AppSingleton.Instance()
  app.Control_Panel.blah

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

On Mon, 17 Jul 2000, Chris McDonough wrote:

 I'm not sure I understand.  What is AppSingleton?  What does the
 Instance() method do?

Sorry I wasn't clear enough. The Singleton is a design pattern from the
Gang of Four book that fits this situation well. It is a class that is 
meant to control access to the one and only instance of a global
variable. I was just using that as a frame of reference, though; Zope has
no such class for the Application object, or I wouldn't be writing this
message.

I just need some way of getting at the one and only Application object at
run-time. Something like:

  from Globals import app
  myOb = app.Control_Panel.Products.MyProduct.MyZClass('foo')
  ...

Given a reference to an object in the ZODB, I can do this via:

  app = self.getPhysicalRoot()
  myOb = app.Control_Panel.Products.MyProduct.MyZClass('foo')

But, this does not work from methods like __init__, or __setstate__, where
we do not have a physical location in the ZODB, yet.

I just need a reference to the app object. I know the answer has to be
simple, but I can't find it.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

On Mon, 17 Jul 2000, Shane Hathaway wrote:

 The way to get the root application object is to open a connection to
 the ZODB and get the 'Application' object from the list of root
 objects.  There is an easy shortcut:
 
 import Zope
 app = Zope.app()
 
 app now refers to a *copy* of the root Application object.

Yeehaw, that worked! I was so close. :-)

 When you're done modifying it and its descendants you have to commit or
 abort the transaction.

[snip]

Do I need to commit or abort even if I don't make changes to the
application object? The only thing I need it for is to get to the
Control_Panel; I am instantiating ZClass instances in the constructor of a
Python class, i.e.:

class MyClass:

  def __init__(self, id, title=''):
  import Zope
  app = Zope.app()

  ob = app.Control_Panel.Products.MyProduct.MyZClass('newId')
  ob.id = 'newId'

  self._setObject('newId', ob)

  # Do I need a get_transaction().abort() here? Will that not abort
  # the wrong transaction?

  app._p_jar.close()

  ...

 This gives you all kinds of benefits like undo and elimination of
 threading conflicts.

[snip]

Good stuff. Thanks, Shane.

 Shane

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] adding attributes to a python product

2000-06-29 Thread Jeff K. Hoffman

On Thu, 29 Jun 2000, Steve Alexander wrote:

 Hi folks,
 
 Is there any way of interacting with the ZODB persistence machinery to
 add the default attribute to all instances as they are brought out of
 persistent storage -- so that I can just restart Zope, and have all of
 my instances updated as I use them ?

In addition to the method Bryan detailed, you should look into the
__setstate__() method.

From http://www.zope.org/Members/michel/HowTos/ZODB-How-To:

  "When an object is activated by the object database and brought into
   memory, it's __setstate__() method is called. A Persistent class can
   override this method to initialize the object every time it is brought
   into memory.

   __setstate__() is also useful to upgrade an object from one version to
   another. If you add instance attributes to your product, older versions
   of the instances of that product will not have the new attribute.
   __setstate__ can check for the existance of new attributes, and create
   them with sane defaults in older versions of the instance."

 Thanks for any help.

Hope this helps.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Getting SessionUID from FSSession

2000-06-16 Thread Jeff Nielsen

How can I gather the current SessionUID from FSSession? From the docs, I
gather that

dtml-var "FSSession['SessionUID']"

should return the SessionUID, but it always returns "None". Can anyone clue
me in?

---
Jeff Nielsen
http://www.UgoFast.com/
"Where U Go Fast"


___
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] Getting SessionUID from FSSession

2000-06-16 Thread Jeff Nielsen

Beautiful, That's works. Thanks.

-Original Message-
From: Hung Jung Lu [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 16, 2000 1:59 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] Getting SessionUID from FSSession


--- In [EMAIL PROTECTED], "Jeff Nielsen" [EMAIL PROTECTED] wrote:
How can I gather the current SessionUID from FSSession? From the docs, I
gather that

dtml-var "FSSession['SessionUID']"

should return the SessionUID, but it always returns "None". Can anyone clue
me in?

Try:

  dtml-var "FSSession.getName()"

regards,

Hung Jung

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com



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