Re: r6327 - ArchGenXML/trunk

Daniel Nouri <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
yenzenz wrote:
> Author: yenzenz
> Date: Sun Apr 30 15:17:52 2006
> New Revision: 6327
> 
> Modified:
>    ArchGenXML/trunk/ArchetypesGenerator.py
> Log:
> who the fuck broke field type 'copy'? please test agx with more complex models before checkin

I guess the same holds for you :-).  You forgot to remove the pdb.

Note that I recently added a --pdb-on-exception option that starts the
pdb in post mortem mode if an exception is uncaught.  So you don't need
to add those pdb.set_trace()...

> Modified: ArchGenXML/trunk/ArchetypesGenerator.py
> ==============================================================================
> --- ArchGenXML/trunk/ArchetypesGenerator.py	(original)
> +++ ArchGenXML/trunk/ArchetypesGenerator.py	Sun Apr 30 15:17:52 2006
> @@ -13,6 +13,7 @@
>  import time
>  import os.path
>  import logging
> +from types import StringTypes
>  
>  import utils
>  from odict import odict
> @@ -1134,7 +1135,10 @@
>                  # The following is needed to work around a bug in Sunew's
>                  # array_field fix. Apparently associations don't have the
>                  # rawType key. Should be fixed elsewhere, though.
> -                if (field_spec.has_key('rawType') and
> +                if type(field_spec) in StringTypes:
> +                    # need this for copied fields
> +                    res += field_spec
> +                elif (field_spec.has_key('rawType') and
>                      field_spec.has_key('array_field')):
>                      res += self.getFieldFormatted(field_spec['name'], 
>                                                    field_spec['fieldtype'],
> @@ -1152,7 +1156,8 @@
>                                                    field_spec['indent_level']
>                                                    )
>              except Exception, e:
> -                log.critical("Couldn't set field specs: '%s'.",
> +                import pdb; pdb.set_trace()
> +                log.critical("Couldn't render fields from field_specs: '%s'.",
>                               field_specs)
>                  raise
>          return res
> @@ -1547,7 +1552,9 @@
>          """
>  
>          for field_spec in field_specs:
> -            if not field_spec.has_key('map'): continue
> +            if type(field_spec) in StringTypes or \
> +               not field_spec.has_key('map'): 
> +                continue
>              for key in field_spec['map'].keys():
>                  if key.startswith('move:'):
>                      move_key = key[5:]
> 



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.