Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

ClearSilver

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 336
  • Category: Open Source
  • Founded: Jul 2, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 104 - 133 of 1451   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#104 From: Dan Janowski <danj@...>
Date: Fri Aug 8, 2003 7:02 pm
Subject: Ruby update
djjanowski
Send Email Send Email
 
I have an update for Ruby that behaves better when there are cs parse
errors and some other small things. How would you like to update? Do
you want it as a patch against 0.9 or is there any change in the CVS
situation?

Dan


--
Dan Janowski
danj@...

#105 From: Dan Janowski <danj@...>
Date: Fri Aug 8, 2003 7:04 pm
Subject: variable name in if
djjanowski
Send Email Send Email
 
<?cs each:e = entry ?>

I know that <?cs name:e ?> will yield the iterative name. How can the
same be done in an if?

<?cs if:e.name == "xxyy" ?>....

.name is not a property of e, but this is what I want to write or

<?cs if:nameof(e) == "xxyy" ?>

Dan

--
Dan Janowski
danj@...

#106 From: Brandon Long <blong@...>
Date: Fri Aug 8, 2003 7:57 pm
Subject: Re: Ruby update
blong42
Send Email Send Email
 
On 08/08/03 Dan Janowski uttered the following other thing:
> I have an update for Ruby that behaves better when there are cs parse
> errors and some other small things. How would you like to update? Do
> you want it as a patch against 0.9 or is there any change in the CVS
> situation?

Yeah, a patch would be the best way at this point.

Brandon
--
     "I don't get stopped by the police because they all assume that I'm
        already under investigation by someone else."  -- Dave Fischer
                                            http://www.fiction.net/blong/

#107 From: Brandon Long <blong@...>
Date: Fri Aug 8, 2003 7:58 pm
Subject: Re: variable name in if
blong42
Send Email Send Email
 
On 08/08/03 Dan Janowski uttered the following other thing:
> <?cs each:e = entry ?>
>
> I know that <?cs name:e ?> will yield the iterative name. How can the
> same be done in an if?
>
> <?cs if:e.name == "xxyy" ?>....
>
> .name is not a property of e, but this is what I want to write or
>
> <?cs if:nameof(e) == "xxyy" ?>

THere should be a name(e) function available in 0.9.

Also, your ruby changes should be against 0.9.1 (since I modified the
ruby stuff in 0.9 to make it work with 1.4.5

Brandon
--
  "They that can give up essential liberty to obtain a little temporary
   safety deserve neither liberty nor safety." -- Benjamin Franklin
                                            http://www.fiction.net/blong/

#108 From: "basshombre80" <basshombre80@...>
Date: Sat Aug 9, 2003 4:59 pm
Subject: Installation Docs?
basshombre80
Send Email Send Email
 
Maybe I'm just missing something, but I downloaded ClearSilver 0.9.1
and I cannot find installation docs anywhere. I could probably get it
working after tinkering around long enough (i.e. it seems fairly
straightforward), but it sure would be nice to find a single mention
of how to properly set up and begin using ClearSilver on the website
or in the docs *somewhere.* If I'm just missing it, feel free to flame
away (as long as said flames contain information on where I might find
the docs). :) Thanks.

#109 From: Brandon Long <blong@...>
Date: Sat Aug 9, 2003 5:17 pm
Subject: Re: Installation Docs?
blong42
Send Email Send Email
 
There aren't any installation docs, per se.  Its mostly a developers
library at this point.

Simplest case:
./configure
make
make install

The make install is relatively new, and just installs the
libraries/header files (and probably the perl and python modules, but
that's a guess)

The installation comes with two "demos", static.cgi (in the cgi
directory) and a simple photo viewer demo (imd/imd.cgi).

The imd directory has a README on how to set up imd with Apache.

You can use static.cgi to parse CS files by adding the following to your
apache config:
AddHandler cgi-script .cgi
Action cs-handler /cgi-bin/static.cgi
AddHandler cs-handler .cs

I actually run with:
AddHandler cs-handler .html

since any html file is a valid CS file, and my website has dozens of
.html files dating back to when I used to use ncsa server side includes.

static.cgi works by assuming that whatever file it was pointed at is a
CS template.  It first tries to load common.hdf in the same directory,
then it tries to load some other hdf files, and then it parses and
displays the template file.

Ie, if its pointed at foo.cs, it will load common.hdf, try to load
foo.cs.hdf, if that fails, it tries foo.hdf.  If the hdf defines
CGI.StaticContent, it will assume that's the real template file (which
is how we use it on www.clearsilver.net, we just point at he .hdf files,
which define StaticContent as a wrapper.cs, which includes another file
defined in the .hdf file).

As for the python usage, there is a CSPage.py file which gives some
pointers on how to use the cs handler via python.  A much more
complicated example is Scott Hassan's image_server, available from
http://www.dotfunk.com/projects/image_server

The original design of the clearsilver release was pointed more towards
a model of being rolled into your existing codebase, since most of the
original projects were commercial, but I guess we're moving more towards
a installed model.  I started work on both a freebsd ports package and
an rpm, but never really finished them.  They are in the ports
directory.  The way clearsilver currently can depend on a bunch of
different parts (perl, python, ruby, apache, java) makes it somewhat
sticky to make a ports package.  I should finish up the rpm for the next
release, I guess.

Brandon

On 08/09/03 basshombre80 uttered the following other thing:
> Maybe I'm just missing something, but I downloaded ClearSilver 0.9.1
> and I cannot find installation docs anywhere. I could probably get it
> working after tinkering around long enough (i.e. it seems fairly
> straightforward), but it sure would be nice to find a single mention
> of how to properly set up and begin using ClearSilver on the website
> or in the docs *somewhere.* If I'm just missing it, feel free to flame
> away (as long as said flames contain information on where I might find
> the docs). :) Thanks.

