#11 — AttributeError: formatTime, when adding a story

by Jodok Batlogg last modified Jan 08, 2009 02:42 PM
State Resolved
Version: 1.1
Area Functionality
Issue type Bug
Severity Critical
Submitted by Jodok Batlogg
Submitted on Mar 11, 2006
Responsible Maurits van Rees
Target release: 1.1




Traceback (innermost last):
  Module ZPublisher.Publish, line 113, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 40, in call_object
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 195, in _exec
  Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
  Module Products.PageTemplates.PageTemplate, line 104, in pt_render
   - <FSPageTemplate at /lovelysystems/extranet/plone/base_view used for /lovelysystems/extranet/plone/customers/intersky/intersky-web-portal/teststory>
  Module TAL.TALInterpreter, line 206, in __call__
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 711, in do_useMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 742, in do_defineSlot
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 690, in do_defineMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 734, in do_defineSlot
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 690, in do_defineMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 711, in do_useMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 477, in do_setLocal_tal
  Module Products.PageTemplates.TALES, line 221, in evaluate
   - URL: file:eXtremeManagement/skins/eXtremeManagement/story_view.pt
   - Line 82, Column 8
   - Expression: <PythonExpr here.getEstimate()>
   - Names:
      {'container': <PloneSite at /lovelysystems/extranet/plone>,
       'context': <Story at /lovelysystems/extranet/plone/customers/intersky/intersky-web-portal/teststory>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x2aaaaf5e4d88>,
       'here': <Story at /lovelysystems/extranet/plone/customers/intersky/intersky-web-portal/teststory>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x2aaab3e42050>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x2aaaaf5d2248>,
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x2aaab3e42050>,
       'request': <HTTPRequest, URL=https://extranet.lovelysystems.com/[…]/base_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at /lovelysystems/extranet/plone/base_view used for /lovelysystems/extranet/plone/customers/intersky/intersky-web-portal/teststory>,
       'traverse_subpath': [],
       'user': batlogg}
  Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
   - __traceback_info__: here.getEstimate()
  Module Python expression "here.getEstimate()", line 1, in <expression>
  Module Products.eXtremeManagement.content.Story, line 201, in getEstimate
AttributeError: formatTime
Steps to reproduce:
https://svn.zestsoftware.nl/[…]/
Revision 4493
Added by Jodok Batlogg on Mar 11, 2006 09:59 PM
Issue state: unconfirmedopen
Responsible manager: mauritsbatlogg
formatTime was only working inside a projectFolder as it was called by acquisition. created a tool for such (and further) utilities on the lovely-pas branch
Added by Maurits van Rees on Mar 14, 2006 08:38 AM
I already thought we may need a tools section for functions like this that are inconvenient to call via acquisition. Good work!
Added by (anonymous) on May 18, 2006 03:00 PM
Hi,
I have same problem in my installation when adding a story. Is there a way to solve it right now? or I have to download all the lovely-pas files?
Added by Maurits van Rees on May 18, 2006 09:16 PM
The steps to reproduce this aren't clear, so I don't really see what causes this.

But the lovely-pas branch could probably use some testing, so if you want to try that, that would be good. We want to merge that branch back to trunk eventually, preferably within a month.

If you don't want to use that branch but are interested in a workaround, you could copy the functions formatMinutes and formatTime from content/ProjecFolder.py to somewhere that is always traversable from a Story (maybe a Python Script in a skin directory?) and adapt it so it works in that place.
Added by (anonymous) on May 19, 2006 06:16 AM
ok tried now the lovely-pas branch... instead formatTime error anotherone occurred. Maybe this information helps you:

  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 772, in do_defineSlot
    self.interpret(slot)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 457, in do_optTag_tal
    self.do_optTag(stuff)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 442, in do_optTag
    return self.no_tag(start, program)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 437, in no_tag
    self.interpret(program)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 728, in do_defineMacro
    self.interpret(macro)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 457, in do_optTag_tal
    self.do_optTag(stuff)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 442, in do_optTag
    return self.no_tag(start, program)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 437, in no_tag
    self.interpret(program)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 749, in do_useMacro
    self.interpret(macro)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 281, in interpret
    handlers[opcode](self, args)
  File "/usr/local/Zope-2.9/lib/python/TAL/TALInterpreter.py", line 507, in do_setLocal_tal
    self.engine.setLocal(name, self.engine.evaluateValue(expr))
  File "/usr/local/Zope-2.9/lib/python/Products/PageTemplates/TALES.py", line 221, in evaluate
    return expression(self)
  File "/usr/local/Zope-2.9/lib/python/Products/PageTemplates/ZRPythonExpr.py", line 47, in __call__
    return eval(code, g, {})
  File "Python expression "here.getEstimate()"", line 1, in <expression>
  File "/var/lib/zope2.9/instance/intra/Products/eXtremeManagement/content/Story.py", line 204, in getEstimate
    xt = getToolByName(self, 'xm_tool')
  File "/var/lib/zope2.9/instance/intra/Products/CMFCore/utils.py", line 83, in getToolByName
    raise AttributeError, name
