Modify

Opened 11 years ago

Closed 10 years ago

#10405 closed defect (fixed)

Can't Install TracJsGanttPlugin on Trac 0.11.1

Reported by: anonymous Owned by: Chris Nelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I installed successfully TracGanttCalendarPlugin 0.11, then I tried to install TracJSGanttPlugin to test it and compare both plugins. After trying and trying I figured out that I couldn't install the plugin. The .egg is in the right place(plugins directory), and it was generated successfully with no error messages. Trac Log is set to DEBUG and shows no error and not even mentions TracJsGanttPlugin.

Trac: 	0.11.1
Python: 	2.5.2 (r252:60911, Jan 24 2010, 17:44:40) [GCC 4.3.2]
setuptools: 	0.6c8

[components]	

tracjsgantt.* 	enabled
ganttcalendar.ticketcalendar.* 	enabled
ganttcalendar.ticketgantt.* 	enabled
tracpygments.* 	enabled


[trac-jsgantt]

option.datedisplay 	dd/mm/yyyy
option.hoursperday 	4.0
option.omitmilestones 	1
option.schedule 	alap

Install log(of course I copied the generated egg to the right place):

running install
running bdist_egg
running egg_info
writing Trac_jsGantt.egg-info/PKG-INFO
writing top-level names to Trac_jsGantt.egg-info/top_level.txt
writing dependency_links to Trac_jsGantt.egg-info/dependency_links.txt
writing entry points to Trac_jsGantt.egg-info/entry_points.txt
writing manifest file 'Trac_jsGantt.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/tracjsgantt
copying build/lib/tracjsgantt/pmapi.py -> build/bdist.linux-x86_64/egg/tracjsgantt
copying build/lib/tracjsgantt/tracpm.py -> build/bdist.linux-x86_64/egg/tracjsgantt
creating build/bdist.linux-x86_64/egg/tracjsgantt/htdocs
copying build/lib/tracjsgantt/htdocs/jsgantt.compressed.js -> build/bdist.linux-x86_64/egg/tracjsgantt/htdocs
copying build/lib/tracjsgantt/htdocs/jsgantt.js -> build/bdist.linux-x86_64/egg/tracjsgantt/htdocs
copying build/lib/tracjsgantt/htdocs/jsgantt.css -> build/bdist.linux-x86_64/egg/tracjsgantt/htdocs
copying build/lib/tracjsgantt/htdocs/tracjsgantt.css -> build/bdist.linux-x86_64/egg/tracjsgantt/htdocs
copying build/lib/tracjsgantt/tracjsgantt.py -> build/bdist.linux-x86_64/egg/tracjsgantt
copying build/lib/tracjsgantt/__init__.py -> build/bdist.linux-x86_64/egg/tracjsgantt
byte-compiling build/bdist.linux-x86_64/egg/tracjsgantt/pmapi.py to pmapi.pyc
byte-compiling build/bdist.linux-x86_64/egg/tracjsgantt/tracpm.py to tracpm.pyc
byte-compiling build/bdist.linux-x86_64/egg/tracjsgantt/tracjsgantt.py to tracjsgantt.pyc
byte-compiling build/bdist.linux-x86_64/egg/tracjsgantt/__init__.py to __init__.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying Trac_jsGantt.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Trac_jsGantt.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Trac_jsGantt.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Trac_jsGantt.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Trac_jsGantt.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/Trac_jsGantt-0.10_r11863-py2.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing Trac_jsGantt-0.10_r11863-py2.5.egg
Removing /home/vodka/lib/python2.5/site-packages/Trac_jsGantt-0.10_r11863-py2.5.egg
Copying Trac_jsGantt-0.10_r11863-py2.5.egg to /home/vodka/lib/python2.5/site-packages
Removing Trac-jsGantt 0.11-r11863 from easy-install.pth file
Adding Trac-jsGantt 0.10-r11863 to easy-install.pth file