--
  "This universe never did make sense; I suspect it was built on a
   government contract." -- Robert A. Heinlein
                                            http://www.fiction.net/blong/

#110 From: Dan Janowski <danj@...>
Date: Sun Aug 10, 2003 3:10 pm
Subject: Re: Installation Docs?
djjanowski
Send Email Send Email
 
Brandon,

Me thinks you just wrote an install doc. Stick that in CVS as a good
start. I learned something.

Dan

On Saturday, Aug 9, 2003, at 13:17 America/New_York, Brandon Long wrote:

> There aren't any installation docs, per se.  Its mostly a developers
> library at this point.
>
> Simplest case:
> ./configure
> make
> make install
>
> The make install is relatively new, and just installs the
> libraries/header files (and probably the perl and python modules, but
> that's a guess)
>
> The installation comes with two "demos", static.cgi (in the cgi
> directory) and a simple photo viewer demo (imd/imd.cgi).
>
> The imd directory has a README on how to set up imd with Apache.
>
> You can use static.cgi to parse CS files by adding the following to
> your
> apache config:
> AddHandler cgi-script .cgi
> Action cs-handler /cgi-bin/static.cgi
> AddHandler cs-handler .cs
>
> I actually run with:
> AddHandler cs-handler .html
>
> since any html file is a valid CS file, and my website has dozens of
> .html files dating back to when I used to use ncsa server side
> includes.
>
> static.cgi works by assuming that whatever file it was pointed at is a
> CS template.  It first tries to load common.hdf in the same directory,
> then it tries to load some other hdf files, and then it parses and
> displays the template file.
>
> Ie, if its pointed at foo.cs, it will load common.hdf, try to load
> foo.cs.hdf, if that fails, it tries foo.hdf.  If the hdf defines
> CGI.StaticContent, it will assume that's the real template file (which
> is how we use it on www.clearsilver.net, we just point at he .hdf
> files,
> which define StaticContent as a wrapper.cs, which includes another file
> defined in the .hdf file).
>
> As for the python usage, there is a CSPage.py file which gives some
> pointers on how to use the cs handler via python.  A much more
> complicated example is Scott Hassan's image_server, available from
> http://www.dotfunk.com/projects/image_server
>
> The original design of the clearsilver release was pointed more towards
> a model of being rolled into your existing codebase, since most of the
> original projects were commercial, but I guess we're moving more
> towards
> a installed model.  I started work on both a freebsd ports package and
> an rpm, but never really finished them.  They are in the ports
> directory.  The way clearsilver currently can depend on a bunch of
> different parts (perl, python, ruby, apache, java) makes it somewhat
> sticky to make a ports package.  I should finish up the rpm for the
> next
> release, I guess.
>
> Brandon
>
> On 08/09/03 basshombre80 uttered the following other thing:
>> Maybe I'm just missing something, but I downloaded ClearSilver 0.9.1
>> and I cannot find installation docs anywhere. I could probably get it
>> working after tinkering around long enough (i.e. it seems fairly
>> straightforward), but it sure would be nice to find a single mention
>> of how to properly set up and begin using ClearSilver on the website
>> or in the docs *somewhere.* If I'm just missing it, feel free to flame
>> away (as long as said flames contain information on where I might find
>> the docs). :) Thanks.
>
> --
>  "This universe never did make sense; I suspect it was built on a
>   government contract." -- Robert A. Heinlein
>
> http://www.fiction.net/blong/
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
> Printer at Myinks.com. Free s/h on orders $50 or more to the US &
> Canada. http://www.c1tracking.com/l.asp?cid=5511
> http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/W4wwlB/TM
> ---------------------------------------------------------------------
> ~->
>
> To unsubscribe from this group, send an email to:
> ClearSilver-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
--
Dan Janowski
danj@...

#111 From: David Jeske <jeske@...>
Date: Mon Aug 11, 2003 6:38 am
Subject: Re: Installation Docs?
jeskeca
Send Email Send Email
 
Yes, we need to putt that all into an INSTALL file. We also need to
include a few more examples.

I also wrote this description of the components. It's not an install
doc, but it does explain a little bit more about what is in there and
why.

   http://www.amk.ca/pipermail/pyweb/2003-August/000120.html

