Modify

Opened 15 years ago

Closed 12 years ago

Last modified 12 years ago

#6061 closed defect (worksforme)

Plugin doesn't appear in Webadmin + TicketChart macro not found

Reported by: glc.nwl@… Owned by: aviram
Priority: highest Component: TicketChartsMacro
Severity: blocker Keywords: charts
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

Hi,

After copying TicketCharts.py to my project plugins directory, the plugin is NOT listed in Trac Webadmin plugins section.

  • I'm running Trac 0.11.5
  • restarted Apache
  • when I saw this first problem, I didn't tried to go further in the setup process (didn't installed Open Flash Charts 2 and its version 2 python bindings yet)
  • enabled in trac.ini with ticketcharts.* = enabled
  • Already have AdvParseArgsPlugin and TicketStats plugins installed and both working fine.
  • Couldn't find this kind of issue regarding your plugin on the web.

I guess that it should appear at least in WebAdmin plugin's page, even without OFC, and if I try to call the macro through a wiki page, I get the standard Trac error msg :

Error: Failed to load processor TicketChart

No macro or processor named 'TicketChart' found

So it seems that TicketCharts.py isn't taken at all by Trac

Any thoughts ?

I've recently installed about 10 plugins on Trac and this is the first that doesn't appear on Webadmin. As I'm still a little newbie on Unix, I'd prefer to first ensure that the plug-in is at least "recognized" and executed by Trac, before eventually spending some hours to install and setup Open Flash Charts for nothing (if the plugin still doesn't work after that).

So, if seems possible and logical for you to encounter this issue without having Open Flash Charts installed, just tell me, and I would give a try completing the whole setup process.

Could you help ? This would be nice, as your plugin should be perfect for my needs and I would really like to make it work.

Many thanks in advance ;-)

Attachments (0)

Change History (20)

comment:2 Changed 15 years ago by glc.nwl@…

I confirm that after testing with the whole setup process even installing OpenFlash, nothing happens, your macro .py file isn't recognized nor processed by Trac.

I still have (on Trac 0.11.5) :

Error: Failed to load processor TicketChart

No macro or processor named 'TicketChart' found

With ticketcharts.* = enabled in trac.ini

comment:3 Changed 15 years ago by Lars Stavholm

Ran in to the exact same problem following those exact steps. The Trac log shows the following:

2009-11-27 12:28:31,091 Trac[loader] DEBUG: Loading file plugin TicketCharts from /usr/share/trac/plugins/TicketCharts.py
2009-11-27 12:28:31,101 Trac[loader] ERROR: Failed to load plugin from /usr/share/trac/plugins/TicketCharts.py: 
Traceback (most recent call last):
  File "/usr/lib64/python2.5/site-packages/trac/loader.py", line 91, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)
  File "/usr/share/trac/plugins/TicketCharts.py", line 70, in <module>
    import openFlashChart
ImportError: No module named openFlashChart

So, the conclusion is that you've got to install all the pieces, otherwise the plugin wont load.

comment:4 Changed 15 years ago by Lars Stavholm

Turns out that the name is wrong.

class TicketChart(WikiMacroBase):

...should be:

class TicketChartMacro(WikiMacroBase):

Now the macro actually loads in my Trac page, no errors in the log, but still no chart.

comment:5 Changed 15 years ago by Lars Stavholm

Finally, it works, and it looks absolutely astonishing!

Final tweaks:

http://whatever.host.com/trac
<proj-env>/htdocs
js
OFCDZ.swf
<proj-env>/conf/trac.ini
[ticket-charts]
js_dir = /trac/chrome/site/js
json_dir = /trac/chrome/site/js/json
ofc_file = /trac/chrome/site/OFCDZ.swf

comment:6 in reply to:  3 ; Changed 15 years ago by wawulong@…

Replying to stava@linadd.org:

... So, the conclusion is that you've got to install all the pieces, otherwise the plugin wont load.

I have the same message, but I don't understand what you mean install all the pieces. Could you describe more details?!

comment:7 in reply to:  6 ; Changed 15 years ago by Lars Stavholm