Installed /home/vodka/lib/python2.5/site-packages/Trac_jsGantt-0.10_r11863-py2.5.egg
Processing dependencies for Trac-jsGantt==0.10-r11863
Finished processing dependencies for Trac-jsGantt==0.10-r11863

I get this when I try to put [[TracJsGanttChart(milestone=Release 1.1)]] in the wiki:

Error: Failed to load processor TracJsGanttChart

No macro or processor named 'TracJsGanttChart' found

If any other information is needed or if something is required to install TracJsGanttPlugin in version 0.11 please tell me.

Thanks

Attachments (0)

Change History (7)

comment:1 Changed 11 years ago by Ryan J Ollos

Resolution: duplicate
Status: newclosed

The plugin does not work in 0.11.1. The reason is explained in #9760. If you turn on t:TracLogging and restart the service, you'll see the following in the logs:

10:35:20 AM Trac[loader] ERROR: Skipping "tracjsgantt = tracjsgantt": (can't import "cannot import name javascript_quote")

I've previously attached a patch to #9760, and I'll ask the plugin author for permission to commit that change. I have to ask though, why are you using such an old version of Trac?

comment:2 Changed 11 years ago by Ryan J Ollos

(In [12096]) Fixes #9760, Refs #10405: Restore compatibility back to Trac 0.11 by adding a fallback for when trac.util.text.javascript_quote is not available (Trac < 0.11.3). Copied from hasienda's patch in [11200].

Beware of #9892 before jumping to the conclusion that the plugin doesn't work. The sample seems to be broken, but ordinary usage of the plugin seems to be okay.

comment:3 Changed 11 years ago by jorge.guerreiro@…

Resolution: duplicate
Status: closedreopened

Installed the plugin on trac 0.11.2.1 and it does not load.

get thhis error on trac.log

Skipping "tracjsgantt = tracjsgantt": (can't import "cannot import name to_utimestamp")

comment:4 Changed 11 years ago by jorge.guerreiro@…

Resolution: fixed
Status: reopenedclosed

Resolved with the following changes on tracjsgantt.py

Modified line 6 to from trac.util.datefmt import localtz. Added:

try:
  from trac.util.datefmt import to_utimestamp
except ImportError:
  from trac.util.datefmt import to_timestamp
  to_utimestamp = to_timestamp

Now the plugin gets imported into 0.11.2.1 and shows the sample chart.

[[TracJSGanttChart(sample=1)]]

Thanks to: [10717]

comment:5 in reply to:  4 Changed 11 years ago by Ryan J Ollos

Replying to jorge.guerreiro@streambow.com:

Resolved with the following changes on tracjsgantt.py

It is best to leave tickets opened until the issue is fixed in the Trac codebase. While the issue may be resolved for you, tickets should only be marked resolved when the issue is resolved in the public codebase.

In this case, the issue was fixed in [12565] after the issue was reported again in #10808.

comment:6 Changed 10 years ago by scott@…

Resolution: fixed
Status: closedreopened

Just tried building this plugin again for Trac 0.11.2.1 however it fails to load with a similar to_utimestamp error. However, this time the error occurs in tracpm.py (tested with SVN revision 13472).

Applying this patch fixes the problem and lets the plugin load again with Trac 0.11.2.1:

Index: tracjsgantt/tracpm.py =================================================================== --- tracjsgantt/tracpm.py (revision 13472) +++ tracjsgantt/tracpm.py (working copy) @@ -4,7 +4,11 @@

import copy from datetime import timedelta, datetime

-from trac.util.datefmt import format_date, to_utimestamp, localtz, to_datetime +try: + from trac.util.datefmt import to_utimestamp +except ImportError: + from trac.util.datefmt import to_timestamp as to_utimestamp +from trac.util.datefmt import format_date, localtz, to_datetime

from trac.ticket import ITicketChangeListener, Ticket from trac.ticket.query import Query

Version 0, edited 10 years ago by scott@… (next)

comment:7 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: reopenedclosed

In 13473:

As in [12565], add a fallback import since to_utimestamp is not available in Trac < 0.12. Fixes #10405.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Chris Nelson.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.