On Sun, Aug 10, 2003 at 11:10:18AM -0400, Dan Janowski wrote:
> Me thinks you just wrote an install doc. Stick that in CVS as a good
> start. I learned something.
>
> Dan
>
> On Saturday, Aug 9, 2003, at 13:17 America/New_York, Brandon Long wrote:
>
> > There aren't any installation docs, per se.  Its mostly a developers
> > library at this point.
> >
> > Simplest case:
> > ./configure
> > make
> > make install
> >
> > The make install is relatively new, and just installs the
> > libraries/header files (and probably the perl and python modules, but
> > that's a guess)
> >
> > The installation comes with two "demos", static.cgi (in the cgi
> > directory) and a simple photo viewer demo (imd/imd.cgi).
> >
> > The imd directory has a README on how to set up imd with Apache.
> >
> > You can use static.cgi to parse CS files by adding the following to
> > your
> > apache config:
> > AddHandler cgi-script .cgi
> > Action cs-handler /cgi-bin/static.cgi
> > AddHandler cs-handler .cs
> >
> > I actually run with:
> > AddHandler cs-handler .html
> >
> > since any html file is a valid CS file, and my website has dozens of
> > .html files dating back to when I used to use ncsa server side
> > includes.
> >
> > static.cgi works by assuming that whatever file it was pointed at is a
> > CS template.  It first tries to load common.hdf in the same directory,
> > then it tries to load some other hdf files, and then it parses and
> > displays the template file.
> >
> > Ie, if its pointed at foo.cs, it will load common.hdf, try to load
> > foo.cs.hdf, if that fails, it tries foo.hdf.  If the hdf defines
> > CGI.StaticContent, it will assume that's the real template file (which
> > is how we use it on www.clearsilver.net, we just point at he .hdf
> > files,
> > which define StaticContent as a wrapper.cs, which includes another file
> > defined in the .hdf file).
> >
> > As for the python usage, there is a CSPage.py file which gives some
> > pointers on how to use the cs handler via python.  A much more
> > complicated example is Scott Hassan's image_server, available from
> > http://www.dotfunk.com/projects/image_server
> >
> > The original design of the clearsilver release was pointed more towards
> > a model of being rolled into your existing codebase, since most of the
> > original projects were commercial, but I guess we're moving more
> > towards
> > a installed model.  I started work on both a freebsd ports package and
> > an rpm, but never really finished them.  They are in the ports
> > directory.  The way clearsilver currently can depend on a bunch of
> > different parts (perl, python, ruby, apache, java) makes it somewhat
> > sticky to make a ports package.  I should finish up the rpm for the
> > next
> > release, I guess.
> >
> > Brandon
> >
> > On 08/09/03 basshombre80 uttered the following other thing:
> >> Maybe I'm just missing something, but I downloaded ClearSilver 0.9.1
> >> and I cannot find installation docs anywhere. I could probably get it
> >> working after tinkering around long enough (i.e. it seems fairly
> >> straightforward), but it sure would be nice to find a single mention
> >> of how to properly set up and begin using ClearSilver on the website
> >> or in the docs *somewhere.* If I'm just missing it, feel free to flame
> >> away (as long as said flames contain information on where I might find
> >> the docs). :) Thanks.
> >
> > --
> >  "This universe never did make sense; I suspect it was built on a
> >   government contract." -- Robert A. Heinlein
> >
> > http://www.fiction.net/blong/
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~-->
> > Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
> > Printer at Myinks.com. Free s/h on orders $50 or more to the US &
> > Canada. http://www.c1tracking.com/l.asp?cid=5511
> > http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/W4wwlB/TM
> > ---------------------------------------------------------------------
> > ~->
> >
> > To unsubscribe from this group, send an email to:
> > ClearSilver-unsubscribe@yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> --
> Dan Janowski
> danj@...
>
>
>
> To unsubscribe from this group, send an email to:
> ClearSilver-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>

--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...

#112 From: Mark Fletcher <markf@...>
Date: Tue Aug 26, 2003 4:44 am
Subject: Processing non-post post data
snoovler
Send Email Send Email
 
I want to write an XML-RPC cgi using Clearsilver, but it appears that I
can't do it using the stock Clearsilver code. With XML-RPC, basically an
XML document is 'POST'ed. That is, the method is POST, but the data is
an XML doc. Reading the code in Clearsilver, it looks like I can't
access the raw POST data. If so, would it give anyone hives to add an
HDF variable so I could access it directly? Or am I missing a better way?

Thanks,

Mark

#113 From: Brandon Long <blong@...>
Date: Tue Aug 26, 2003 6:53 am
Subject: Re: Processing non-post post data
blong42
Send Email Send Email
 
Yeah, I've thought about supporting xml-rpc.  There are a couple ways to
deal with this cleanly:

1) Any non-supported POST content-type could just be placed directly
into HDF.  Something like CGI.PostData and CGI.PostType.

2) Add an ability to add handlers for content-types.  Not sure if this
is overkill or not, but its virtually a requirement if there was going
to be as much data as there is in file upload, for instance.  I'm not
sure if there are any more types that we're likely to support in the
future (looks like text/xml is used by both xml-rpc and soap).

3) Actually parse the XML-RPC xml fragment and translate it into HDF.

Brandon

On 08/25/03 Mark Fletcher uttered the following other thing:
> I want to write an XML-RPC cgi using Clearsilver, but it appears that I
> can't do it using the stock Clearsilver code. With XML-RPC, basically an
> XML document is 'POST'ed. That is, the method is POST, but the data is
> an XML doc. Reading the code in Clearsilver, it looks like I can't
> access the raw POST data. If so, would it give anyone hives to add an
> HDF variable so I could access it directly? Or am I missing a better way?

--
   "Getting out of the chair is the first step towards leaving the room."
                                 -- Jack Wu
                                            http://www.fiction.net/blong/

#114 From: David Jeske <jeske@...>
Date: Tue Aug 26, 2003 7:05 am
Subject: Re: Processing non-post post data
jeskeca
Send Email Send Email
 
On Mon, Aug 25, 2003 at 09:44:00PM -0700, Mark Fletcher wrote:
> I want to write an XML-RPC cgi using Clearsilver, but it appears that I
> can't do it using the stock Clearsilver code. With XML-RPC, basically an
> XML document is 'POST'ed. That is, the method is POST, but the data is
> an XML doc. Reading the code in Clearsilver, it looks like I can't
> access the raw POST data. If so, would it give anyone hives to add an
> HDF variable so I could access it directly? Or am I missing a better way?

Hmm.. if I'm understanding you right, the problem is that the XML-RPC
stuff does not provide a "form variable name" for the post data. This
means that cgi_filehandle() does not work, because there is no form
variable name to hand in. Is that right?

I'm sure it could be extended so that unnamed post data goes somewhere
else in the dataset. However, currently it always puts the data to a
file and that might be somewhat sub-optimal for RPC also. I've always
felt it would be nice for clearsilver to bring the upload into memory
if it was small and spool to disk if it was big. However, it's not as
easy to provide the "cgi_filehandle()" API if it is just sitting in
memory. Clearsilver would have to write it to a file just to give you
a filehandle.

Here is the cgi_filehandle doc for context:

