-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jacob Holm wrote:
> This looks like a bad idea. You are weakening the test by removing
> non-ascii chars here. A better approach would have been to rewrite the
> non-ascii chars using \N (or \u or \U) escapes.
Evem worse: the motivation is due to a spurious inclusion of all the
doctests in the long_description of the package: no test with any
version of the code below should be on the package page at PyPI: this
test is not "documenting" anything.
> Michael Howitz wrote:
>> Log message for revision 90434:
>> as it seems impossible to upload umlauts in long_description to pypi using distutils, so I had to replace the umlauts
>>
>> Changed:
>> U zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>>
>> -=-
>> Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>> ===================================================================
>> --- zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-08-27 11:44:57 UTC (rev 90433)
>> +++ zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-08-27 11:49:47 UTC (rev 90434)
>> @@ -18,8 +18,8 @@
>> =======
>>
>> >>> zc.sourcefactory.browser.token.fromUnicode(
>> - ... u'somestring with umlauts öäü')
>> - '45dadc304e0d6ae7f4864368bad74951'
>> + ... u'somestring with strange chars #*&_;)')
>> + 'f33b8a6b56403c9d560e2ef772336798'
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver(a)palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFItvxu+gerLs4ltQ4RAqLmAJ40Y4KPOV5v8p5PEqXg/fmVbrHbQgCdEoOA
yugJIdCWRjiLC+uqF7f5EXg=
=y50C
-----END PGP SIGNATURE-----
Hello there,
First off all, I don't have a blog so I'll be posting it here.
Yesterday I decided to setup a zopeproject generated app with mod_wsgi
and I would like to share my experience.
I am going to skip the part of setting up mod_wsgi with apache because
I think this very well documented.
My environment:
zopeproject generated app sitting at:
/opt/zope3/app
using python located at:
/usr/local
buildout-eggs located at:
/opt/buildout-eggs
For testing purposes, I've added www.foo.com to my /etc/hosts so when
I tried to reach www.foo.com it would resolve to my local machine.
Then we have virtual hosting config (www.foo.com.config in my test case) :
WSGIRestrictStdout Off
WSGIPythonHome /usr/local
WSGIDaemonProcess foo user=fcorrea group=users threads=1
maximum-requests=10000 python-path=/opt/buildout-eggs/
<VirtualHost *:80>
ServerName www.foo.com
WSGIScriptAlias /site /opt/zope3/app/bin/zope3.wsgi
WSGIProcessGroup foo
WSGIPassAuthorization On
WSGIReloadMechanism Process
SetEnv HTTP_X_VHM_HOST http://www.foo.com/site
SetEnv PASTE_CONFIG /opt/zope3/app/deploy.ini
</VirtualHost>
I created this file based on the one that Carlos de la Guardia created
for grok and did some minor changes to make it work for zope3.
Things I needed to do:
Add the WSGIRestrictStdout Off directive because for some reason zope
was trying to write something to sys.stdout and mod_wsgi didn't let it
do it.
Modify WSGIPythonHome and pointed to my custom python installation
Modify WSGIDaemonProcess and set python-path to my buildout-eggs directory
It turns out that zopeproject doesn't generate a .wsgi file for you so
you need to create one and it need to look like this:
(zope3.wsgi file based on the one repoze.grok generates)
import os, sys
sys.path.append('/opt/zope3/app/src')
from paste.deploy import loadapp
ini = '/opt/zope3/app/deploy.ini'
application = loadapp('config:%s' % ini)
Well, at this point I thought I was good to go and figured that
something was still missing.
After getting IOErros with zope trying to write logs to
/home/fcorrea/logs/z3.log instead of /opt/zope3/app/log/z3.log, I
rushed to repoze IRC channel and asked for help since they are leading
zope on wsgi stuff.
Chris McDonough again provided some guidance on trying to debug and
asked me to change the user and check if zope would try to write the
logs into that user's home directory and he was right.
That pointed me out that I needed to hardcode the z3.log and Data.fs
paths in my /opt/zope3/app/zope.conf so it would look like this:
<logfile>
path /opt/zope3/app/log/z3.log
formatter zope.exceptions.log.Formatter
</logfile>
Instead of the defaults generated by zopeproject that looks like this:
<logfile>
path log/z3.log
formatter zope.exceptions.log.Formatter
</logfile>
After changing the paths I thought I was going to see my nice app's
front page in there but there was one more error in apache's log
related to apidoc.
[Thu Aug 28 12:06:13 2008] [error] [client 127.0.0.2]
ZopeXMLConfigurationError: File "/opt/zope3/app/apidoc.zcml", line
3.2-3.60
[Thu Aug 28 12:06:13 2008] [error] [client 127.0.0.2]
ConfigurationError: ('Invalid value for', 'package', 'ImportError:
Module zope.app has no global preference')
For some reason, apidoc didn't work with my mod_wsgi setup..but heck,
I was going production with the website so who cares about apidoc
right now anyway? So that's what I did. Went back to my
/opt/zope3/app/site.zcml and commented out the apidoc snippet, which
recommends you to turn it off when going production BTW.
So that's it. It is working now and it took me about 1.5h to get it
going and I still don't know if I did it correctly. Does anyone have
any feedback on this? Anyone running plain zope3 with mod_wsgi?
I would be interested in feedback on how to improve this.
Best Regards,
Fernando
This looks like a bad idea. You are weakening the test by removing
non-ascii chars here. A better approach would have been to rewrite the
non-ascii chars using \N (or \u or \U) escapes.
Regards
- Jacob
Michael Howitz wrote:
> Log message for revision 90434:
> as it seems impossible to upload umlauts in long_description to pypi using distutils, so I had to replace the umlauts
>
> Changed:
> U zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
>
> -=-
> Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
> ===================================================================
> --- zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-08-27 11:44:57 UTC (rev 90433)
> +++ zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-08-27 11:49:47 UTC (rev 90434)
> @@ -18,8 +18,8 @@
> =======
>
> >>> zc.sourcefactory.browser.token.fromUnicode(
> - ... u'somestring with umlauts öäü')
> - '45dadc304e0d6ae7f4864368bad74951'
> + ... u'somestring with strange chars #*&_;)')
> + 'f33b8a6b56403c9d560e2ef772336798'
>
> Integer
> =======
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Checkins mailing list
> Checkins(a)zope.org
> http://mail.zope.org/mailman/listinfo/checkins
>
I am sort of at my wit's end trying to find out how to work this out,
and I've been sort of absent from Zope-dom for the a few years, so
please forgive me if I've missed an obvious statement somewhere made
about this, but...
I'd like to browse around http://cvs.zope.org/ to see some of the older
changes made to the tree. Unfortunately I cannot seem to figure out how
to make the server actually show me any files. Even if I click 'show
contents' on Attic, nothing actually appears. For example, at
http://cvs.zope.org/Zope/?hideattic=0 I get 'There are 32 files, but
none match the current selection criteria.'
Never seen a ViewCVS behave like this. Is there a way I can get in to
see the history?
Hi,
I'm trying to build a widget that allows for auto-complete of items in a
vocabulary, but also allows additional (string) values to be added. To
understand how that works, I am digging into z3c.formwidget.query, and
it looks to me like it's making incorrect assumptions about its own
interfaces.
In its interfaces.py, we have:
from zope.schema.interfaces import ISource, IVocabularyTokenized
class IQuerySource(ISource, IVocabularyTokenized):
def search(query_string):
"""Return values that match query."""
so, an IQuerySource is an ISource, which is:
class ISource(Interface):
def __contains__(value):
"""Return whether the value is available in this source
"""
and also an IVocabularyTokenized, which is:
class IBaseVocabulary(ISource):
def getTerm(value):
"""Return the ITerm object for the term 'value'.
If 'value' is not a valid term, this method raises LookupError.
"""
# BBB vocabularies are pending deprecation, hopefully in 3.3
class IIterableVocabulary(Interface):
def __iter__():
"""Return an iterator which provides the terms from the
vocabulary."""
def __len__():
"""Return the number of valid terms, or sys.maxint."""
class IVocabulary(IIterableVocabulary, IBaseVocabulary):
"""Vocabulary which is iterable."""
class IVocabularyTokenized(IVocabulary):
def getTermByToken(token):
"""Return an ITokenizedTerm for the passed-in token.
If `token` is not represented in the vocabulary, `LookupError`
is raised.
"""
First of all, it seems strange then that IQuerySource should explicitly
need to say it's derived from ISource since IVocabularyTokenized already
promises that.
However, more importantly, in the README.txt of z3c.formwidget.query we
have this:
... def getTermByValue(self, value):
... return self.vocabulary.by_value[value]
and similarly, in widget.py:
map(terms.add,
map(source.getTermByValue,
filter(lambda value: value and value not in values,
selection)))
If I'm not reading this wrong, it seems to me that z3c.formwidget.query
is using getTermByValue() (which I can't find anywhere else) instead of
getTermByToken() as defined by IVocabularyTokenized.
Is this correct?
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book