Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

classic Classic list List threaded Threaded
12 messages Options
Simon Richardson-2 Simon Richardson-2
Reply | Threaded
Open this post in threaded view
|

Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

I'm pulling my hair out trying to get zeoserver built with staticxml.  I've included 2 snippets below, one for a standalone plone instance and the other to build a production like plone with zeo server and zope clients.  I can only get a static lxml built for a standalone plone, not when i use the zeoserver recipe.  What am I doing wrong?

zc.buildout = 1.4.4

1. If I include zeo in the parts = section of my buildout.cfg then I get the following output:
==================================================================

lxml: Static build requested.
Getting distribution for 'lxml==2.3.4'.
Building lxml version 2.3.4.
Building without Cython.
Using build configuration of libxslt 1.1.17
Building against libxml2/libxslt in the following directory: /usr/lib64

2. And when zeo is not there I get what I want (i.e. parts/lxml)
====================================================================

lxml: Static build requested.
Updating _mr.developer.
Installing lxml.
lxml: CMMI libxml2 ...
lxml: Using libxml2 download url ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar

The buildout.cfg snippets
=====================

[buildout]
parts =
    lxml
    zeo
- other stuff --

# required because Centos5.9 libxml2 and linxslt files are too old and not
# compatible with diazo
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
static-build = true
force = false
# zeo server
[zeo]
recipe = plone.recipe.zeoserver
zeo-address = 9000
eggs =
    ${lxml:egg}
    ${eggs:main}


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
aclark aclark
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

Simon Richardson <claretnbluester@...> writes:

>
>
>      I'm pulling my hair out
>       trying to get zeoserver built with staticxml.  I've included 2

>       # zeo server
>       [zeo]
>       recipe = plone.recipe.zeoserver
>       zeo-address = 9000
>       eggs =
>           ${lxml:egg}
>           ${eggs:main}
>

Why would you specifically reference lxml in the ZEO eggs list? That seems a
bit odd to me. I might try without that reference (because presumably
eggs:main refers to "all the plone eggs" and lxml is included in that list)


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Jens W. klein-2 Jens W. klein-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by Simon Richardson-2
If you post the complete buildout (or a link to it) I or someone else
may see the actual problem. With snippets only theres no way to give a
good advice, except some general hints.

But the reason is: some recipe needs lxml-egg before the lxml-part is
build.

Ensure that no other parts eggs section references lxml without having

eggs =
     ${lxml:egg}
     OTHER EGGS

before all other eggs. And ever ever put any "eggs=" in the main
buildout section if you want to build custom eggs like lxml!

Also keep in mind: buildout builds up a dependency tree for ordering the
execution of parts. Actual order in "parts ="  does not matter that
much. In your case you could skip the lxml in "parts =" at all and it
would be build anyway.


hth Jens


On 2013-08-28 23:25, Simon Richardson wrote:

> I'm pulling my hair out trying to get zeoserver built with staticxml.
> I've included 2 snippets below, one for a standalone plone instance and
> the other to build a production like plone with zeo server and zope
> clients.  I can only get a static lxml built for a standalone plone, not
> when i use the zeoserver recipe.  What am I doing wrong?
>
> zc.buildout = 1.4.4
>
> 1. If I include zeo in the parts = section of my buildout.cfg then I get
> the following output:
> ==================================================================
>
> lxml: Static build requested.
> Getting distribution for 'lxml==2.3.4'.
> Building lxml version 2.3.4.
> Building without Cython.
> Using build configuration of libxslt 1.1.17
> Building against libxml2/libxslt in the following directory: */usr/lib64*
>
> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
> ====================================================================
>
> lxml: Static build requested.
> Updating _mr.developer.
> Installing lxml.
> lxml: CMMI libxml2 ...
> lxml: Using libxml2 download url
> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
>
> The buildout.cfg snippets
> =====================
>
> [buildout]
> parts =
>      lxml
>      zeo
> - other stuff --
>
> # required because Centos5.9 libxml2 and linxslt files are too old and not
> # compatible with diazo
> [lxml]
> recipe = z3c.recipe.staticlxml
> egg = lxml
> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
> static-build = true
> force = false
> # zeo server
> [zeo]
> recipe = plone.recipe.zeoserver
> zeo-address = 9000
> eggs =
>      ${lxml:egg}
>      ${eggs:main}
>
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Plone-Users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users
>


--
Klein & Partner KG, member of BlueDynamics Alliance


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Simon Richardson-2 Simon Richardson-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

Jens/Alex

Thanks for your response.

I have included below my buildout.cfg, packages.cfg and versions.cfg files

BUILDOUT.CFG
************
# Development environment buildout
# ================================
[buildout]
parts =
     lxml
     zeo
     instance
     test
     coverage-report
     omelette
     zopepy
     zopeskel
     checkversions
     mkrelease
extends =
     packages.cfg
# Packages to check out/update when buildout is run
auto-checkout =
     copsclub.policy
     copsclub.theme
     copsclub.content
# Make sure buildout always attempts to update packages
always-checkout = force
# required because Centos5.9 libxml2 and linxslt files are too old and not
# compatible with diazo
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
static-build = true
force = false
# zeo server
[zeo]
recipe = plone.recipe.zeoserver
zeo-address = 9000
eggs =
     lxml
     ${eggs:main}
     ${eggs:devtools}