/*
  * Function: cgi_filehandle - return a file pointer to an uploaded file
  * Description: cgi_filehandle will return the stdio FILE pointer
  *              associated with a file that was uploaded using
  *              multipart/form-data.  The FILE pointer is positioned at
  *              the start of the file when first available.
  * Input: cgi - a pointer to a CGI struct allocated with cgi_init
  *        form_name - the form name that the file was uploaded as
  *                    (not the filename) (if NULL, we're asking for the
  *                    file handle for the PUT upload)
  * Output: None
  * Return: A stdio FILE pointer, or NULL if an error occurs (usually
  *         indicates that the form_name wasn't found, but might indicate
  *         a problem with the HDF dataset)
  */
FILE *cgi_filehandle (CGI *cgi, char *form_name);

--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...

#115 From: David Jeske <jeske@...>
Date: Tue Aug 26, 2003 7:13 am
Subject: Re: Processing non-post post data
jeskeca
Send Email Send Email
 
On Mon, Aug 25, 2003 at 11:53:59PM -0700, Brandon Long wrote:
> 1) Any non-supported POST content-type could just be placed directly
> into HDF.  Something like CGI.PostData and CGI.PostType.

How about handling this other data just like post variables, but to a
different place in the namespace?

I think all of these uploads should be handled slightly differently so
that clearsilver automatically puts them right into HDF if they are
smaller than a certain size, and makes them files if they are too big.

> 2) Add an ability to add handlers for content-types.  Not sure if this
> is overkill or not, but its virtually a requirement if there was going
> to be as much data as there is in file upload, for instance.  I'm not
> sure if there are any more types that we're likely to support in the
> future (looks like text/xml is used by both xml-rpc and soap).

I don't see why a handler is a requirement. Can't this just be spooled
to a file like anything else?

> 3) Actually parse the XML-RPC xml fragment and translate it into HDF.

This might be a convinent utility function, but seems
problematic. Mapping the model of XML, where any element can be
repeated, into HDF seems like major confusion.

--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...

#116 From: Brandon Long <blong@...>
Date: Tue Aug 26, 2003 7:22 am
Subject: Re: Processing non-post post data
blong42
Send Email Send Email
 
On 08/26/03 David Jeske uttered the following other thing:
> On Mon, Aug 25, 2003 at 09:44:00PM -0700, Mark Fletcher wrote:
> > I want to write an XML-RPC cgi using Clearsilver, but it appears that I
> > can't do it using the stock Clearsilver code. With XML-RPC, basically an
> > XML document is 'POST'ed. That is, the method is POST, but the data is
> > an XML doc. Reading the code in Clearsilver, it looks like I can't
> > access the raw POST data. If so, would it give anyone hives to add an
> > HDF variable so I could access it directly? Or am I missing a better way?
>
> Hmm.. if I'm understanding you right, the problem is that the XML-RPC
> stuff does not provide a "form variable name" for the post data. This
> means that cgi_filehandle() does not work, because there is no form
> variable name to hand in. Is that right?
>
> I'm sure it could be extended so that unnamed post data goes somewhere
> else in the dataset. However, currently it always puts the data to a
> file and that might be somewhat sub-optimal for RPC also. I've always
> felt it would be nice for clearsilver to bring the upload into memory
> if it was small and spool to disk if it was big. However, it's not as
> easy to provide the "cgi_filehandle()" API if it is just sitting in
> memory. Clearsilver would have to write it to a file just to give you
> a filehandle.

Actually, the problem is that clearsilver only deals with POST data in
two content-types, application/x-www-form-urlencoded and
multipart/form-data.  XML-RPC and SOAP both seem to use text/xml as the
content type.  With PUT, we actually just put the data on disk and a
call to cgi_filehandle() with a NULL value will return the PUT data
file.

The question is, what to do with POST data that's not in a recognized
format.

Brandon
--
   "There are only 10 types of people in this world: those who
      understand binary and those who don't."
                                  http://www.fiction.net/blong/

#117 From: Brandon Long <blong@...>
Date: Tue Aug 26, 2003 7:43 am
Subject: Re: Processing non-post post data
blong42
Send Email Send Email
 
On 08/26/03 David Jeske uttered the following other thing:
> On Mon, Aug 25, 2003 at 11:53:59PM -0700, Brandon Long wrote:
> > 1) Any non-supported POST content-type could just be placed directly
> > into HDF.  Something like CGI.PostData and CGI.PostType.
>
> How about handling this other data just like post variables, but to a
> different place in the namespace?
>
> I think all of these uploads should be handled slightly differently so
> that clearsilver automatically puts them right into HDF if they are
> smaller than a certain size, and makes them files if they are too big.

And then anything that uses the data has to be able to deal with both?
That seems like a poor API.  With multipart/form-data, its easy, files
are labeled as such, so only that part gets spooled to disk.

> > 2) Add an ability to add handlers for content-types.  Not sure if this
> > is overkill or not, but its virtually a requirement if there was going
> > to be as much data as there is in file upload, for instance.  I'm not
> > sure if there are any more types that we're likely to support in the
> > future (looks like text/xml is used by both xml-rpc and soap).
>
> I don't see why a handler is a requirement. Can't this just be spooled
> to a file like anything else?

We could spool to a file any POST of a type we don't understand, yes.
We could also allow the programmer to put in their own handler for
types, so they can do more intelligent things with them.  That seems
like the cleanest answer.

> > 3) Actually parse the XML-RPC xml fragment and translate it into HDF.
>
> This might be a convinent utility function, but seems
> problematic. Mapping the model of XML, where any element can be
> repeated, into HDF seems like major confusion.

The XML-RPC xml spec is fairly straight forward, and could be handled
explicitly.  The only thing that gets complicated are the structs.  In
general, yes it would be complicated to support arbitrary xml->hdf
mapping without some ugly choices.

