You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Ulrich Schöbel <tc...@outvert.com> on 2006/02/19 19:33:07 UTC

websh-3.6.0b3

Hi Ronnie, hi all,

first of all, sorry for using the wrong sender address. You're
right, Ronnie, I subscribed as tcl@outvert.com to this list.
I'll try to remember that in the future.

Now for the new websh. I installed it during the weekend
and tried it out. My first impression was absolutely negative,
until I realized, that it stumbled over my workarounds for
the previous versions bugs. After making these workarounds
inactive everything worked fine. Seems to be a really nice
version.

There are only a few things to criticise:

As I already mentioned, I'd like to have an improved
configurability. Having websh, apache, tcl and mysql
installed in nonstandard locations, I hate to have to do
some 'postprocessing' to move a couple of files to the
'right' location. An additional option to configure, although
definitely 'unGNUish', would be really comfortable.

Secondly, I'd like to have yet another subcommand to
filecounters, 'filecountername actval', which gives me the
actual value (content of the counter file). It's absolutely
no problem to get this value by reading the file, but the
filecounter semantics would be more complete. I need
this in a situation, where I misuse a filecounter for a
counting purpose apart from a context context.

Thirdly, a web::headerdate (see below), which returns a
date string in RFC 1123 format, which is used in http and
mail headers. Tcls clock format does not do it, if you
are not in a 'C' language environment. This string has to
be independent of localizations. It looks something
like this:

proc headerdate {sec} {
  if {[info exists ::env(LANG)]} {
    set elang $::env(LANG)
  }
  set ::env(LANG) C
  set date [clock format $sec -format "%a, %d %b %Y %T %Z" -gmt 1]
  if {[info exists elang]} {
    set ::env(LANG) $elang
  } else {
    unset ::env(LANG)
  }
  return $date
}

All in all, good work! I'll complete my upgrade to this version.

Thanks and best regards

Ulrich

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org


Re: websh-3.6.0b3

Posted by Ulrich Schöbel <tc...@outvert.com>.
Hi Ronnie,

On Sunday 19 February 2006 23:41, Ronnie Brunner wrote:
> Hi Ulrich
>
> > As I already mentioned, I'd like to have an improved
> > configurability. Having websh, apache, tcl and mysql
> > installed in nonstandard locations, I hate to have to do
> > some 'postprocessing' to move a couple of files to the
> > 'right' location. An additional option to configure, although
> > definitely 'unGNUish', would be really comfortable.
>
> We'll think about it...
Pleeeeease.

> > Secondly, I'd like to have yet another subcommand to
> > filecounters, 'filecountername actval', which gives me the
> > actual value (content of the counter file). It's absolutely
> > no problem to get this value by reading the file, but the
> > filecounter semantics would be more complete. I need
> > this in a situation, where I misuse a filecounter for a
> > counting purpose apart from a context context.
>
> There already is a "curval" subcommand. Doesn't that do what you
> expect?
I know of curval, but that's not what I mean. curval returns
the current filecounter value from a sessions viewpoint.  It
only returns a value after a previous nextval and sticks to
that value independent of other processes incrementing
the filecounter in the meantime. This is perfectly ok in
normal session context processing.

I need the value without(!) incrementing it. As I said, I misuse
the filecounter for something else (visit counter), not for
session contexts. curval doesn't help here, thus my actval
proposal. This is not an urgent request, as I can simply read
the counter file, but it makes the filecounter complete, at least
in my eyes.