What I meant was that you should follow the instructions in the wiki about installing Open Flash Chart, AdvParse plugin, etc. That's the pieces.

comment:8 Changed 15 years ago by Ricky

Hi,

In my trac instance, everything works except that it keeps "loading" data. Any idea why?

comment:9 in reply to:  7 Changed 15 years ago by Ricky

Replying to stava@linadd.org:

What I meant was that you should follow the instructions in the wiki about installing Open Flash Chart, AdvParse plugin, etc. That's the pieces.

In my trac instance, everything works except that it keeps "loading" data. Any idea why?

comment:10 Changed 14 years ago by Ryan J Ollos

Description: modified (diff)

#6267 may be related.

comment:11 Changed 14 years ago by fimblo

Hi, has anyone gotten this to work on trac 0.11.1?

I'm encountering the same problems as YouLi, with the flash plugin displays the "Loading Data.." forever.

fyi:

  • I'm running it under tracd.
  • I can see that the js, js/json and open-flash-chart.swf files are loaded.
  • I see that the python scripts are compiled and run.

Thanks

comment:12 Changed 14 years ago by John Lee

Hi, I've got following error saying no module named cjson. Does this requires the prior installation of python-cjson library?

Thanks.

2011-03-17 10:13:49,704 Trac[loader] DEBUG: Loading tracadvparseargs.macro from c:\trac\test\plugins\tracadvparseargsplugin-0.4-py2.5.egg
2011-03-17 10:13:49,704 Trac[loader] DEBUG: Loading tracadvparseargs.parseargs from c:\trac\test\plugins\tracadvparseargsplugin-0.4-py2.5.egg
2011-03-17 10:13:49,704 Trac[loader] DEBUG: Loading file plugin TicketCharts from c:\trac\test\plugins\TicketCharts.py
2011-03-17 10:13:49,704 Trac[loader] ERROR: Failed to load plugin from c:\trac\test\plugins\TicketCharts.py: 
Traceback (most recent call last):
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac-0.11.6-py2.5-win32.egg\trac\loader.py", line 91, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)
  File "c:\trac\test\plugins\TicketCharts.py", line 70, in <module>
    import openFlashChart
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\openFlashChart.py", line 17, in <module>
    import	cjson
ImportError: No module named cjson

comment:13 Changed 12 years ago by Ryan J Ollos

If OpenFlashCharts is not installed, you'll find an error such as the following in your log (see t:TracLogging for info on setting the log level to DEBUG):

01:06:46 AM Trac[loader] ERROR: Failed to load plugin from /home/user/Workspace/th6061/tracdev/plugins/TicketCharts.py: 
Traceback (most recent call last):
  File "/home/user/Workspace/th6061/trac.git/trac/loader.py", line 90, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)
  File "/home/user/Workspace/th6061/tracdev/plugins/TicketCharts.py", line 70, in <module>
    import openFlashChart
ImportError: No module named openFlashChart

Grab the latest version of OpenFlashCharts:

wget http://downloads.sourceforge.net/project/openflashchart/open-flash-chart/Version%202%20Lug%20Wyrm%20Charmer/open-flash-chart-2-Lug-Wyrm-Charmer.zip

Following the advice in comment:5 I added to trac.ini:

[ticket-charts]
js_dir = /tracdev/chrome/site/js
json_dir = /tracdev/chrome/site/js/json
ofc_file = /tracdev/chrome/site/open-flash-chart.swf

where tracdev is the name of my Trac environment.

openFlashCharts.py depends on the cjson library. On Ubuntu,

sudo aptitude install python-cjson

or edit openFlashCharts.py to replace cjson with json.

Copy python-ofc-library-2 to lib/python2.7/site-packages and edit lib/python2.7/site-packages/easy_install.pth to add the following entry:

./python-ofc-library-2

Install advparseargsplugin.

Edit trac.ini:

[components]
tracadvparseargs.macro.parseargstestmacro = enabled

Make sure that Shockwave flash is installed in your browser.

comment:14 Changed 12 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

comment:15 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

comment:16 Changed 12 years ago by Ryan J Ollos