Brandon
--
  "I guess life imitates William Gibson novels..." -- Andrew C. Bulhak
					     http://www.fiction.net/blong/

#118 From: David Jeske <jeske@...>
Date: Tue Aug 26, 2003 7:53 am
Subject: Re: Processing non-post post data
jeskeca
Send Email Send Email
 
On Tue, Aug 26, 2003 at 12:43:18AM -0700, Brandon Long wrote:
> And then anything that uses the data has to be able to deal with both?
> That seems like a poor API.  With multipart/form-data, its easy, files
> are labeled as such, so only that part gets spooled to disk.

I was thinking that both APIs would be made to work. Keeping things in
memory is just an optimization for smaller payloads like RPC which
would have too much of a performance hit if written to a file.

> We could spool to a file any POST of a type we don't understand, yes.
> We could also allow the programmer to put in their own handler for
> types, so they can do more intelligent things with them.  That seems
> like the cleanest answer.

Okay.. I don't have any problem with this. Seems like it will work
well for this XML-RPC case. Would the handler recieve the entire chunk
as a char*/length, or the stdio stream to incrementall read?

> > This might be a convinent utility function, but seems
> > problematic. Mapping the model of XML, where any element can be
> > repeated, into HDF seems like major confusion.
>
> The XML-RPC xml spec is fairly straight forward, and could be handled
> explicitly.

Hmm.. that's a good idea.

--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...

#119 From: Mark Fletcher <markf@...>
Date: Tue Aug 26, 2003 3:09 pm
Subject: Re: Processing non-post post data
snoovler
Send Email Send Email
 
You guys go to bed later than I do. ;-)

David Jeske wrote:

>>We could spool to a file any POST of a type we don't understand, yes.
>>We could also allow the programmer to put in their own handler for
>>types, so they can do more intelligent things with them.  That seems
>>like the cleanest answer.
>>
>>
>
>Okay.. I don't have any problem with this. Seems like it will work
>well for this XML-RPC case. Would the handler recieve the entire chunk
>as a char*/length, or the stdio stream to incrementall read?
>
>
For my purposes, everything needs to be kept in memory. Writing to disk
would kill it.

The only advantage to using a data handler registration type system were
if you were going to pass the handler a stream to read from and a
content-length, for instances where the incoming data is huge. For me,
however, I know the data I'm getting is going to be very small, so just
shoving it into an HDF variable would be easiest for me to deal with.
For maximum flexibility, you could do both. If a content handler is
registered, do that. Otherwise, create an HDF variable.


>>The XML-RPC xml spec is fairly straight forward, and could be handled
>>explicitly.
>>
>>
>
>Hmm.. that's a good idea.
>
>
I'm not sure. Seems like it'd be code-bloat for functionality that 99%
of Clearsilver's users wouldn't ever use. Unless it was a seperate file
in util or something that wasn't linked into the library by default.

Thanks,

Mark

#120 From: steve jenson <stevej@...>
Date: Tue Aug 26, 2003 5:07 pm
Subject: Re: Processing non-post post data
stevej_pobox
Send Email Send Email
 
Quoting Brandon Long (blong@...):

> Actually, the problem is that clearsilver only deals with POST data in
> two content-types, application/x-www-form-urlencoded and
> multipart/form-data.  XML-RPC and SOAP both seem to use text/xml as the
> content type.

They should be using application/xml. Even though the XML-RPC spec
says that you should use text/xml, that's a mistake; Anything sent text/*
might be munged by proxy servers in between. [*]

I would be prepared to handle both types.


-steve

[*] Tim Bray had a fun essay that touched on this subject WRT the
iTunes Music Store:
http://www.tbray.org/ongoing/When/200x/2003/04/30/AppleWA

#121 From: David Jeske <jeske@...>
Date: Fri Sep 12, 2003 9:52 pm
Subject: evar as function?
jeskeca
Send Email Send Email
 
I'm working on an html page where I want to do the equivilant of:

   <?cs var:js_escape(evar(pagecontent)) ?>

The current constructs don't seem to provide me a way to do this. Any
thoughts on how easy/hard it would be to support this Brandon?

--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...

#122 From: Brandon Long <blong@...>
Date: Fri Sep 12, 2003 10:15 pm
Subject: Re: evar as function?
blong42
Send Email Send Email
 
My gut says hell no.

At the very least, making that work like evar would be very hard, since
evar occurs at parse time, that would force evaluation of the expression
at parse time, which would mean probably rewriting the entire expression
engine.  Currently the parser generates two separate trees, one for the
cs tags and the other for the expressions individual nodes contain.
This would require partial evaluation of the expression and then linking
back to the tag tree from the expression tree (or linking to a separate
tag tree).

Making it do lvar instead (since I doubt you care about the
distinction, and probably assumed this case) would be possible. It would
create a completely separate parse/render tree done at render time of
the primary tree, just like lvar/linclude do today.  They currently
"cheat" by using the same output callback as the primary tree, which
wouldn't be possible here, we'd have to render to a string in order to
allow for the further evaluation of the expression.  Of course, because
they are completely independent, they don't have access to local
variables or macros (though it might be possible to change that with a
bunch of effort... the problem there is cleaning up any locals added
during the sub-parse).

Brandon

On 09/12/03 David Jeske uttered the following other thing:
> I'm working on an html page where I want to do the equivilant of:
>
>   <?cs var:js_escape(evar(pagecontent)) ?>
>
> The current constructs don't seem to provide me a way to do this. Any
> thoughts on how easy/hard it would be to support this Brandon?
>
> --
> David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@...
--
   "You mean the computer's making this up as it goes along?"
   "You might put it that way."
   "Well, that does make me feel a little better.  I thought I was the
    only one." -- Col. Graff and Major Imbu, _Ender's Game_
                                            http://www.fiction.net/blong/

