Ticket #9653 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

getting it working again after commit avalanche on 30/Dec/2011

Reported by: falkb Assigned to: ChrisNelson
Priority: high Component: TracJsGanttPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description (Last modified by rjollos)

after update to todays version:

2012-01-01 21:41:10,078 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=milestone1) failed: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 606, in expand_macro
    tasks = self._add_tasks(options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 544, in _add_tasks
    self.pm.postQuery(options, self.tickets)
  File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 542, in postQuery
    self._add_milestones(options, tickets)
  File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 450, in _add_milestones
    milestoneTicket = self.pm._pseudoTicket(id,
AttributeError: 'TracPM' object has no attribute 'pm'

Attachments

Change History

01/02/12 03:39:18 changed by ChrisNelson

  • status changed from new to assigned.

Well, that's embarrassing.

01/02/12 03:40:03 changed by ChrisNelson

(In [11087]) Wrong scope for pseudoticket function. Refs #9653.

(follow-up: ↓ 6 ) 01/02/12 09:17:46 changed by falkb

  • summary changed from Error: Macro TracJSGanttChart(milestone=milestone1) failed 'TracPM' object has no attribute 'pm' to getting it working again after commit avalanche on 30/Dec/2011.

[11087] helps for the error described above, thanks!

next error after update to [11087], (very much appreciating your work (!) but you should consider to setup a test environment for a set of cases):

[2012-01-02 09:06:09,565 p5620:t2576] formatter.py:720 ERROR: Macro TracJSGanttChart(milestone=XX X-XXXX1 - XX|XX X-XXXX2 - XX,userMap=0,format=week,resolution!=duplicate|invalid|wontfix|worksforme) failed: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 606, in expand_macro
    tasks = self._add_tasks(options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 544, in _add_tasks
    self.pm.postQuery(options, self.tickets)
  File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 542, in postQuery
    self._add_milestones(options, tickets)
  File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 450, in _add_milestones
    milestoneTicket = self._pseudoTicket(id,
AttributeError: 'TracPM' object has no attribute '_pseudoTicket'

01/02/12 09:20:08 changed by falkb

  • priority changed from normal to high.

01/02/12 17:39:13 changed by ChrisNelson

(In [11096]) Typo in pseudoTicket function name. Refs #9653.

(in reply to: ↑ 3 ) 01/02/12 17:41:25 changed by ChrisNelson

Replying to falkb:

[11087] helps for the error described above, thanks! next error after update to [11087], (very much appreciating your work (!) but you should consider to setup a test environment for a set of cases): ...

I actually do have a test environment but had some of the charts disabled while I worked on scheduling algorithms so it was easier to see the changes. (My prime motivation in integrating the multiple-charts-per-page patch was to allow me to have one page with all my test tests on it but sometimes that's just too much information.)

(follow-ups: ↓ 8 ↓ 9 ) 01/02/12 18:02:52 changed by falkb

Thanks. next step done :-) Now:

Cannot find an implementation of the "ITaskScheduler" interface named "CalendarScheduler".  Please update the option TracPM.scheduler in trac.ini.

I activated "CalendarScheduler? (tracjsgantt.tracpm.*)" and the chart comes up now. Is it right that I have to activate it? Do I need to activate the other 2 new ones (SimpleCalender?, TracPM) as well?

(in reply to: ↑ 7 ; follow-up: ↓ 10 ) 01/02/12 18:07:56 changed by falkb

Replying to falkb:

Do I need to activate the other 2 new ones (SimpleCalender?, TracPM) as well?

I activated all 3 ones now but it makes no visible difference.

Well, sorry for the bad news, now all ticktes are shown with duration 1 day here (which is wrong), start and end date are displayed as today (1/2/2012) and all ticket dependencies are lost in the chart display (no connection lines anymore)...

(in reply to: ↑ 7 ) 01/02/12 18:09:55 changed by ChrisNelson

Replying to falkb:

Thanks. next step done :-) Now: {{{ Cannot find an implementation of the "ITaskScheduler" interface named "CalendarScheduler?". Please update the option TracPM.scheduler in trac.ini. }}} I activated "CalendarScheduler? (tracjsgantt.tracpm.*)" and the chart comes up now.

Great!

Is it right that I have to activate it? Do I need to activate the other 2 new ones (SimpleCalender?, TracPM) as well?

I've struggled with getting ExtensionOption? working. It *should* work as written as I understand the documentation. I've asked on the trac-users (or trac-dev?) list and not gotten much useful help.

(in reply to: ↑ 8 ; follow-up: ↓ 11 ) 01/02/12 18:10:55 changed by ChrisNelson

Replying to falkb:

Replying to falkb:

Do I need to activate the other 2 new ones (SimpleCalender?, TracPM) as well?

I activated all 3 ones now but it makes no visible difference. Well, sorry for the bad news, now all ticktes are shown with duration 1 day here (which is wrong), start and end date are displayed as today (1/2/2012) and all ticket dependencies are lost in the chart display (no connection lines anymore)...

Is there anything in your trac.log?

(in reply to: ↑ 10 ; follow-up: ↓ 12 ) 01/02/12 18:14:22 changed by falkb

Replying to ChrisNelson:

Is there anything in your trac.log?

not with WARNING level. Timeout here for now... I'm gonna come back later with DEBUG level logging if you want to...

(in reply to: ↑ 11 ; follow-ups: ↓ 13 ↓ 16 ) 01/02/12 19:05:23 changed by ChrisNelson

Replying to falkb:

Replying to ChrisNelson:

Is there anything in your trac.log?

not with WARNING level. Timeout here for now... I'm gonna come back later with DEBUG level logging if you want to...

Aha! Now I remember. Several of the former Trac-jsGantt settings have moves with the refactoring of the PM stuff into it's own module.

[TracPM]
date_format = %Y-%m-%d
fields.estimate = estimatedhours
fields.finish = userfinish
fields.parent = parents
fields.pred = blockedby
fields.start = userstart
fields.succ = blocking
fields.worked = totalhours
milestone_type = inchpebble

I'll update the documentation on the plugin page (and the in-line documentation, too, if it's wrong).

(in reply to: ↑ 12 ) 01/02/12 19:24:29 changed by ChrisNelson

Replying to ChrisNelson:

... I'll update the documentation on the plugin page (and the in-line documentation, too, if it's wrong).

Plugin page updated.

01/02/12 19:29:06 changed by ChrisNelson

(In [11097]) Clarify where options are configured. Refs #9653.

01/02/12 22:49:29 changed by rjollos

  • description changed.

(in reply to: ↑ 12 ; follow-ups: ↓ 17 ↓ 19 ) 01/03/12 08:52:43 changed by falkb

Replying to ChrisNelson:

Aha! Now I remember. Several of the former Trac-jsGantt settings have moves with the refactoring of the PM stuff into it's own module. {{{ [TracPM]

Replying to ChrisNelson:

Aha! Now I remember. Several of the former Trac-jsGantt settings have moves with the refactoring of the PM stuff into it's own module. {{{ [TracPM]

Yes, that renaming the trac.ini section from trac-jsgantt to TracPM helps to get further.

  1. Which options actually remain in trac-jsgantt?
  2. for backward-compatibility, isn't it a good idea to keep with trac-jsgantt?
  3. If it's not shared by more than one plugin, isn't it a good idea to use the plugin name as section name?

Well, now we can go on and get to a next error:

[2012-01-03 08:37:48,849 p2600:t1092] formatter.py:720 ERROR: Macro TracJSGanttChart(milestone=XX X-XXXX1 - XX|XX X-XXXX2 - XX,userMap=0,format=week,resolution!=duplicate|invalid|wontfix|worksforme) failed: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 606, in expand_macro
    tasks = self._add_tasks(options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 570, in _add_tasks
    tasks += self._format_ticket(ticket, options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 480, in _format_ticket
    task += '"%s",' % self.pm.percentComplete(ticket)
  File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 308, in percentComplete
    worked = float(ticket[self.fields['worked']])
ValueError: empty string for float()

I'll update the documentation on the plugin page (and the in-line documentation, too, if it's wrong).

The wiki still mentions that old section name.

(in reply to: ↑ 16 ; follow-up: ↓ 18 ) 01/03/12 09:18:19 changed by falkb

Replying to falkb:

ValueError: empty string for float()

This patch should help as fix:

Index: tracjsganttplugin/0.11/tracjsgantt/tracpm.py
===================================================================
--- tracjsganttplugin/0.11/tracjsgantt/tracpm.py	(revision 11100)
+++ tracjsganttplugin/0.11/tracjsgantt/tracpm.py	(working copy)
@@ -305,7 +305,11 @@
             if (estimate == 0):
                 percent = 0
             else:
-                worked = float(ticket[self.fields['worked']])
+                workedStr = ticket[self.fields['worked']]
+                if workedStr == '':
+                    worked = 0
+                else:
+                    worked = float(workedStr)
                 percent = '%s/%s' % (worked, estimate)
         # Use percent if provided
         elif self.isCfg('percent'):

Now with that local patch the chart comes up without warnings again!

(in reply to: ↑ 17 ) 01/03/12 17:02:07 changed by ChrisNelson

Replying to falkb:

Replying to falkb:

ValueError: empty string for float()

This patch should help as fix: {{{ #!diff Index: tracjsganttplugin/0.11/tracjsgantt/tracpm.py =================================================================== --- tracjsganttplugin/0.11/tracjsgantt/tracpm.py (revision 11100) +++ tracjsganttplugin/0.11/tracjsgantt/tracpm.py (working copy) @@ -305,7 +305,11 @@ if (estimate == 0): percent = 0 else: - worked = float(ticket[self.fieldsworked?]) + workedStr = ticket[self.fieldsworked?] + if workedStr == : + worked = 0 + else: + worked = float(workedStr) percent = '%s/%s' % (worked, estimate) # Use percent if provided elif self.isCfg('percent'): }}} Now with that local patch the chart comes up without warnings again!

Thanks. I *swear* I've put that patch in before. Maybe it got lost in refactoring.

(in reply to: ↑ 16 ; follow-up: ↓ 20 ) 01/03/12 17:07:03 changed by ChrisNelson

Replying to falkb:

... Yes, that renaming the trac.ini section from trac-jsgantt to TracPM helps to get further. 1. Which options actually remain in trac-jsgantt?

The site-wide default overrides (e.g., option.userMap=0).

2. for backward-compatibility, isn't it a good idea to keep with trac-jsgantt? 3. If it's not shared by more than one plugin, isn't it a good idea to use the plugin name as section name?

This is a first step toward breaking TracPM out into its own plugin that can support not just jsGantt but also others like a WBS editor, etc.

Well, now we can go on and get to a next error: ... ValueError?: empty string for float()

I'll update the documentation on the plugin page (and the in-line documentation, too, if it's wrong).

The wiki still mentions that old section name.

I see that the configuration section has an example of [TracPM] and the option table says you can put site-wide default overrides in [trac-jsgantt]. What are you referring to?

(in reply to: ↑ 19 ; follow-up: ↓ 22 ) 01/03/12 17:11:50 changed by falkb

Replying to ChrisNelson:

I see that the configuration section has an example of [TracPM] and the option table says you can put site-wide default overrides in [trac-jsgantt]. What are you referring to?

I wasn't aware of the difference between site-wide default overrides and that breakout stuff. Now it's clear and fine with me. I think after committing that patch from above you can close this ticket now. Thanks for your fast reply. :-)

01/03/12 17:17:49 changed by ChrisNelson

(In [11103]) Handle blank worked values. Refs #9653.

(in reply to: ↑ 20 ) 01/03/12 17:22:16 changed by ChrisNelson

Replying to falkb:

Replying to ChrisNelson:

I see that the configuration section has an example of [TracPM] and the option table says you can put site-wide default overrides in [trac-jsgantt]. What are you referring to?

I wasn't aware of the difference between site-wide default overrides and that breakout stuff. Now it's clear and fine with me. I think after committing that patch from above you can close this ticket now. Thanks for your fast reply. :-)

Thanks for your feedback!

01/09/12 17:27:59 changed by ChrisNelson

  • status changed from assigned to closed.
  • resolution set to fixed.

Add/Change #9653 (getting it working again after commit avalanche on 30/Dec/2011)




Change Properties
Action