# Development Zope instance. Installs the ``bin/instance`` script
[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
environment-vars =
     TZ = Europe/London
zeo-client = True
zeo-address = ${zeo:zeo-address}
shared-blob = True
eggs =
     lxml
     ${eggs:main}
     ${eggs:devtools}
# Test runner. Run: ``bin/test`` to execute all tests
[test]
recipe = zc.recipe.testrunner
eggs = ${eggs:test}
defaults = ['--auto-color', '--auto-progress']
# Coverage report generator.
# Run: ``bin/test --coverage=coverage``
# and then: ``bin/coveragereport``
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('parts/test/coverage', 'coverage')
# Installs links to all installed packages to ``parts/omelette``.
# On Windows, you need to install junction.exe first
[omelette]
recipe = collective.recipe.omelette
eggs =
     ${eggs:main}
     ${eggs:devtools}
# Installs the ``bin/zopepy`` interpreter.
[zopepy]
recipe = zc.recipe.egg
eggs =
     ${eggs:main}
     ${eggs:devtools}
interpreter = zopepy
# Installs ZopeSkel, which can be used to create new packages
# Run: ``bin/zopeskel``
[zopeskel]
recipe = zc.recipe.egg
eggs = ZopeSkel
# Tool to help check for new versions.
# Run: ``bin/checkversions versions.cfg``
[checkversions]
recipe = zc.recipe.egg
eggs = z3c.checkversions [buildout]
# Tool to make releases
# Run: ``bin/mkrelease --help``
[mkrelease]
recipe = zc.recipe.egg
eggs = jarn.mkrelease

************
PACKAGES.CFG
************

# Information about packages and known good version sets
# ======================================================
# Plone 4.2 comes with dexterity 1.2.1
# http://good-py.appspot.com/release/dexterity/1.2.1
[buildout]
extensions = mr.developer
extends =
# Known good sets of eggs we may be using
     http://dist.plone.org/release/4.2/versions.cfg
     versions.cfg
versions = versions
unzip = true
# Egg sets
[eggs]
main =
     copsclub.policy
test =
     copsclub.policy [test]
     copsclub.theme [test]
     copsclub.content [test]
devtools =
     bpython
     plone.reload
     Products.PDBDebugMode
     Products.PrintingMailHost
     Products.DocFinderTab
# Checkout locations
[sources]
copsclub.policy = fs copsclub.policy
copsclub.theme  = fs copsclub.theme
copsclub.content = fs copsclub.content

************
VERSIONS.CFG
************

# Project-specific version pins
# =============================

[versions]
# Buildout
mr.developer = 1.17
collective.recipe.omelette = 0.10

# Development tools
bpython = 0.9.7.1
pygments = 1.4
Products.DocFinderTab = 1.0.4
Products.PDBDebugMode = 1.3.1
Products.PrintingMailHost = 0.7
z3c.coverage = 1.2.0
jarn.mkrelease = 3.0.9
setuptools-git = 0.4.2
setuptools-hg = 0.2

# ZopeSkel
ZopeSkel = 2.19
Cheetah = 2.2.1
Paste = 1.7.5.1
PasteScript = 1.7.3
PasteDeploy = 1.3.4

[downloads]
varnish = http://repo.varnish-cache.org/source/varnish-2.1.5.tar.gz
pcre    =
http://downloads.sourceforge.net/project/pcre/pcre/8.01/pcre-8.01.tar.gz
libxml2 = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz


On 29/08/2013 06:18, Jens W. Klein wrote:

> If you post the complete buildout (or a link to it) I or someone else
> may see the actual problem. With snippets only theres no way to give a
> good advice, except some general hints.
>
> But the reason is: some recipe needs lxml-egg before the lxml-part is
> build.
>
> Ensure that no other parts eggs section references lxml without having
>
> eggs =
>       ${lxml:egg}
>       OTHER EGGS
>
> before all other eggs. And ever ever put any "eggs=" in the main
> buildout section if you want to build custom eggs like lxml!
>
> Also keep in mind: buildout builds up a dependency tree for ordering the
> execution of parts. Actual order in "parts ="  does not matter that
> much. In your case you could skip the lxml in "parts =" at all and it
> would be build anyway.
>
>
> hth Jens
>
>
> On 2013-08-28 23:25, Simon Richardson wrote:
>> I'm pulling my hair out trying to get zeoserver built with staticxml.
>> I've included 2 snippets below, one for a standalone plone instance and
>> the other to build a production like plone with zeo server and zope
>> clients.  I can only get a static lxml built for a standalone plone, not
>> when i use the zeoserver recipe.  What am I doing wrong?
>>
>> zc.buildout = 1.4.4
>>
>> 1. If I include zeo in the parts = section of my buildout.cfg then I get
>> the following output:
>> ==================================================================
>>
>> lxml: Static build requested.
>> Getting distribution for 'lxml==2.3.4'.
>> Building lxml version 2.3.4.
>> Building without Cython.
>> Using build configuration of libxslt 1.1.17
>> Building against libxml2/libxslt in the following directory: */usr/lib64*
>>
>> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
>> ====================================================================
>>
>> lxml: Static build requested.
>> Updating _mr.developer.
>> Installing lxml.
>> lxml: CMMI libxml2 ...
>> lxml: Using libxml2 download url
>> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
>> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
>>
>> The buildout.cfg snippets
>> =====================
>>
>> [buildout]
>> parts =
>>       lxml
>>       zeo
>> - other stuff --
>>
>> # required because Centos5.9 libxml2 and linxslt files are too old and not
>> # compatible with diazo
>> [lxml]
>> recipe = z3c.recipe.staticlxml
>> egg = lxml
>> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
>> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
>> static-build = true
>> force = false
>> # zeo server
>> [zeo]
>> recipe = plone.recipe.zeoserver
>> zeo-address = 9000
>> eggs =
>>       ${lxml:egg}
>>       ${eggs:main}
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>>
>>
>>
>> _______________________________________________
>> Plone-Users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer Dieter Maurer
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by Simon Richardson-2
Simon Richardson <[hidden email]> writes:

> I'm pulling my hair out trying to get zeoserver built with staticxml.
> I've included 2 snippets below, one for a standalone plone instance
> and the other to build a production like plone with zeo server and
> zope clients.  I can only get a static lxml built for a standalone
> plone, not when i use the zeoserver recipe.  What am I doing wrong?

I do not know what you make wrong, but I have build corresponding
instances with the universal installer (for 4.2.4).

Thus, it is definitely possible to set up Plone instances with ZEO server
using a static lxml -- and the universal installer knows how to
do it (successfully).
Maybe, you can compare your "buildout.cfg" with that
created by the universal installer?


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Jens W. klein-2 Jens W. klein-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by Simon Richardson-2
Try the following (untested by me):

On 2013-08-29 08:27, Simon Richardson wrote:
 > Jens/Alex
 >
 > Thanks for your response.
 >
 > I have included below my buildout.cfg, packages.cfg and versions.cfg
files
 >
 > BUILDOUT.CFG
 > ************
 > # Development environment buildout
 > # ================================
 > [buildout]
 > parts =
 >       lxml

remove lxml here ^^^

 >       zeo
 >       instance
 >       test
 >       coverage-report
 >       omelette
 >       zopepy
 >       zopeskel
 >       checkversions
 >       mkrelease
 > extends =
 >       packages.cfg
 > # Packages to check out/update when buildout is run
 > auto-checkout =
 >       copsclub.policy
 >       copsclub.theme
 >       copsclub.content
 > # Make sure buildout always attempts to update packages
 > always-checkout = force
 > # required because Centos5.9 libxml2 and linxslt files are too old
and not
 > # compatible with diazo
 > [lxml]
 > recipe = z3c.recipe.staticlxml
 > egg = lxml
 > libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 > static-build = true
 > force = false
 > # zeo server
 > [zeo]
 > recipe = plone.recipe.zeoserver
 > zeo-address = 9000
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Development Zope instance. Installs the ``bin/instance`` script
 > [instance]
 > recipe = plone.recipe.zope2instance
 > http-address = 8080
 > user = admin:admin
 > verbose-security = on
 > environment-vars =
 >       TZ = Europe/London
 > zeo-client = True
 > zeo-address = ${zeo:zeo-address}
 > shared-blob = True
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Test runner. Run: ``bin/test`` to execute all tests
 > [test]
 > recipe = zc.recipe.testrunner
 > eggs = ${eggs:test}

write above as:

eggs =
     ${lxml:egg}
     ${eggs:test}

 > defaults = ['--auto-color', '--auto-progress']
 > # Coverage report generator.
 > # Run: ``bin/test --coverage=coverage``
 > # and then: ``bin/coveragereport``
 > [coverage-report]
 > recipe = zc.recipe.egg
 > eggs = z3c.coverage
 > scripts = coveragereport
 > arguments = ('parts/test/coverage', 'coverage')
 > # Installs links to all installed packages to ``parts/omelette``.
 > # On Windows, you need to install junction.exe first
 > [omelette]
 > recipe = collective.recipe.omelette
 > eggs =
 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Installs the ``bin/zopepy`` interpreter.
 > [zopepy]
 > recipe = zc.recipe.egg
 > eggs =

here too:
     ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > interpreter = zopepy
 > # Installs ZopeSkel, which can be used to create new packages
 > # Run: ``bin/zopeskel``
 > [zopeskel]
 > recipe = zc.recipe.egg
 > eggs = ZopeSkel
 > # Tool to help check for new versions.
 > # Run: ``bin/checkversions versions.cfg``
 > [checkversions]
 > recipe = zc.recipe.egg
 > eggs = z3c.checkversions [buildout]
 > # Tool to make releases
 > # Run: ``bin/mkrelease --help``
 > [mkrelease]
 > recipe = zc.recipe.egg
 > eggs = jarn.mkrelease
 >
 > ************
 > PACKAGES.CFG
 > ************
 >
 > # Information about packages and known good version sets
 > # ======================================================
 > # Plone 4.2 comes with dexterity 1.2.1
 > # http://good-py.appspot.com/release/dexterity/1.2.1
 > [buildout]
 > extensions = mr.developer
 > extends =
 > # Known good sets of eggs we may be using
 >       http://dist.plone.org/release/4.2/versions.cfg
 >       versions.cfg
 > versions = versions
 > unzip = true
 > # Egg sets
 > [eggs]
 > main =
 >       copsclub.policy
 > test =
 >       copsclub.policy [test]
 >       copsclub.theme [test]
 >       copsclub.content [test]
 > devtools =
 >       bpython
 >       plone.reload
 >       Products.PDBDebugMode
 >       Products.PrintingMailHost
 >       Products.DocFinderTab
 > # Checkout locations
 > [sources]
 > copsclub.policy = fs copsclub.policy
 > copsclub.theme  = fs copsclub.theme
 > copsclub.content = fs copsclub.content
 >
 > ************
 > VERSIONS.CFG
 > ************
 >
 > # Project-specific version pins
 > # =============================
 >
 > [versions]
 > # Buildout
 > mr.developer = 1.17
 > collective.recipe.omelette = 0.10
 >
 > # Development tools
 > bpython = 0.9.7.1
 > pygments = 1.4
 > Products.DocFinderTab = 1.0.4
 > Products.PDBDebugMode = 1.3.1
 > Products.PrintingMailHost = 0.7
 > z3c.coverage = 1.2.0
 > jarn.mkrelease = 3.0.9
 > setuptools-git = 0.4.2
 > setuptools-hg = 0.2
 >
 > # ZopeSkel
 > ZopeSkel = 2.19
 > Cheetah = 2.2.1
 > Paste = 1.7.5.1
 > PasteScript = 1.7.3
 > PasteDeploy = 1.3.4
 >
 > [downloads]
 > varnish = http://repo.varnish-cache.org/source/varnish-2.1.5.tar.gz
 > pcre    =
 > http://downloads.sourceforge.net/project/pcre/pcre/8.01/pcre-8.01.tar.gz
 > libxml2 = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >
 >
 > On 29/08/2013 06:18, Jens W. Klein wrote:
 >> If you post the complete buildout (or a link to it) I or someone else
 >> may see the actual problem. With snippets only theres no way to give a
 >> good advice, except some general hints.
 >>
 >> But the reason is: some recipe needs lxml-egg before the lxml-part is
 >> build.
 >>
 >> Ensure that no other parts eggs section references lxml without having
 >>
 >> eggs =
 >>        ${lxml:egg}
 >>        OTHER EGGS
 >>
 >> before all other eggs. And ever ever put any "eggs=" in the main
 >> buildout section if you want to build custom eggs like lxml!
 >>
 >> Also keep in mind: buildout builds up a dependency tree for ordering the
 >> execution of parts. Actual order in "parts ="  does not matter that
 >> much. In your case you could skip the lxml in "parts =" at all and it
 >> would be build anyway.
 >>
 >>
 >> hth Jens
 >>
 >>
 >> On 2013-08-28 23:25, Simon Richardson wrote:
 >>> I'm pulling my hair out trying to get zeoserver built with staticxml.
 >>> I've included 2 snippets below, one for a standalone plone instance and
 >>> the other to build a production like plone with zeo server and zope
 >>> clients.  I can only get a static lxml built for a standalone
plone, not
 >>> when i use the zeoserver recipe.  What am I doing wrong?
 >>>
 >>> zc.buildout = 1.4.4
 >>>
 >>> 1. If I include zeo in the parts = section of my buildout.cfg then
I get
 >>> the following output:
 >>> ==================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Getting distribution for 'lxml==2.3.4'.
 >>> Building lxml version 2.3.4.
 >>> Building without Cython.
 >>> Using build configuration of libxslt 1.1.17
 >>> Building against libxml2/libxslt in the following directory:
*/usr/lib64*
 >>>
 >>> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
 >>> ====================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Updating _mr.developer.
 >>> Installing lxml.
 >>> lxml: CMMI libxml2 ...
 >>> lxml: Using libxml2 download url
 >>> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
 >>>
 >>> The buildout.cfg snippets
 >>> =====================
 >>>
 >>> [buildout]
 >>> parts =
 >>>        lxml
 >>>        zeo
 >>> - other stuff --
 >>>
 >>> # required because Centos5.9 libxml2 and linxslt files are too old
and not
 >>> # compatible with diazo
 >>> [lxml]
 >>> recipe = z3c.recipe.staticlxml
 >>> egg = lxml
 >>> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >>> static-build = true
 >>> force = false
 >>> # zeo server
 >>> [zeo]
 >>> recipe = plone.recipe.zeoserver
 >>> zeo-address = 9000
 >>> eggs =
 >>>        ${lxml:egg}
 >>>        ${eggs:main}


--
Klein & Partner KG, member of BlueDynamics Alliance


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Jens W. klein-2 Jens W. klein-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by aclark
On 2013-08-29 00:44, Alex Clark wrote:

> Simon Richardson <claretnbluester@...> writes:
>
>>
>>
>>       I'm pulling my hair out
>>        trying to get zeoserver built with staticxml.  I've included 2
> …
>>        # zeo server
>>        [zeo]
>>        recipe = plone.recipe.zeoserver
>>        zeo-address = 9000
>>        eggs =
>>            ${lxml:egg}
>>            ${eggs:main}
>>
>
> Why would you specifically reference lxml in the ZEO eggs list? That seems a
> bit odd to me. I might try without that reference (because presumably
> eggs:main refers to "all the plone eggs" and lxml is included in that list)

this is perfect to ensure parts build order.

Jens
--
Klein & Partner KG, member of BlueDynamics Alliance


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Simon Richardson-2 Simon Richardson-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by Jens W. klein-2
Jens, I tried out your suggestion (see updated buildout.cfg below) but got the same result.

I've included what I think is the relevant section from the output from my buildout here:

http://pastie.org/8281348

You mentioned in your previous post that buildout will determine dependencies.  Is there any way to control this to force the static build of lxml?

Simon

# Development environment buildout
# ================================
[buildout]
parts =
    zeo
    instance
    test
    coverage-report
    omelette
    zopepy
    zopeskel
    checkversions
    mkrelease
extends =
    packages.cfg
# Packages to check out/update when buildout is run
auto-checkout =
    copsclub.policy
    copsclub.theme
    copsclub.content
# Make sure buildout always attempts to update packages
always-checkout = force
# required because Centos5.9 libxml2 and linxslt files are too old and not
# compatible with diazo
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
static-build = true
force = false
# zeo server
[zeo]
recipe = plone.recipe.zeoserver
zeo-address = 9000
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Development Zope instance. Installs the ``bin/instance`` script
[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
environment-vars =
    TZ = Europe/London
zeo-client = True
zeo-address = ${zeo:zeo-address}
shared-blob = True
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Test runner. Run: ``bin/test`` to execute all tests
[test]
recipe = zc.recipe.testrunner
eggs = ${eggs:test}
defaults = ['--auto-color', '--auto-progress']
# Coverage report generator.
# Run: ``bin/test --coverage=coverage``
# and then: ``bin/coveragereport``
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('parts/test/coverage', 'coverage')
# Installs links to all installed packages to ``parts/omelette``.
# On Windows, you need to install junction.exe first
[omelette]
recipe = collective.recipe.omelette
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Installs the ``bin/zopepy`` interpreter.
[zopepy]
recipe = zc.recipe.egg
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
interpreter = zopepy
# Installs ZopeSkel, which can be used to create new packages
# Run: ``bin/zopeskel``
[zopeskel]
recipe = zc.recipe.egg
eggs = ZopeSkel
# Tool to help check for new versions.
# Run: ``bin/checkversions versions.cfg``
[checkversions]
recipe = zc.recipe.egg
eggs = z3c.checkversions [buildout]
# Tool to make releases
# Run: ``bin/mkrelease --help``
[mkrelease]
recipe = zc.recipe.egg
eggs = jarn.mkrelease


On 29/08/2013 07:46, Jens W. Klein wrote:
Try the following (untested by me):

On 2013-08-29 08:27, Simon Richardson wrote:
 > Jens/Alex
 >
 > Thanks for your response.
 >
 > I have included below my buildout.cfg, packages.cfg and versions.cfg 
files
 >
 > BUILDOUT.CFG
 > ************
 > # Development environment buildout
 > # ================================
 > [buildout]
 > parts =
 >       lxml

remove lxml here ^^^

 >       zeo
 >       instance
 >       test
 >       coverage-report
 >       omelette
 >       zopepy
 >       zopeskel
 >       checkversions
 >       mkrelease
 > extends =
 >       packages.cfg
 > # Packages to check out/update when buildout is run
 > auto-checkout =
 >       copsclub.policy
 >       copsclub.theme
 >       copsclub.content
 > # Make sure buildout always attempts to update packages
 > always-checkout = force
 > # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 > # compatible with diazo
 > [lxml]
 > recipe = z3c.recipe.staticlxml
 > egg = lxml
 > libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 > static-build = true
 > force = false
 > # zeo server
 > [zeo]
 > recipe = plone.recipe.zeoserver
 > zeo-address = 9000
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Development Zope instance. Installs the ``bin/instance`` script
 > [instance]
 > recipe = plone.recipe.zope2instance
 > http-address = 8080
 > user = admin:admin
 > verbose-security = on
 > environment-vars =
 >       TZ = Europe/London
 > zeo-client = True
 > zeo-address = ${zeo:zeo-address}
 > shared-blob = True
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Test runner. Run: ``bin/test`` to execute all tests
 > [test]
 > recipe = zc.recipe.testrunner
 > eggs = ${eggs:test}

write above as:

eggs =
     ${lxml:egg}
     ${eggs:test}

 > defaults = ['--auto-color', '--auto-progress']
 > # Coverage report generator.
 > # Run: ``bin/test --coverage=coverage``
 > # and then: ``bin/coveragereport``
 > [coverage-report]
 > recipe = zc.recipe.egg
 > eggs = z3c.coverage
 > scripts = coveragereport
 > arguments = ('parts/test/coverage', 'coverage')
 > # Installs links to all installed packages to ``parts/omelette``.
 > # On Windows, you need to install junction.exe first
 > [omelette]
 > recipe = collective.recipe.omelette
 > eggs =
 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Installs the ``bin/zopepy`` interpreter.
 > [zopepy]
 > recipe = zc.recipe.egg
 > eggs =

here too:
     ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > interpreter = zopepy
 > # Installs ZopeSkel, which can be used to create new packages
 > # Run: ``bin/zopeskel``
 > [zopeskel]
 > recipe = zc.recipe.egg
 > eggs = ZopeSkel
 > # Tool to help check for new versions.
 > # Run: ``bin/checkversions versions.cfg``
 > [checkversions]
 > recipe = zc.recipe.egg
 > eggs = z3c.checkversions [buildout]
 > # Tool to make releases
 > # Run: ``bin/mkrelease --help``
 > [mkrelease]
 > recipe = zc.recipe.egg
 > eggs = jarn.mkrelease
 >
 > ************
 > PACKAGES.CFG
 > ************
 >
 > # Information about packages and known good version sets
 > # ======================================================
 > # Plone 4.2 comes with dexterity 1.2.1
 > # http://good-py.appspot.com/release/dexterity/1.2.1
 > [buildout]
 > extensions = mr.developer
 > extends =
 > # Known good sets of eggs we may be using
 >       http://dist.plone.org/release/4.2/versions.cfg
 >       versions.cfg
 > versions = versions
 > unzip = true
 > # Egg sets
 > [eggs]
 > main =
 >       copsclub.policy
 > test =
 >       copsclub.policy [test]
 >       copsclub.theme [test]
 >       copsclub.content [test]
 > devtools =
 >       bpython
 >       plone.reload
 >       Products.PDBDebugMode
 >       Products.PrintingMailHost
 >       Products.DocFinderTab
 > # Checkout locations
 > [sources]
 > copsclub.policy = fs copsclub.policy
 > copsclub.theme  = fs copsclub.theme
 > copsclub.content = fs copsclub.content
 >
 > ************
 > VERSIONS.CFG
 > ************
 >
 > # Project-specific version pins
 > # =============================
 >
 > [versions]
 > # Buildout
 > mr.developer = 1.17
 > collective.recipe.omelette = 0.10
 >
 > # Development tools
 > bpython = 0.9.7.1
 > pygments = 1.4
 > Products.DocFinderTab = 1.0.4
 > Products.PDBDebugMode = 1.3.1
 > Products.PrintingMailHost = 0.7
 > z3c.coverage = 1.2.0
 > jarn.mkrelease = 3.0.9
 > setuptools-git = 0.4.2
 > setuptools-hg = 0.2
 >
 > # ZopeSkel
 > ZopeSkel = 2.19
 > Cheetah = 2.2.1
 > Paste = 1.7.5.1
 > PasteScript = 1.7.3
 > PasteDeploy = 1.3.4
 >
 > [downloads]
 > varnish = http://repo.varnish-cache.org/source/varnish-2.1.5.tar.gz
 > pcre    =
 > http://downloads.sourceforge.net/project/pcre/pcre/8.01/pcre-8.01.tar.gz
 > libxml2 = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >
 >
 > On 29/08/2013 06:18, Jens W. Klein wrote:
 >> If you post the complete buildout (or a link to it) I or someone else
 >> may see the actual problem. With snippets only theres no way to give a
 >> good advice, except some general hints.
 >>
 >> But the reason is: some recipe needs lxml-egg before the lxml-part is
 >> build.
 >>
 >> Ensure that no other parts eggs section references lxml without having
 >>
 >> eggs =
 >>        ${lxml:egg}
 >>        OTHER EGGS
 >>
 >> before all other eggs. And ever ever put any "eggs=" in the main
 >> buildout section if you want to build custom eggs like lxml!
 >>
 >> Also keep in mind: buildout builds up a dependency tree for ordering the
 >> execution of parts. Actual order in "parts ="  does not matter that
 >> much. In your case you could skip the lxml in "parts =" at all and it
 >> would be build anyway.
 >>
 >>
 >> hth Jens
 >>
 >>
 >> On 2013-08-28 23:25, Simon Richardson wrote:
 >>> I'm pulling my hair out trying to get zeoserver built with staticxml.
 >>> I've included 2 snippets below, one for a standalone plone instance and
 >>> the other to build a production like plone with zeo server and zope
 >>> clients.  I can only get a static lxml built for a standalone 
plone, not
 >>> when i use the zeoserver recipe.  What am I doing wrong?
 >>>
 >>> zc.buildout = 1.4.4
 >>>
 >>> 1. If I include zeo in the parts = section of my buildout.cfg then 
I get
 >>> the following output:
 >>> ==================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Getting distribution for 'lxml==2.3.4'.
 >>> Building lxml version 2.3.4.
 >>> Building without Cython.
 >>> Using build configuration of libxslt 1.1.17
 >>> Building against libxml2/libxslt in the following directory: 
*/usr/lib64*
 >>>
 >>> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
 >>> ====================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Updating _mr.developer.
 >>> Installing lxml.
 >>> lxml: CMMI libxml2 ...
 >>> lxml: Using libxml2 download url
 >>> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
 >>>
 >>> The buildout.cfg snippets
 >>> =====================
 >>>
 >>> [buildout]
 >>> parts =
 >>>        lxml
 >>>        zeo
 >>> - other stuff --
 >>>
 >>> # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 >>> # compatible with diazo
 >>> [lxml]
 >>> recipe = z3c.recipe.staticlxml
 >>> egg = lxml
 >>> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >>> static-build = true
 >>> force = false
 >>> # zeo server
 >>> [zeo]
 >>> recipe = plone.recipe.zeoserver
 >>> zeo-address = 9000
 >>> eggs =
 >>>        ${lxml:egg}
 >>>        ${eggs:main}




------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Steve McMahon Steve McMahon
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

Here's what I'd try:

1) Delete any lxml egg from your eggs, buildout cache, or .buildout directory. Delete .installed.cfg.

2) Drop the lxml_static.cfg from the unified installer into your buildout directory.


