On Jun 16, 3:23 am, Piotr Kęplicz <[email protected]> wrote:
> I think you should have made a "paster create -t pylons" result as an initial 
> commit - this would show the
> required steps to integrate FCKEditor. Additional commit with an original 
> FCKEditor distribution would be
> even better.

Yes it's true... something I could do when I'll get more time.

>
> Anyway, let's not forget that FCKEditor ships with a WSGI connector.

Yes and I call it from a controller. There are some typos in the
source so you'll have to fix them if you want it to work.


> I also had a problem with uploading files - their contents weren't passed 
> correctly to the connector. A
> small hack was needed (is there a better way?)

At first I used the same approach than you but I prefered to change
the request in the connector to keep their code intact as much as
possible.

if environ: # WSGI
    if 'webob._parsed_post_vars' in environ:
        self.request = environ['webob._parsed_post_vars'][0]
    else:
        self.request = cgi.FieldStorage(fp=environ['wsgi.input'],
environ=environ, keep_blank_values=1)
    self.environ = environ

>
> diff --git a/pylonsapp/lib/fckeditor/fckcommands.py 
> b/pylonsapp/lib/fckeditor/fckcommands.py
> index 2d24923..0b9e079 100644
> --- a/pylonsapp/lib/fckeditor/fckcommands.py
> +++ b/pylonsapp/lib/fckeditor/fckcommands.py
> @@ -129,9 +129,9 @@ class UploadFileCommandMixin (object):
>                 Purpose: command to upload files to server (same as 
> FileUpload)
>                 """
>                 errorNo = 0
> -               if self.request.has_key("NewFile"):
> +               if 'NewFile' in self.environ['webob._parsed_post_vars'][0]:
>                         # newFile has all the contents we need
> -                       newFile = self.request.get("NewFile", "")
> +                       newFile = 
> self.environ['webob._parsed_post_vars'][0]['NewFile']
>                         # Get the file name
>                         newFileName = newFile.filename
>                         newFileName = sanitizeFileName( newFileName )
>
> .pk.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to