It should be apparent from comment:13 that the plugin is too difficult to install. Ticket #11072. has been created to handle this.

comment:17 in reply to:  13 Changed 12 years ago by Ivanelson Nunes

Replying to rjollos:

If OpenFlashCharts is not installed, you'll find an error such as the following in your log (see t:TracLogging for info on setting the log level to DEBUG): ...

Make sure that Shockwave flash is installed in your browser.

In my log does not appear this error. Even entered my dir <my trac-env>/plugins and >>did:

import TicketCharts

Without error. I do not understand why these settings:

[ticket-charts]
js_dir = /tracdev/chrome/site/js
json_dir = /tracdev/chrome/site/js/json
ofc_file = /tracdev/chrome/site/open-flash-chart.swf

I need to create these folders or do something related?

comment:18 Changed 12 years ago by Ivanelson Nunes

I found(HttpNotFound) in my Trac log.

2013-05-13 17:48:52,322 Trac[main] WARNING: [200.ZZ.ZZ.ZZZ] HTTPNotFound: 404 Not Found (No handler matched request to /site/js/swfobject.js)

I've tried several ways:

[ticket-charts]
height = 300
js_dir = /site/js
json_dir = /site/js/json
ofc_file = /site/OFC.swf
width = 500
[ticket-charts]
height = 300
js_dir = /chrome/site/js
json_dir = /chrome/site/js/json
ofc_file = /chrome/site/OFC.swf
width = 500
[ticket-charts]
height = 300
js_dir = site/js
json_dir = site/js/json
ofc_file = /chrome/site/OFC.swf
width = 500

My dir <Env/plugins>:

bkp:/var/trac/projects/mybase/plugins$ ls -l
total 948
-rw-r--r-- 1 www-data www-data  47670 May  9 10:45 EstimationTools-0.4.6-py2.7.egg
-rwxr-xr-x 1 www-data www-data 263109 May 13 15:06 OFCDZ.swf
-rwxr-xr-x 1 www-data www-data 263109 May 13 15:05 OFC.swf
-rwxr-xr-x 1 www-data www-data 263109 May 13 15:03 open-flash-chart.swf
-rwxr-xr-x 1 www-data www-data  56035 Apr 23 18:15 SimpleMultiProject-0.0.3dev-py2.7.egg
-rwxrwxrwx 1 www-data www-data  17722 May 13 14:13 TicketCharts.py
-rw-r--r-- 1 www-data www-data  17501 May 13 14:14 TicketCharts.pyc
-rw-r--r-- 1 www-data www-data  20626 Mar 18 18:32 TracSubTicketsPlugin-0.2.0.dev_20130318-py2.7.egg
bkp:/var/trac/projects/mybase/plugins$ 

My dir Python packages:

bkp:/usr/local/lib/python2.7/site-packages$ ls -l
total 32
-rw-r--r-- 1 root staff   990 May 13 15:23 easy-install.pth
-rw-r--r-- 1 root staff  4456 May 13 15:38 openFlashChart_elements.py
-rw-r--r-- 1 root staff  3627 May 13 15:38 openFlashChart.py
-rw-r--r-- 1 root staff 10587 May 13 15:38 openFlashChart_varieties.py
drwxr-sr-x 2 root staff  4096 May 13 13:42 python-ofc-library-2

comment:19 Changed 12 years ago by Ryan J Ollos

Please standby and I'll push some changes shortly that will eliminate the need to deal with those settings on your end :)

comment:20 in reply to:  19 ; Changed 12 years ago by Ivanelson Nunes

Replying to rjollos:

Please standby and I'll push some changes shortly that will eliminate the need to deal with those settings on your end :)

Sorry! I'm anxious. I'm going home. Later come back here.

comment:21 in reply to:  20 Changed 12 years ago by Ryan J Ollos

Replying to ivanelson:

Sorry! I'm anxious. I'm going home. Later come back here.

A new version has been pushed against #11072. The manual setup steps are eliminated. You only need to install an egg, using one of the methods described on t:TracPlugins.

Please report your experience with installing this new version to #11072.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain aviram.
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.