Modify

Opened 2 years ago

Closed 12 months ago

#10405 closed defect (fixed)

Can't Install TracJsGanttPlugin on Trac 0.11.1

Reported by: anonymous Owned by: ChrisNelson
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 2 years ago by rjollos

  • Resolution set to duplicate
  • Status changed from new to closed

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 2 years ago by rjollos

(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 2 years ago by jorge.guerreiro@…

  • Resolution duplicate deleted
  • Status changed from closed to reopened

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 follow-up: Changed 2 years ago by jorge.guerreiro@…

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

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 18 months ago by rjollos

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 12 months ago by scott@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

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:

  • tracjsgantt/tracpm.py

     
    44import copy
    55from datetime import timedelta, datetime
    66
    7 from trac.util.datefmt import format_date, to_utimestamp, localtz, to_datetime
     7try:
     8    from trac.util.datefmt import to_utimestamp
     9except ImportError:
     10    from trac.util.datefmt import to_timestamp as to_utimestamp
     11from trac.util.datefmt import format_date, localtz, to_datetime
    812from trac.ticket import ITicketChangeListener, Ticket
    913from trac.ticket.query import Query
Last edited 12 months ago by jun66j5 (previous) (diff)

comment:7 Changed 12 months ago by rjollos

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

In 13473:

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

Add Comment

Modify Ticket

Action
as closed The owner will remain ChrisNelson.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.