3) Run it: "bin/buildout -c lxml_static.cfg"

4) If it succeeds, you now have a working lxml egg in the right place. Delete .installed.cfg.

5) Simply add lxml to the egg list for the parts of your regular buildout that require it. Do not try to incorporate the static recipe into those buildouts. Buildout will not rebuild lxml if it can find a matching egg.

If you have a problem with #5, make sure that your final pin for lxml matches the lxml you built in step 3.

I've successfully tested this strategy with CentOS 5.x and 6.x.

Steve






On Thu, Aug 29, 2013 at 1:45 PM, Simon Richardson <[hidden email]> wrote:
Jens, I tried out your suggestion (see updated buildout.cfg below) but got the same result.

I've included what I think is the relevant section from the output from my buildout here:

http://pastie.org/8281348

You mentioned in your previous post that buildout will determine dependencies.  Is there any way to control this to force the static build of lxml?

Simon

# Development environment buildout
# ================================
[buildout]
parts =
    zeo
    instance
    test
    coverage-report
    omelette
    zopepy
    zopeskel
    checkversions
    mkrelease
extends =
    packages.cfg
# Packages to check out/update when buildout is run
auto-checkout =
    copsclub.policy
    copsclub.theme
    copsclub.content
# Make sure buildout always attempts to update packages
always-checkout = force
# required because Centos5.9 libxml2 and linxslt files are too old and not
# compatible with diazo
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
static-build = true
force = false
# zeo server
[zeo]
recipe = plone.recipe.zeoserver
zeo-address = 9000
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Development Zope instance. Installs the ``bin/instance`` script
[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
environment-vars =
    TZ = Europe/London
zeo-client = True
zeo-address = ${zeo:zeo-address}
shared-blob = True
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Test runner. Run: ``bin/test`` to execute all tests
[test]
recipe = zc.recipe.testrunner
eggs = ${eggs:test}
defaults = ['--auto-color', '--auto-progress']
# Coverage report generator.
# Run: ``bin/test --coverage=coverage``
# and then: ``bin/coveragereport``
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('parts/test/coverage', 'coverage')
# Installs links to all installed packages to ``parts/omelette``.
# On Windows, you need to install junction.exe first
[omelette]
recipe = collective.recipe.omelette
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Installs the ``bin/zopepy`` interpreter.
[zopepy]
recipe = zc.recipe.egg
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
interpreter = zopepy
# Installs ZopeSkel, which can be used to create new packages
# Run: ``bin/zopeskel``
[zopeskel]
recipe = zc.recipe.egg
eggs = ZopeSkel
# Tool to help check for new versions.
# Run: ``bin/checkversions versions.cfg``
[checkversions]
recipe = zc.recipe.egg
eggs = z3c.checkversions [buildout]
# Tool to make releases
# Run: ``bin/mkrelease --help``
[mkrelease]
recipe = zc.recipe.egg
eggs = jarn.mkrelease


On 29/08/2013 07:46, Jens W. Klein wrote:
Try the following (untested by me):

On 2013-08-29 08:27, Simon Richardson wrote:
 > Jens/Alex
 >
 > Thanks for your response.
 >
 > I have included below my buildout.cfg, packages.cfg and versions.cfg 
files
 >
 > BUILDOUT.CFG
 > ************
 > # Development environment buildout
 > # ================================
 > [buildout]
 > parts =
 >       lxml

remove lxml here ^^^

 >       zeo
 >       instance
 >       test
 >       coverage-report
 >       omelette
 >       zopepy
 >       zopeskel
 >       checkversions
 >       mkrelease
 > extends =
 >       packages.cfg
 > # Packages to check out/update when buildout is run
 > auto-checkout =
 >       copsclub.policy
 >       copsclub.theme
 >       copsclub.content
 > # Make sure buildout always attempts to update packages
 > always-checkout = force
 > # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 > # compatible with diazo
 > [lxml]
 > recipe = z3c.recipe.staticlxml
 > egg = lxml
 > libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 > static-build = true
 > force = false
 > # zeo server
 > [zeo]
 > recipe = plone.recipe.zeoserver
 > zeo-address = 9000
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Development Zope instance. Installs the ``bin/instance`` script
 > [instance]
 > recipe = plone.recipe.zope2instance
 > http-address = 8080
 > user = admin:admin
 > verbose-security = on
 > environment-vars =
 >       TZ = Europe/London
 > zeo-client = True
 > zeo-address = ${zeo:zeo-address}
 > shared-blob = True
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Test runner. Run: ``bin/test`` to execute all tests
 > [test]
 > recipe = zc.recipe.testrunner
 > eggs = ${eggs:test}

write above as:

eggs =
     ${lxml:egg}
     ${eggs:test}

 > defaults = ['--auto-color', '--auto-progress']
 > # Coverage report generator.
 > # Run: ``bin/test --coverage=coverage``
 > # and then: ``bin/coveragereport``
 > [coverage-report]
 > recipe = zc.recipe.egg
 > eggs = z3c.coverage
 > scripts = coveragereport
 > arguments = ('parts/test/coverage', 'coverage')
 > # Installs links to all installed packages to ``parts/omelette``.
 > # On Windows, you need to install junction.exe first
 > [omelette]
 > recipe = collective.recipe.omelette
 > eggs =
 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Installs the ``bin/zopepy`` interpreter.
 > [zopepy]
 > recipe = zc.recipe.egg
 > eggs =

here too:
     ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > interpreter = zopepy
 > # Installs ZopeSkel, which can be used to create new packages
 > # Run: ``bin/zopeskel``
 > [zopeskel]
 > recipe = zc.recipe.egg
 > eggs = ZopeSkel
 > # Tool to help check for new versions.
 > # Run: ``bin/checkversions versions.cfg``
 > [checkversions]
 > recipe = zc.recipe.egg
 > eggs = z3c.checkversions [buildout]
 > # Tool to make releases
 > # Run: ``bin/mkrelease --help``
 > [mkrelease]
 > recipe = zc.recipe.egg
 > eggs = jarn.mkrelease
 >
 > ************
 > PACKAGES.CFG
 > ************
 >
 > # Information about packages and known good version sets
 > # ======================================================
 > # Plone 4.2 comes with dexterity 1.2.1
 > # http://good-py.appspot.com/release/dexterity/1.2.1
 > [buildout]
 > extensions = mr.developer
 > extends =
 > # Known good sets of eggs we may be using
 >       http://dist.plone.org/release/4.2/versions.cfg
 >       versions.cfg
 > versions = versions
 > unzip = true
 > # Egg sets
 > [eggs]
 > main =
 >       copsclub.policy
 > test =
 >       copsclub.policy [test]
 >       copsclub.theme [test]
 >       copsclub.content [test]
 > devtools =
 >       bpython
 >       plone.reload
 >       Products.PDBDebugMode
 >       Products.PrintingMailHost
 >       Products.DocFinderTab
 > # Checkout locations
 > [sources]
 > copsclub.policy = fs copsclub.policy
 > copsclub.theme  = fs copsclub.theme
 > copsclub.content = fs copsclub.content
 >
 > ************
 > VERSIONS.CFG
 > ************
 >
 > # Project-specific version pins
 > # =============================
 >
 > [versions]
 > # Buildout
 > mr.developer = 1.17
 > collective.recipe.omelette = 0.10
 >
 > # Development tools
 > bpython = 0.9.7.1
 > pygments = 1.4
 > Products.DocFinderTab = 1.0.4
 > Products.PDBDebugMode = 1.3.1
 > Products.PrintingMailHost = 0.7
 > z3c.coverage = 1.2.0
 > jarn.mkrelease = 3.0.9
 > setuptools-git = 0.4.2
 > setuptools-hg = 0.2
 >
 > # ZopeSkel
 > ZopeSkel = 2.19
 > Cheetah = 2.2.1
 > Paste = 1.7.5.1
 > PasteScript = 1.7.3
 > PasteDeploy = 1.3.4
 >
 > [downloads]
 > varnish = http://repo.varnish-cache.org/source/varnish-2.1.5.tar.gz
 > pcre    =
 > http://downloads.sourceforge.net/project/pcre/pcre/8.01/pcre-8.01.tar.gz
 > libxml2 = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >
 >
 > On 29/08/2013 06:18, Jens W. Klein wrote:
 >> If you post the complete buildout (or a link to it) I or someone else
 >> may see the actual problem. With snippets only theres no way to give a
 >> good advice, except some general hints.
 >>
 >> But the reason is: some recipe needs lxml-egg before the lxml-part is
 >> build.
 >>
 >> Ensure that no other parts eggs section references lxml without having
 >>
 >> eggs =
 >>        ${lxml:egg}
 >>        OTHER EGGS
 >>
 >> before all other eggs. And ever ever put any "eggs=" in the main
 >> buildout section if you want to build custom eggs like lxml!
 >>
 >> Also keep in mind: buildout builds up a dependency tree for ordering the
 >> execution of parts. Actual order in "parts ="  does not matter that
 >> much. In your case you could skip the lxml in "parts =" at all and it
 >> would be build anyway.
 >>
 >>
 >> hth Jens
 >>
 >>
 >> On 2013-08-28 23:25, Simon Richardson wrote:
 >>> I'm pulling my hair out trying to get zeoserver built with staticxml.
 >>> I've included 2 snippets below, one for a standalone plone instance and
 >>> the other to build a production like plone with zeo server and zope
 >>> clients.  I can only get a static lxml built for a standalone 
plone, not
 >>> when i use the zeoserver recipe.  What am I doing wrong?
 >>>
 >>> zc.buildout = 1.4.4
 >>>
 >>> 1. If I include zeo in the parts = section of my buildout.cfg then 
I get
 >>> the following output:
 >>> ==================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Getting distribution for 'lxml==2.3.4'.
 >>> Building lxml version 2.3.4.
 >>> Building without Cython.
 >>> Using build configuration of libxslt 1.1.17
 >>> Building against libxml2/libxslt in the following directory: 
*/usr/lib64*
 >>>
 >>> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
 >>> ====================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Updating _mr.developer.
 >>> Installing lxml.
 >>> lxml: CMMI libxml2 ...
 >>> lxml: Using libxml2 download url
 >>> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
 >>>
 >>> The buildout.cfg snippets
 >>> =====================
 >>>
 >>> [buildout]
 >>> parts =
 >>>        lxml
 >>>        zeo
 >>> - other stuff --
 >>>
 >>> # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 >>> # compatible with diazo
 >>> [lxml]
 >>> recipe = z3c.recipe.staticlxml
 >>> egg = lxml
 >>> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >>> static-build = true
 >>> force = false
 >>> # zeo server
 >>> [zeo]
 >>> recipe = plone.recipe.zeoserver
 >>> zeo-address = 9000
 >>> eggs =
 >>>        ${lxml:egg}
 >>>        ${eggs:main}




------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users



------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
lyan lyan
Reply | Threaded
Open this post in threaded view
|

How to check emptied mysql query result in script

Hi,

I need to check the number of mysql query result from Z SQL method in python script. it works fine if there is any record. but if nothing returned, it does not work:

In the following code, no record returned from the query:
   
rs = context.myquery().dictionaries()
if not rs:
   return "result is empty"

This does not work.

I also used:

return len(rs)

it still not work.

Please anybody tell me what wrong with that. Thanks.

Lian

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Simon Richardson-2 Simon Richardson-2
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build a static lxml with zeoserver (Plone 4.2 on Centos 5.9)

In reply to this post by Steve McMahon
Steve

I'm struggling to express how happy I am at this moment in time!

The steps in your post worked for me, with a few minor adjustments documented below.  I'm not sure why my buildout failed to build zeoserver with staticlxml, but that's probably something for another day.  As I said, I'm very, very happy now.

1 - 4)