AttributeError: xm_tool
Added by (anonymous) on Sep 22, 2006 09:26 PM
Sorry but i'm unable to use your product.
Too bad i was just about writting about it in the planet.ubuntu-fr.org :-/

Traceback (innermost last):
  Module ZPublisher.Publish, line 114, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 40, in call_object
  Module Products.Archetypes.BaseFolder, line 61, in __call__
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 195, in _exec
  Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
  Module Products.PageTemplates.PageTemplate, line 104, in pt_render
   - <FSPageTemplate at /pmanagement/base_view used for /pmanagement/test-2/planning/python-learning>
  Module TAL.TALInterpreter, line 206, in __call__
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 711, in do_useMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 742, in do_defineSlot
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 690, in do_defineMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 734, in do_defineSlot
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 690, in do_defineMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 711, in do_useMacro
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 477, in do_setLocal_tal
  Module Products.PageTemplates.TALES, line 221, in evaluate
   - URL: file:eXtremeManagement/skins/eXtremeManagement/story_view.pt
   - Line 82, Column 8
   - Expression: <PythonExpr here.getEstimate()>
   - Names:
      {'container': <PloneSite at /pmanagement>,
       'context': <Story at /pmanagement/test-2/planning/python-learning>,
       'default': <Products.PageTemplates.TALES.Default instance at 0xb7343fcc>,
       'here': <Story at /pmanagement/test-2/planning/python-learning>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0xb36d8f0c>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xb732da2c>,
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0xb36d8f0c>,
       'request': <HTTPRequest, URL=http://localhost:8081/[…]/python-learning>,
       'root': <Application at >,
       'template': <FSPageTemplate at /pmanagement/base_view used for /pmanagement/test-2/planning/python-learning>,
       'traverse_subpath': [],
       'user': admin}
  Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
   - __traceback_info__: here.getEstimate()
  Module Python expression "here.getEstimate()", line 1, in <expression>
  Module Products.eXtremeManagement.content.Story, line 189, in getEstimate
AttributeError: formatTime
Added by Maurits van Rees on Sep 22, 2006 09:41 PM
Issue state: postponedin-progress
Responsible manager: batloggmaurits
This error used to surface when you managed to add a Story which didn't have a ProjectFolder in its acquisition path. There has been some reshuffling of code that should help here, mainly by batlogg in this case. So this should have been fixed by now on the subversion trunk. Can you try again?
Added by (anonymous) on Sep 22, 2006 09:54 PM
well i'm not really sure how to build it from the svn :-/
Then i found out that if i set the iteration for less than 4 week it work well.

I know it is a kind of off topic here but is it normal that i have no progress bar in the project overview (using 1.0) ?

Many thanks

tenshu
Added by Maurits van Rees on Sep 22, 2006 10:06 PM
Issue state: in-progressresolved
- Huh? I have no idea what setting the iteration length would have to do with this. But if you say so, then fine. :)


- Building from svn: no building is necessary. Instead of unpacking the tar file, you just have to do:

svn checkout https://svn.zestsoftware.nl/[…]/trunk eXtremeManagement

(If you have subversion installed, that is.)
That directory should go in your Products directory.


- Nothing has changed in the progress bars since 1.0, I think. So there should be progress bars, unless maybe you don't have any tasks yet in that project or they have no estimates. That's the only explanation I can come up with. If that is not the case, please create a new issue and give some details, because, well, it Works For Me (tm). :)

Meanwhile I'll set this issue as resolved.

No responses can be added.