Adrian Perez | 1 Sep 11:21 2006
Picon

Re: [Release] Bic A1A1

On 8/27/06, Alessandro <aleuser <at> inwind.it> wrote:
> Pages can't see /style/default/main.css , so they are very poor
> Did I make installation error?

I found the problem, it was my fault: the resource which is
under /style/default is determined by the contents of the
"bic_style_name" cookie or, if not defined, by the contents of the
"style" variable in the configuration file. The problem was that I
thought IRequest(ctx).getCookie() would raise KeyError instead of
returning None when the cookie is not set.

It was a small fix, thanks a lot for your report. I attached the
patch, but I hope to upload a new tarball soon, along with some
more improvements I¡m working on.Feel free to track the
code with Bzr, http://code.connectical.net/bic is the URL where I
publish the main development branch.

BTW, support for setting the cookie which controls the style is on the
code, but nowhere in the web interface yet. Just access any page adding
"?style=3Dfoo" as query string at the end of the URL.

--
Adrian Perez
"Experience is what you get when you don't get what you want"
                                           -- (Dan Stanford)
_______________________________________________
Twisted-web mailing list
(Continue reading)

Phil Mayers | 5 Sep 00:59 2006
Picon

Athena DOM manipulation

Is it possible for an athena LivePage to add new LiveElements? To remove 
them?

The application is a web-based database editor which due to operational 
requirements has suddenly had a ballooning in the number of fields per 
HTML page, and the round-tripping of the form submits plus rendering of 
the extremely large HTML in one large block is actually now causing 
operational difficulties.

Something like:

+-(main)-------------------+
| field1: ______           |
| field2: ______           |
| checkbox: [__]           |
|                          |
+-(subitems)---------------+
| key | name | dom |       |
+-----+------+-----+-------+
|     |      |     | [del] | << this is a 3-textbox row for each subitem
+-----+------+-----+-------+
| [Add new subitem?]       | << this is a
+--------------------------+

...with maybe ~60 and climbing rows of subitems. I can handle the 
initial loading of the page taking a bit of time, but a user might want 
to add, change or delete ~10-25 rows of subitems each time they visit 
the page, and the round-tripping is genuinely detrimental.

Can you do something like returning a LiveElement from a callRemote? Or 
(Continue reading)

Jean-Paul Calderone | 5 Sep 01:35 2006

Re: Athena DOM manipulation

On Mon, 04 Sep 2006 23:59:22 +0100, Phil Mayers <p.mayers <at> imperial.ac.uk> wrote:
>Is it possible for an athena LivePage to add new LiveElements? To remove 
>them?
>
>The application is a web-based database editor which due to operational 
>requirements has suddenly had a ballooning in the number of fields per HTML 
>page, and the round-tripping of the form submits plus rendering of the 
>extremely large HTML in one large block is actually now causing operational 
>difficulties.
>
>Something like:
>
>+-(main)-------------------+
>| field1: ______           |
>| field2: ______           |
>| checkbox: [__]           |
>|                          |
>+-(subitems)---------------+
>| key | name | dom |       |
>+-----+------+-----+-------+
>|     |      |     | [del] | << this is a 3-textbox row for each subitem
>+-----+------+-----+-------+
>| [Add new subitem?]       | << this is a
>+--------------------------+
>
>
>...with maybe ~60 and climbing rows of subitems. I can handle the initial 
>loading of the page taking a bit of time, but a user might want to add, 
>change or delete ~10-25 rows of subitems each time they visit the page, and 
>the round-tripping is genuinely detrimental.
(Continue reading)

aleuser@inwind.it | 5 Sep 17:14 2006
Picon

athena under a vhost: strange issue

Hi,
I think I have found a strange issue in athena under a virtual host.

The problem is the 'self.callRemote' server side functions; they will work only the first time, after that
(I mean: after one only 'self.callRemote' is executed) the athena page seems to be disconnected and no
other dinamic athena function seems to be working!

If I use the same page without the virtual host (browsing directly to the athena web server ) it works ok.

The problem seem to be the deferred returned by the server side 'self.callRemote'. If I don't return it, it
will not be executed under a virtual host. 

No errors are reported in the debug athena window and in the firefox javascript console.

In the following examples, the 'msgbox' is an 'alert' client-side in the "liveform.js" file.
...
  function msgbox(self, msg){
    alert(msg);
    return false;
  },
..

Here the code:

class LiveFormExampleFragment(athena.LiveFragment):
    jsClass = u"LiveForm.Checkin"
    docFactory = loaders.stan(T.span(render=T.directive('liveFragment'))[
        'TestInput= ',
        T.input(type="text",
             onchange="Nevow.Athena.Widget.get(this).callRemote('testing', this.value);"),
(Continue reading)

Nuutti Kotivuori | 5 Sep 17:13 2006
Picon
Picon

Nevow and template like files

Hi,

I'm considering the best ways to write a Nevow site that would meet my
needs. I know I can come up with several solutions to my problems
myself, but I am pondering on the best way to achieve them. I will
first describe my needs and then give an idea how I was thinking of
achieving it.

I will have three classes of xhtml files, or templates, that are used
in different parts of the code.

First are layout pages. These will provide the general
layout and functionality for a set of pages that will make up a
section of the site. These pages will contain the actual
html/head/body tags and such.

Second are the content pages. These pages will fit in a certain layout
and provide the actual page content to it. There will be static pages,
dynamic status pages and pages with web forms. The layout pages need
to be able to dig sections out of the content pages to fill in to the
layout; for example additional css/javascript to go into head, sidebar
items, actual content.

Third are so called snippet pages. These will contain a large number
of text snippets (with markup) that are re-used on many content
pages. These snippets need to be easily includable from the content
pages. Some of the snippets are used as is, where as some of the
snippets need to be parameterised - the calling code needs to be able
to fill in some things easily.

(Continue reading)

Wendell Turner | 5 Sep 18:40 2006

Re: simple proxy example?

On Mon, Aug 28, 2006 at 02:33:02PM -0700, David Reid wrote:
> On Mon, Aug 28, 2006 at 04:29:31PM -0400, Wendell Turner wrote:
> > 
> > The webdownload.py script in Abe Fettig's book works fine for
> > directly connected machines.  I would like to modify it to use a
> > proxy.  Most of the examples in the twisted docs seem to show
> > how to write a proxy, not how to use one.
> 
> So that everyone is on the same page, are you attempting to download pages via an http proxy?

Yes, just using an http proxy.  Current solution is:

    def gotProtocol(p):
        p.sendMessage("GET " + webpageurl + "\n\r")

    c.connectTCP(proxyhost, proxyport).addCallback(gotProtocol)

But there should be a better way.

> If yes:
>   There is currently a ticket in the tracker about client support for
> proxies http://twistedmatrix.com/trac/ticket/1774

Thanks, I'll take a look at the patch.  Although, according to
the notes, it may take some effort to do it 'properly'.

Wendell
Mike Pelletier | 5 Sep 19:26 2006
X-Face
Picon

Re: Athena DOM manipulation

On Monday 04 September 2006 19:35, Jean-Paul Calderone wrote:
> One can indeed add new LiveElements to an already-rendered Athena page.

This is great!  I recently had a similar requirement, but I ended up just 
writing a single really complex LiveElement that could handle all 
possibilities instead of composing a bunch of simple LiveElements on an 
as-needed basis.  I knew I was missing something important, because I ended 
up having to pre-render all possible fragments in an invisible container and 
clone them whenever I wanted to add a new sub-Widget, etc.  I couldn't figure 
out how I was supposed to take advantage of Nevow's templating system for new 
Widgets once the page had finished rendering.  This clears up a lot.

Thanks!

Mike.

Re: Nevow and template like files

On Tue, 05 Sep 2006 18:13:37 +0300, Nuutti Kotivuori <naked <at> iki.fi> wrote:
>First are layout pages. These will provide the general
>layout and functionality for a set of pages that will make up a
>section of the site. These pages will contain the actual
>html/head/body tags and such.
>
>Second are the content pages. These pages will fit in a certain layout
>and provide the actual page content to it. There will be static pages,
>dynamic status pages and pages with web forms. The layout pages need
>to be able to dig sections out of the content pages to fill in to the
>layout; for example additional css/javascript to go into head, sidebar
>items, actual content.

I think what you said sounds reasonable. Maybe have a look here:
http://trac.stiq.it/main/browser/stiq/ui/base.py

Specifically base.Base class which defines 2 class attributes: template and sidebar that are used to fill
a sidebar pane and the content pane of the macro.html template.
Basically you just use macro.html as the basis for all the pages and fill the 2 macro slots with a different
couple of templates each time.

>Third are so called snippet pages. These will contain a large number
>of text snippets (with markup) that are re-used on many content
>pages. These snippets need to be easily includable from the content
>pages. Some of the snippets are used as is, where as some of the
>snippets need to be parameterised - the calling code needs to be able
>to fill in some things easily.

>Snippet pages are a bit troublesome. I was thinking of making a
>Fragment that would have the docFactory for such a page. Then that
(Continue reading)

Nuutti Kotivuori | 5 Sep 20:42 2006
Picon
Picon

Formal and tabbed pane

Another thing I'd like to get working is combining formal with tabbed
pane.

What I'd like to get is a formal form shown as a tabbed pane, with
either each group represented as page in the tabbed pane, or some
other grouping method used to determine which fields belong to which
pane. But I'd still like it to have just one submit button that would
submit all the fields in all the panes.

And, somehow, I'd like it gracefully to degrade to a normal formal
grouped form if Javascript isn't available :-)

But, I'll take what I can get and hack the rest somehow.

-- Naked
Nuutti Kotivuori | 5 Sep 21:48 2006
Picon
Picon

Re: Nevow and template like files

Valentino Volonghi aka Dialtone wrote:
> On Tue, 05 Sep 2006 18:13:37 +0300, Nuutti Kotivuori <naked <at> iki.fi> wrote:
>> First are layout pages. These will provide the general
>> layout and functionality for a set of pages that will make up a
>> section of the site. These pages will contain the actual
>> html/head/body tags and such.
>>
>> Second are the content pages. These pages will fit in a certain layout
>> and provide the actual page content to it. There will be static pages,
>> dynamic status pages and pages with web forms. The layout pages need
>> to be able to dig sections out of the content pages to fill in to the
>> layout; for example additional css/javascript to go into head, sidebar
>> items, actual content.
>
> I think what you said sounds reasonable. Maybe have a look here:
> http://trac.stiq.it/main/browser/stiq/ui/base.py
>
> Specifically base.Base class which defines 2 class attributes:
> template and sidebar that are used to fill a sidebar pane and the
> content pane of the macro.html template.  Basically you just use
> macro.html as the basis for all the pages and fill the 2 macro slots
> with a different couple of templates each time.

Thanks! I've looked already at that and it seems nice... except for
two points.

First of all, the content is looked up like this:

,----
| def macro_content(self, ctx):
(Continue reading)


Gmane