$  wget https://raw.github.com/plone/Installers-UnifiedInstaller/master/base_skeleton/lxml_static.cfg
$  ./bin/buildout -c lxml_static.cfg

I tried this a couple of times and found that I had to remove the following lines from lxml_static.cfg
< eggs-directory=../buildout-cache/eggs
< download-cache=../buildout-cache/downloads
< extensions = buildout.dumppickedversions

My site buildout didn't reference the same eggs directory and therefore missed the lxml egg created by the lxml_static cache
Buildout also complained that dumppickedversions was now included and therefore didn't need to be expressed as an extension

$ ls parts eggs | grep lxml
lxml-2.3.6-py2.6-linux-x86_64.egg
z3c.recipe.staticlxml-0.9-py2.6.egg
lxml

5) As you suggested I removed lxml from the buildout.cfg and pinned lxml = 2.3.6 in versions.cfg

I would also like to thank Jens and Alex for also taking the time out to respond to my post.

Simon

On 29/08/2013 22:45, Steve McMahon wrote:
Here's what I'd try:

1) Delete any lxml egg from your eggs, buildout cache, or .buildout directory. Delete .installed.cfg.

2) Drop the lxml_static.cfg from the unified installer into your buildout directory.


3) Run it: "bin/buildout -c lxml_static.cfg"