#123 From: "kevinsl" <kevin@...>
Date: Sat Sep 13, 2003 12:24 am
Subject: using a variable in <?cs var:
kevinsl
Send Email Send Email
 
Hi, in my HDF dataset I have something like:

people.0.name
people.1.name
people.2.name

How can I create people.3.name from within a clearsilver template?
I'm going about it
like this:

<?cs set:x = len(people) ?> (find the last one)
<?cs set:people.$x.name = "something" ?>

I'm doing something wrong when referring to $x. Can anyone help?

thanks

Kevin

#124 From: Brandon Long <blong@...>
Date: Sat Sep 13, 2003 6:47 am
Subject: Re: using a variable in <?cs var:
blong42
Send Email Send Email
 
On 09/13/03 kevinsl uttered the following other thing:
> Hi, in my HDF dataset I have something like:
>
> people.0.name
> people.1.name
> people.2.name
>
> How can I create people.3.name from within a clearsilver template?
> I'm going about it
> like this:
>
> <?cs set:x = len(people) ?> (find the last one)
> <?cs set:people.$x.name = "something" ?>

You want to use this instead:
<?cs set:people[x].name = "something"

Brandon
--
        "When the going gets rough, the average get conservative."
                                                -- Henry Rollins
                                            http://www.fiction.net/blong/

#125 From: "basshombre80" <basshombre80@...>
Date: Mon Sep 15, 2003 6:41 pm
Subject: common.hdf?
basshombre80
Send Email Send Email
 
I thought that static.cgi loaded common.hdf and foo.cs.hdf or foo.hdf.
I have some Site.Sections.# data in common.hdf and a header.cs that is
include'd in each of my .cs files (index.cs, docs.cs, etc.). header.cs
can reference the data in foo.hdf, but it does not seem to be able to
see the data in common.hdf. I do not want to have to redefine the data
in common.hdf in every .hdf file I have for the site. Am I just going
about this the wrong way? Thanks.

Wes Morgan

#126 From: "kevinsl" <kevin@...>
Date: Mon Sep 15, 2003 6:47 pm
Subject: empty form fields disappear with CSPage.py
kevinsl
Send Email Send Email
 
I have a form with fields such as:

<input type="text" name="people.0.name">
<input type="text" name="people.1.name">

When I submit the form with empty values, the field names are not in the Query
HDF
(Query.people.0.name, Query.people.1.name). This happens when using CSPage.py,
but works fine without CSPage (plain CGI).

any ideas?

Kevin

#127 From: "basshombre80" <basshombre80@...>
Date: Mon Sep 15, 2003 7:00 pm
Subject: Multiline values?
basshombre80
Send Email Send Email
 
When setting certain vars in my HDF file to long values (lots of
text/html/etc.), it would be nice if I could use multiple lines to
make editing easier. Is this possible with CS? Everything I've tried
makes the parser freak out (i.e. just putting newlines in, using { }
instead of =, but now that I think about it, I never tried \ at the
end of the line, does that work?) Thanks.

Wes Morgan

#128 From: Brandon Long <blong@...>
Date: Mon Sep 15, 2003 7:25 pm
Subject: Re: empty form fields disappear with CSPage.py
blong42
Send Email Send Email
 
Dave really likes it when empty form values aren't in the HDF, so there
is a flag to ClearSilver to turn that on or off.

The default is off, but CSPage.py turns it on.  The call in
CSPage.__init__ is:
neo_cgi.IgnoreEmptyFormVars(1)

In C, you just set the global variable IgnoreEmptyFormVars to 1.

Brandon

On 09/15/03 kevinsl uttered the following other thing:
> I have a form with fields such as:
>
> <input type="text" name="people.0.name">
> <input type="text" name="people.1.name">
>
> When I submit the form with empty values, the field names are not in the Query
HDF
> (Query.people.0.name, Query.people.1.name). This happens when using CSPage.py,
> but works fine without CSPage (plain CGI).
>
> any ideas?

--
   "There are only 10 types of people in this world: those who
      understand binary and those who don't."
                                  http://www.fiction.net/blong/

#129 From: Brandon Long <blong@...>
Date: Mon Sep 15, 2003 7:22 pm
Subject: Re: common.hdf?
blong42
Send Email Send Email
 
The support for common.hdf was added to static.cgi in v0.8.1

So, it should work for any version after that.

You can try and see what's going on by running static.cgi from the
commandline.  You can either do:
export PATH_TRANSLATED /full/path/to/your/index.cs
./static.cgi

or, you can use the debug mode.  The debug mode works by having a file
full of k=v pairs which defines each of the CGI environment variables.
You can then run static.cgi with the argument being this file, ie:
./static.cgi test.in

