Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1247 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

TGTinyMCE import error & wrong script path

Reported by: joshua Owned by: alberto
Priority: normal Milestone:
Component: ToscaWidgets Version: trunk
Severity: normal Keywords:
Cc:

Description

Two errors (for me, using TurboGears on Mac OS X 10.4) in tgmce/widgets.py:

  1. in trunk, the module toscawidgets.forms can't be found. I guess this should be toscawidgets.widgets.forms
  2. path to "tiny_mce_src.js" is inserted as absolute local path ("/Users/[...]/static/javascript/tiny_mce_src.js") which results in a 404 not found (at least with my setup)

Here's the diff:

Index: tgmce/widgets.py
===================================================================
--- tgmce/widgets.py	(revision 2379)
+++ tgmce/widgets.py	(working copy)
@@ -5,15 +5,13 @@
 
 from turbojson.jsonify import encode
 from toscawidgets.api import JSSource, JSLink
-from toscawidgets.forms import TextArea
+from toscawidgets.widgets.forms import TextArea
 from tgmce import utils
 
 log = logging.getLogger(__name__)
 
 class TinyMCEJS(JSLink):
-    filename = pkg_resources.resource_filename(
-        "tgmce", "static/javascript/tiny_mce_src.js"
-        )
+    filename = "static/javascript/tiny_mce_src.js"
 
 
 class TinyMCE(TextArea):

Change History

comment:1 Changed 12 years ago by alberto

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

I have replaced TGTinyMCE with twTinyMCE at the projects' dir. The new version places TinyMCE at the toscawidgets.widgets.tinymce namespace and uses toscawidgets.js to generate the JS calls which shall initialize the JS part of the widget.

Sorry for the inconvencience, I haven't updated TGTinyMCE in a long time.

Alberto

Note: See TracTickets for help on using tickets.