4) If it succeeds, you now have a working lxml egg in the right place. Delete .installed.cfg.

5) Simply add lxml to the egg list for the parts of your regular buildout that require it. Do not try to incorporate the static recipe into those buildouts. Buildout will not rebuild lxml if it can find a matching egg.

If you have a problem with #5, make sure that your final pin for lxml matches the lxml you built in step 3.

I've successfully tested this strategy with CentOS 5.x and 6.x.

Steve






On Thu, Aug 29, 2013 at 1:45 PM, Simon Richardson <[hidden email]> wrote:
Jens, I tried out your suggestion (see updated buildout.cfg below) but got the same result.

I've included what I think is the relevant section from the output from my buildout here:

http://pastie.org/8281348

You mentioned in your previous post that buildout will determine dependencies.  Is there any way to control this to force the static build of lxml?

Simon

# Development environment buildout
# ================================
[buildout]
parts =
    zeo
    instance
    test
    coverage-report
    omelette
    zopepy
    zopeskel
    checkversions
    mkrelease
extends =
    packages.cfg
# Packages to check out/update when buildout is run
auto-checkout =
    copsclub.policy
    copsclub.theme
    copsclub.content
# Make sure buildout always attempts to update packages
always-checkout = force
# required because Centos5.9 libxml2 and linxslt files are too old and not
# compatible with diazo
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
static-build = true
force = false
# zeo server
[zeo]
recipe = plone.recipe.zeoserver
zeo-address = 9000
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Development Zope instance. Installs the ``bin/instance`` script
[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
environment-vars =
    TZ = Europe/London
zeo-client = True
zeo-address = ${zeo:zeo-address}
shared-blob = True
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Test runner. Run: ``bin/test`` to execute all tests
[test]
recipe = zc.recipe.testrunner
eggs = ${eggs:test}
defaults = ['--auto-color', '--auto-progress']
# Coverage report generator.
# Run: ``bin/test --coverage=coverage``
# and then: ``bin/coveragereport``
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('parts/test/coverage', 'coverage')
# Installs links to all installed packages to ``parts/omelette``.
# On Windows, you need to install junction.exe first
[omelette]
recipe = collective.recipe.omelette
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
# Installs the ``bin/zopepy`` interpreter.
[zopepy]
recipe = zc.recipe.egg
eggs =
    ${lxml:egg}
    ${eggs:main}
    ${eggs:devtools}
interpreter = zopepy
# Installs ZopeSkel, which can be used to create new packages
# Run: ``bin/zopeskel``
[zopeskel]
recipe = zc.recipe.egg
eggs = ZopeSkel
# Tool to help check for new versions.
# Run: ``bin/checkversions versions.cfg``
[checkversions]
recipe = zc.recipe.egg
eggs = z3c.checkversions [buildout]
# Tool to make releases
# Run: ``bin/mkrelease --help``
[mkrelease]
recipe = zc.recipe.egg
eggs = jarn.mkrelease


On 29/08/2013 07:46, Jens W. Klein wrote:
Try the following (untested by me):

On 2013-08-29 08:27, Simon Richardson wrote:
 > Jens/Alex
 >
 > Thanks for your response.
 >
 > I have included below my buildout.cfg, packages.cfg and versions.cfg 
files
 >
 > BUILDOUT.CFG
 > ************
 > # Development environment buildout
 > # ================================
 > [buildout]
 > parts =
 >       lxml

remove lxml here ^^^

 >       zeo
 >       instance
 >       test
 >       coverage-report
 >       omelette
 >       zopepy
 >       zopeskel
 >       checkversions
 >       mkrelease
 > extends =
 >       packages.cfg
 > # Packages to check out/update when buildout is run
 > auto-checkout =
 >       copsclub.policy
 >       copsclub.theme
 >       copsclub.content
 > # Make sure buildout always attempts to update packages
 > always-checkout = force
 > # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 > # compatible with diazo
 > [lxml]
 > recipe = z3c.recipe.staticlxml
 > egg = lxml
 > libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 > static-build = true
 > force = false
 > # zeo server
 > [zeo]
 > recipe = plone.recipe.zeoserver
 > zeo-address = 9000
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Development Zope instance. Installs the ``bin/instance`` script
 > [instance]
 > recipe = plone.recipe.zope2instance
 > http-address = 8080
 > user = admin:admin
 > verbose-security = on
 > environment-vars =
 >       TZ = Europe/London
 > zeo-client = True
 > zeo-address = ${zeo:zeo-address}
 > shared-blob = True
 > eggs =
 >       lxml

write above as ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Test runner. Run: ``bin/test`` to execute all tests
 > [test]
 > recipe = zc.recipe.testrunner
 > eggs = ${eggs:test}

write above as:

eggs =
     ${lxml:egg}
     ${eggs:test}

 > defaults = ['--auto-color', '--auto-progress']
 > # Coverage report generator.
 > # Run: ``bin/test --coverage=coverage``
 > # and then: ``bin/coveragereport``
 > [coverage-report]
 > recipe = zc.recipe.egg
 > eggs = z3c.coverage
 > scripts = coveragereport
 > arguments = ('parts/test/coverage', 'coverage')
 > # Installs links to all installed packages to ``parts/omelette``.
 > # On Windows, you need to install junction.exe first
 > [omelette]
 > recipe = collective.recipe.omelette
 > eggs =
 >       ${eggs:main}
 >       ${eggs:devtools}
 > # Installs the ``bin/zopepy`` interpreter.
 > [zopepy]
 > recipe = zc.recipe.egg
 > eggs =

here too:
     ${lxml:egg}

 >       ${eggs:main}
 >       ${eggs:devtools}
 > interpreter = zopepy
 > # Installs ZopeSkel, which can be used to create new packages
 > # Run: ``bin/zopeskel``
 > [zopeskel]
 > recipe = zc.recipe.egg
 > eggs = ZopeSkel
 > # Tool to help check for new versions.
 > # Run: ``bin/checkversions versions.cfg``
 > [checkversions]
 > recipe = zc.recipe.egg
 > eggs = z3c.checkversions [buildout]
 > # Tool to make releases
 > # Run: ``bin/mkrelease --help``
 > [mkrelease]
 > recipe = zc.recipe.egg
 > eggs = jarn.mkrelease
 >
 > ************
 > PACKAGES.CFG
 > ************
 >
 > # Information about packages and known good version sets
 > # ======================================================
 > # Plone 4.2 comes with dexterity 1.2.1
 > # http://good-py.appspot.com/release/dexterity/1.2.1
 > [buildout]
 > extensions = mr.developer
 > extends =
 > # Known good sets of eggs we may be using
 >       http://dist.plone.org/release/4.2/versions.cfg
 >       versions.cfg
 > versions = versions
 > unzip = true
 > # Egg sets
 > [eggs]
 > main =
 >       copsclub.policy
 > test =
 >       copsclub.policy [test]
 >       copsclub.theme [test]
 >       copsclub.content [test]
 > devtools =
 >       bpython
 >       plone.reload
 >       Products.PDBDebugMode
 >       Products.PrintingMailHost
 >       Products.DocFinderTab
 > # Checkout locations
 > [sources]
 > copsclub.policy = fs copsclub.policy
 > copsclub.theme  = fs copsclub.theme
 > copsclub.content = fs copsclub.content
 >
 > ************
 > VERSIONS.CFG
 > ************
 >
 > # Project-specific version pins
 > # =============================
 >
 > [versions]
 > # Buildout
 > mr.developer = 1.17
 > collective.recipe.omelette = 0.10
 >
 > # Development tools
 > bpython = 0.9.7.1
 > pygments = 1.4
 > Products.DocFinderTab = 1.0.4
 > Products.PDBDebugMode = 1.3.1
 > Products.PrintingMailHost = 0.7
 > z3c.coverage = 1.2.0
 > jarn.mkrelease = 3.0.9
 > setuptools-git = 0.4.2
 > setuptools-hg = 0.2
 >
 > # ZopeSkel
 > ZopeSkel = 2.19
 > Cheetah = 2.2.1
 > Paste = 1.7.5.1
 > PasteScript = 1.7.3
 > PasteDeploy = 1.3.4
 >
 > [downloads]
 > varnish = http://repo.varnish-cache.org/source/varnish-2.1.5.tar.gz
 > pcre    =
 > http://downloads.sourceforge.net/project/pcre/pcre/8.01/pcre-8.01.tar.gz
 > libxml2 = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 > libxslt = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >
 >
 > On 29/08/2013 06:18, Jens W. Klein wrote:
 >> If you post the complete buildout (or a link to it) I or someone else
 >> may see the actual problem. With snippets only theres no way to give a
 >> good advice, except some general hints.
 >>
 >> But the reason is: some recipe needs lxml-egg before the lxml-part is
 >> build.
 >>
 >> Ensure that no other parts eggs section references lxml without having
 >>
 >> eggs =
 >>        ${lxml:egg}
 >>        OTHER EGGS
 >>
 >> before all other eggs. And ever ever put any "eggs=" in the main
 >> buildout section if you want to build custom eggs like lxml!
 >>
 >> Also keep in mind: buildout builds up a dependency tree for ordering the
 >> execution of parts. Actual order in "parts ="  does not matter that
 >> much. In your case you could skip the lxml in "parts =" at all and it
 >> would be build anyway.
 >>
 >>
 >> hth Jens
 >>
 >>
 >> On 2013-08-28 23:25, Simon Richardson wrote:
 >>> I'm pulling my hair out trying to get zeoserver built with staticxml.
 >>> I've included 2 snippets below, one for a standalone plone instance and
 >>> the other to build a production like plone with zeo server and zope
 >>> clients.  I can only get a static lxml built for a standalone 
plone, not
 >>> when i use the zeoserver recipe.  What am I doing wrong?
 >>>
 >>> zc.buildout = 1.4.4
 >>>
 >>> 1. If I include zeo in the parts = section of my buildout.cfg then 
I get
 >>> the following output:
 >>> ==================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Getting distribution for 'lxml==2.3.4'.
 >>> Building lxml version 2.3.4.
 >>> Building without Cython.
 >>> Using build configuration of libxslt 1.1.17
 >>> Building against libxml2/libxslt in the following directory: 
*/usr/lib64*
 >>>
 >>> 2. And when zeo is not there I get what I want (i.e. parts/lxml)
 >>> ====================================================================
 >>>
 >>> lxml: Static build requested.
 >>> Updating _mr.developer.
 >>> Installing lxml.
 >>> lxml: CMMI libxml2 ...
 >>> lxml: Using libxml2 download url
 >>> ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxml2: Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar
 >>>
 >>> The buildout.cfg snippets
 >>> =====================
 >>>
 >>> [buildout]
 >>> parts =
 >>>        lxml
 >>>        zeo
 >>> - other stuff --
 >>>
 >>> # required because Centos5.9 libxml2 and linxslt files are too old 
and not
 >>> # compatible with diazo
 >>> [lxml]
 >>> recipe = z3c.recipe.staticlxml
 >>> egg = lxml
 >>> libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
 >>> libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
 >>> static-build = true
 >>> force = false
 >>> # zeo server
 >>> [zeo]
 >>> recipe = plone.recipe.zeoserver
 >>> zeo-address = 9000
 >>> eggs =
 >>>        ${lxml:egg}
 >>>        ${eggs:main}




------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users




------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk


_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer Dieter Maurer
Reply | Threaded
Open this post in threaded view
|

Re: How to check emptied mysql query result in script

In reply to this post by lyan
"Lian Yan" <[hidden email]> writes:

> I need to check the number of mysql query result from Z SQL method in python script. it works fine if there is any record. but if nothing returned, it does not work:
>
> In the following code, no record returned from the query:
>    
> rs = context.myquery().dictionaries()
> if not rs:
>    return "result is empty"
>
> This does not work.

What happens? It should work.

The canoical way follows this principle: the result of a
"ZSQL method" tries to emulate a sequence, i.e. you can use
the usual methods and approaches for sequences.
To test for an empty sequence "s", you can use "if not s" or
"if len(s) == 0".
Thus, is "m" is a "ZSQL method", then "if not m(...)" or
"if len(m(...)) == 0" checks for an empty result.

The "dictionaries" method returns a sequence of dictionaries.
Again, this is some kind of sequence and the usual approaches
for sequences should work. Among them, the one you quoted above.


Sometimes, SQL results can surprise. I suppose that this happens
in your case. Look at the "rs" result (above) (as a sequence of
dictionaries). Likely, this will explain why "if not rs" does
not apply.
>
> I also used:
>
> return len(rs)
>
> it still not work.

This, too, should work. Look at the result in "rs".


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users