Where test.in looks like:
PATH = /usr/local/bin:/usr/bin:/bin
DOCUMENT_ROOT = /b2/www
HTTP_ACCEPT = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,
*/*
HTTP_ACCEPT_CHARSET = iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING = gzip
HTTP_ACCEPT_LANGUAGE = en
HTTP_CONNECTION = Keep-Alive
HTTP_COOKIE = N=blong:ads132444l:asdf14442
HTTP_HOST = non.puppypaws.org
HTTP_PRAGMA = no-cache
HTTP_REFERER = http://non.puppypaws.org/~blong/test.html
HTTP_USER_AGENT = Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)
REMOTE_ADDR = 216.103.193.238
REMOTE_PORT = 44437
SCRIPT_FILENAME = /home/blong/public_html/static.cgi
SERVER_ADDR = 216.103.193.236
SERVER_ADMIN = root@localhost
SERVER_NAME = non.puppypaws.org
SERVER_PORT = 80
SERVER_SOFTWARE = Apache/1.3.9 (Unix) (Red Hat/Linux)
GATEWAY_INTERFACE = CGI/1.1
SERVER_PROTOCOL = HTTP/1.0
REQUEST_METHOD = GET
QUERY_STRING =
REQUEST_URI = /~blong/test.html
SCRIPT_NAME = /~blong/static.cgi
PATH_INFO = /~blong/test.html
PATH_TRANSLATED = /home/blong/public_html/test.html

From there, you can either use gdb or strace or whatever to debug the
CGI from the command line.  Remember that running the CGI as yourself is
not typically how the CGI is run from the web server, unless you are
using something like suexec.

Brandon

On 09/15/03 basshombre80 uttered the following other thing:
> I thought that static.cgi loaded common.hdf and foo.cs.hdf or foo.hdf.
> I have some Site.Sections.# data in common.hdf and a header.cs that is
> include'd in each of my .cs files (index.cs, docs.cs, etc.). header.cs
> can reference the data in foo.hdf, but it does not seem to be able to
> see the data in common.hdf. I do not want to have to redefine the data
> in common.hdf in every .hdf file I have for the site. Am I just going
> about this the wrong way? Thanks.
>
> Wes Morgan

--
   "Video games, not parents, are to blame for many of these teenage crimes.
    I'm certain it was Frogger that taught my son to jaywalk."
                    --  John Bumbry, Systems Analyst
                                            http://www.fiction.net/blong/

#130 From: Brandon Long <blong@...>
Date: Mon Sep 15, 2003 7:28 pm
Subject: Re: Multiline values?
blong42
Send Email Send Email
 
Multiline values in HDF files are supported using the shell like
multiline syntax:

Foo << EOM
This is my long,
multiline value.
EOM

Foo is the Key, and << indicates multiline where the ending marker is
EOM (on the line by itself with no whitespace).  You can use whatever
marker you'd like, it just can't be in the actual data on a line by
itself (or it'll cause a premature end of data).

Brandon

On 09/15/03 basshombre80 uttered the following other thing:
> When setting certain vars in my HDF file to long values (lots of
> text/html/etc.), it would be nice if I could use multiple lines to
> make editing easier. Is this possible with CS? Everything I've tried
> makes the parser freak out (i.e. just putting newlines in, using { }
> instead of =, but now that I think about it, I never tried \ at the
> end of the line, does that work?) Thanks.

--
   "A snooze button is a poor substitute for no alarm clock at all."
                                            http://www.fiction.net/blong/

#131 From: Martin Baker <martinb@...>
Date: Thu Sep 18, 2003 5:34 am
Subject: anyone running mod_python?
martinb@...
Send Email Send Email
 
I'm experimenting with ClearSilver and I have an Apache box running
mod_python, not PyApache. I notice that CSPage.py assumes things that
aren't true in my environment, which I'm guessing are due to the
differences between mod_python and PyApache.

I'm just curious if others out there are running mod_python, and if so, if
they encountered any quirks they'd like to tell me about.

FYI, a few issues I've encountered. Let me know if these are better
directed to blong, not the group.

mod_python/CSPage issues:
CSPage.Context looks for sys.argv. mod_python doesn't define sys.argv, so
this gave me an error. Easily faked.

mod_python ignores stdout - outgoing data must be sent via a special
"request object", again, easily solved by a wrapper for stdout, although
assigning sys.stdout to the req object would probably work, too.

It appears that you have to output "HTTP/1.1 200 OK" (or otherwise)
yourself. Successful runs of my script would lack this header and
"Connection: close" so I'd see "Content-type: text/html" displayed on the
page.

Relative includes don't appear to work in the cs file. I find this odd
because they worked fine with static.cgi.

A couple other small issues with the setup as-is (I know it's pre-1.0):

There are lots of hardcoded references to "/neo/..." etc., e.g. the
following in my error logs (I created the directory after this, but are
there others lurking?):

Unable to dump_bug
Traceback (most recent call last):
   File
"/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
line 49, in handleException
     if dump: dump_bug(lvl, "handleException", msg, string.join(tb_list,
""))
   File
"/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
line 89, in dump_bug
     hdf.writeFile(tpath)
Error: Traceback (innermost last):
   File "neo_hdf.c", line 1121, in hdf_write_file()
IOError: Unable to open /neo/data/bugs/tmp/1063857724.2286_1.atoz for
writing: [2] No such file or directory

---------

Also: "import odb" gives an error: unable to load tstart (I had seen no
reason to include examples/trans in my sys.path). Since all tstart does is
add dirs to sys.path for the translation stuff, it's weird that odb should
try to include it.

This stuff rocks. To paraphrase Douglas Adams, it is almost, but not
quite, entirely unlike PHP. Great job guys!

Martin

#132 From: Brandon Long <blong@...>
Date: Thu Sep 18, 2003 6:07 am
Subject: Re: anyone running mod_python?
blong42
Send Email Send Email
 
On 09/17/03 Martin Baker uttered the following other thing:
> I'm experimenting with ClearSilver and I have an Apache box running
> mod_python, not PyApache. I notice that CSPage.py assumes things that
> aren't true in my environment, which I'm guessing are due to the
> differences between mod_python and PyApache.
>
> I'm just curious if others out there are running mod_python, and if so, if
> they encountered any quirks they'd like to tell me about.

Scott's image server works under mod_python, and although I've installed
it, I haven't looked that closely at it to see the difference.

http://www.dotfunk.com/projects/image_server

> FYI, a few issues I've encountered. Let me know if these are better
> directed to blong, not the group.
>
> mod_python/CSPage issues:
> CSPage.Context looks for sys.argv. mod_python doesn't define sys.argv, so
> this gave me an error. Easily faked.
>
> mod_python ignores stdout - outgoing data must be sent via a special
> "request object", again, easily solved by a wrapper for stdout, although
> assigning sys.stdout to the req object would probably work, too.
>
> It appears that you have to output "HTTP/1.1 200 OK" (or otherwise)
> yourself. Successful runs of my script would lack this header and
> "Connection: close" so I'd see "Content-type: text/html" displayed on the
> page.

Hmm, the image_server has a cspage.py which is similar to CSPage.py, but
it seems to have some added smarts for mod_python, including hooking
into the right parts of the mod_python apache module.

> Relative includes don't appear to work in the cs file. I find this odd
> because they worked fine with static.cgi.

There's nothing in the underlying HDF code that should care, at a guess
the difference is cgi code does a chdir to the directory before exec'ing
the cgi, and mod_python probably isn't.  os.getcwd() will tell you.

> A couple other small issues with the setup as-is (I know it's pre-1.0):
>
> There are lots of hardcoded references to "/neo/..." etc., e.g. the
> following in my error logs (I created the directory after this, but are
> there others lurking?):
>
> Unable to dump_bug
> Traceback (most recent call last):
>   File
> "/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
> line 49, in handleException
>     if dump: dump_bug(lvl, "handleException", msg, string.join(tb_list,
> ""))
>   File
> "/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
> line 89, in dump_bug
>     hdf.writeFile(tpath)
> Error: Traceback (innermost last):
>   File "neo_hdf.c", line 1121, in hdf_write_file()
> IOError: Unable to open /neo/data/bugs/tmp/1063857724.2286_1.atoz for
> writing: [2] No such file or directory

Yeah, that's a known one.  The configure script also looks for /neo/opt
for python and other things, but if it doesn't exist it should be fine.
I don't know of any other hard coded things...

Not sure what to do with the above one, I can just have a module variable
for it.

> Also: "import odb" gives an error: unable to load tstart (I had seen no
> reason to include examples/trans in my sys.path). Since all tstart does is
> add dirs to sys.path for the translation stuff, it's weird that odb should
> try to include it.

hmm, I thought we'd removed all of the tstart's... its how we set up the
sys.path for all of our code.  The theory is there is a tstart in every
directory which sets up the paths for something to run in that
directory.  Its not specific to trans... (t actually stands for Trakken)

Actually, looking in tstart, I guess Dave added one specific to trans.
Though, it looks like I've already removed the import from odb, it'll be
gone in the next release.

Brandon
--
  "We don't understand the software, and sometimes we don't understand
   the hardware, but we can *see* the blinking lights!" -- Unknown
                                            http://www.fiction.net/blong/

#133 From: "Chris Trimble" <trimble@...>
Date: Thu Sep 18, 2003 5:33 pm
Subject: RE: anyone running mod_python?
ctrimble
Send Email Send Email
 
I've been using mod_python on Apache on W2K for an internal website for about,
oh, 4-6 months now.  It's being served off of my machine, queries SQL_server and
such.  Very solid, just keeps on running (thankfully -- because now I don't have
time to maintain it).  The structure of the script was based on Hassan's code. 
I don't have anything in my code that outputs "HTTP/1.1 200 OK", but maybe
that's because I'm using Scott's "ModPythonContext" object.

  - Chris



-----Original Message-----
From: Martin Baker [mailto:martinb@...]
Sent: Wednesday, September 17, 2003 10:34 PM
To: clearsilver@yahoogroups.com
Subject: anyone running mod_python?


I'm experimenting with ClearSilver and I have an Apache box running
mod_python, not PyApache. I notice that CSPage.py assumes things that
aren't true in my environment, which I'm guessing are due to the
differences between mod_python and PyApache.

I'm just curious if others out there are running mod_python, and if so, if
they encountered any quirks they'd like to tell me about.

FYI, a few issues I've encountered. Let me know if these are better
directed to blong, not the group.

mod_python/CSPage issues:
CSPage.Context looks for sys.argv. mod_python doesn't define sys.argv, so
this gave me an error. Easily faked.

mod_python ignores stdout - outgoing data must be sent via a special
"request object", again, easily solved by a wrapper for stdout, although
assigning sys.stdout to the req object would probably work, too.

It appears that you have to output "HTTP/1.1 200 OK" (or otherwise)
yourself. Successful runs of my script would lack this header and
"Connection: close" so I'd see "Content-type: text/html" displayed on the
page.

Relative includes don't appear to work in the cs file. I find this odd
because they worked fine with static.cgi.

A couple other small issues with the setup as-is (I know it's pre-1.0):

There are lots of hardcoded references to "/neo/..." etc., e.g. the
following in my error logs (I created the directory after this, but are
there others lurking?):

Unable to dump_bug
Traceback (most recent call last):
   File
"/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
line 49, in handleException
     if dump: dump_bug(lvl, "handleException", msg, string.join(tb_list,
""))
   File
"/home/martinb/src/clearsilver-0.9.3/python/examples/base/handle_error.py",
line 89, in dump_bug
     hdf.writeFile(tpath)
Error: Traceback (innermost last):
   File "neo_hdf.c", line 1121, in hdf_write_file()
IOError: Unable to open /neo/data/bugs/tmp/1063857724.2286_1.atoz for
writing: [2] No such file or directory

---------

Also: "import odb" gives an error: unable to load tstart (I had seen no
reason to include examples/trans in my sys.path). Since all tstart does is
add dirs to sys.path for the translation stuff, it's weird that odb should
try to include it.

This stuff rocks. To paraphrase Douglas Adams, it is almost, but not
quite, entirely unlike PHP. Great job guys!

Martin


Yahoo! Groups Sponsor
ADVERTISEMENT




To unsubscribe from this group, send an email to:
ClearSilver-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

Messages 104 - 133 of 1451   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help