Opened 2 years ago

Closed 2 years ago

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

Reported by: Owned by: falkb ChrisNelson high TracJsGanttPlugin blocker 0.12

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
self.pm.postQuery(options, self.tickets)
File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 542, in postQuery
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'


### comment:1 Changed 2 years ago by ChrisNelson

• Status changed from new to assigned

Well, that's embarrassing.

### comment:2 Changed 2 years ago by ChrisNelson

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

### comment:3 follow-up: ↓ 6 Changed 2 years ago 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
self.pm.postQuery(options, self.tickets)
File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 542, in postQuery
File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 450, in _add_milestones
milestoneTicket = self._pseudoTicket(id,
AttributeError: 'TracPM' object has no attribute '_pseudoTicket'


### comment:4 Changed 2 years ago by falkb

• Priority changed from normal to high

### comment:5 Changed 2 years ago by ChrisNelson

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

### comment:6 in reply to: ↑ 3 Changed 2 years ago by ChrisNelson

[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.)

### comment:7 follow-ups: ↓ 8 ↓ 9 Changed 2 years ago 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?

### comment:8 in reply to: ↑ 7 ; follow-up: ↓ 10 Changed 2 years ago by 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)...

### comment:9 in reply to: ↑ 7 Changed 2 years ago by ChrisNelson

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.

### comment:10 in reply to: ↑ 8 ; follow-up: ↓ 11 Changed 2 years ago by ChrisNelson

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?

### comment:11 in reply to: ↑ 10 ; follow-up: ↓ 12 Changed 2 years ago by falkb

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...

### comment:12 in reply to: ↑ 11 ; follow-ups: ↓ 13 ↓ 16 Changed 2 years ago by 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).

### comment:13 in reply to: ↑ 12 Changed 2 years ago by ChrisNelson

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

Plugin page updated.

### comment:14 Changed 2 years ago by ChrisNelson

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

### comment:15 Changed 2 years ago by rjollos

• Description modified (diff)

### comment:16 in reply to: ↑ 12 ; follow-ups: ↓ 17 ↓ 19 Changed 2 years ago by falkb

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]


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
File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 480, in _format_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.

### comment:17 in reply to: ↑ 16 ; follow-up: ↓ 18 Changed 2 years ago by falkb

ValueError: empty string for float()

This patch should help as fix:

• ## tracjsganttplugin/0.11/tracjsgantt/tracpm.py

 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!

### comment:18 in reply to: ↑ 17 Changed 2 years ago by ChrisNelson

ValueError: empty string for float()

This patch should help as fix:

• ## tracjsganttplugin/0.11/tracjsgantt/tracpm.py

 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!

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

### comment:19 in reply to: ↑ 16 ; follow-up: ↓ 20 Changed 2 years ago by ChrisNelson

...
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).

1. for backward-compatibility, isn't it a good idea to keep with trac-jsgantt?
1. 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?

### comment:20 in reply to: ↑ 19 ; follow-up: ↓ 22 Changed 2 years ago by falkb

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. :-)

### comment:21 Changed 2 years ago by ChrisNelson

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

### comment:22 in reply to: ↑ 20 Changed 2 years ago by 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. :-)

### comment:23 Changed 2 years ago by ChrisNelson

• Resolution set to fixed
• Status changed from assigned to closed

### Modify Ticket

Change Properties