>
> > Thirdly, a web::headerdate (see below), which returns a
> > date string in RFC 1123 format, which is used in http and
> > mail headers. Tcls clock format does not do it, if you
> > are not in a 'C' language environment. This string has to
> > be independent of localizations. It looks something
> > like this:
> >
> > proc headerdate {sec} {
> >   if {[info exists ::env(LANG)]} {
> >     set elang $::env(LANG)
> >   }
> >   set ::env(LANG) C
> >   set date [clock format $sec -format "%a, %d %b %Y %T %Z" -gmt 1]
> >   if {[info exists elang]} {
> >     set ::env(LANG) $elang
> >   } else {
> >     unset ::env(LANG)
> >   }
> >   return $date
> > }
>
> Well, the clock command in Tcl is definitly something that has its
> problems, at least upto version 8.4.X. In Tcl 8.5 the clock command
> has been reimplemented (basically from scratch) and I think it's worth
> just waiting for that. There is a new -locale switch to clock format
> that takes care of your problem.
>
> Regarding your example: I tried to get the cookie time format for
> Websh right for quite some time. My solution doesn't play with the
> environment, as I've seen strange side effects (you actually pointed
> some of them out to me ;-) . Fact is: your code wouldn't work on OSX,
> as the timezone string will not be "GMT", but "UTC", so if you want to
> use it until Tcl 8.5 is out, look at Websh's fiddling with the locale
> independent time format in cookie.ws3 lines 160ff.
Yes, I remember that. I'll take a look into cookie.ws3 again.
Nevertheless, I like the idea of having a command that delivers
a date string conformant to RFC 1123, independent of platforms
or timezones. After all, websh has to deal with web stuff (think
of the 'Last-Modified' header or expiry dates).
>
> > All in all, good work! I'll complete my upgrade to this version.
>
> Thanks :-)
Pleasure.

Cheers

Ulrich


---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org


Re: websh-3.6.0b3

Posted by Ronnie Brunner <ro...@netcetera.ch>.
Hi Ulrich

> As I already mentioned, I'd like to have an improved
> configurability. Having websh, apache, tcl and mysql
> installed in nonstandard locations, I hate to have to do
> some 'postprocessing' to move a couple of files to the
> 'right' location. An additional option to configure, although
> definitely 'unGNUish', would be really comfortable.

We'll think about it...

> Secondly, I'd like to have yet another subcommand to
> filecounters, 'filecountername actval', which gives me the
> actual value (content of the counter file). It's absolutely
> no problem to get this value by reading the file, but the
> filecounter semantics would be more complete. I need
> this in a situation, where I misuse a filecounter for a
> counting purpose apart from a context context.

There already is a "curval" subcommand. Doesn't that do what you
expect? 

> Thirdly, a web::headerdate (see below), which returns a
> date string in RFC 1123 format, which is used in http and
> mail headers. Tcls clock format does not do it, if you
> are not in a 'C' language environment. This string has to
> be independent of localizations. It looks something
> like this:
> 
> proc headerdate {sec} {
>   if {[info exists ::env(LANG)]} {
>     set elang $::env(LANG)
>   }
>   set ::env(LANG) C
>   set date [clock format $sec -format "%a, %d %b %Y %T %Z" -gmt 1]
>   if {[info exists elang]} {
>     set ::env(LANG) $elang
>   } else {
>     unset ::env(LANG)
>   }
>   return $date
> }

Well, the clock command in Tcl is definitly something that has its
problems, at least upto version 8.4.X. In Tcl 8.5 the clock command
has been reimplemented (basically from scratch) and I think it's worth
just waiting for that. There is a new -locale switch to clock format
that takes care of your problem.

Regarding your example: I tried to get the cookie time format for
Websh right for quite some time. My solution doesn't play with the
environment, as I've seen strange side effects (you actually pointed
some of them out to me ;-) . Fact is: your code wouldn't work on OSX,
as the timezone string will not be "GMT", but "UTC", so if you want to
use it until Tcl 8.5 is out, look at Websh's fiddling with the locale
independent time format in cookie.ws3 lines 160ff.

> All in all, good work! I'll complete my upgrade to this version.

Thanks :-)

Regards
Ronnie
--
Ronnie Brunner | ronnie.brunner@netcetera.ch
phone +41 (0)44 247 79 79 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org