Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Trying to automate HTML ---> pdf
Date: Sun, 27 Jan 2008 17:44:43
Message-Id: 200801271856.59730.shrdlu@unlimitedmail.org
In Reply to: [gentoo-user] Trying to automate HTML ---> pdf by felix@crowfix.com
1 On Sunday 27 January 2008, felix@×××××××.com wrote:
2
3 > dcop konqueror-6352 'konqueror-mainwindow#1' openURL
4 > 'http://slashdot.org'
5 > dcop konqueror-6352 html-widget2 print true
6 >
7 > There's a bit more than that, since widget names change, but a simple
8 > perl program handles it easily (so far!).
9 >
10 > However, there's a problem. The "openURL" command returns without
11 > waiting for the web page to finish loading, and the "print" command
12 > does not wait for it to finish loading. The "print" command does wait
13 > for printing to finish before returning, which is nice.
14 >[cut]
15 > 1. Is there either a DCOP command to wait for a URL to be loaded or a
16 > DCOP command like openURL which waits?
17
18 I know of no direct method, and I can't answer your other questions
19 either.
20 However, the following (admittedly *really* kludgy and quick-and-dirty)
21 method *seems* to work:
22
23 dcop konqueror-6352 'konqueror-mainwindow#1' openURL 'http://my.url'
24
25 while true; do
26
27 # check if the "stop" button is clickable
28 stat=`dcop konqueror-6352 konqueror-mainwindow#1 actionIsEnabled stop`
29
30 if [ "$stat" == "true" ]; then
31 # "stop" button is active, so page is still loading
32 sleep 5
33 else
34 # "stop" button is not active, page has loaded
35 break
36 fi
37 done
38
39 # do what you want here
40
41 As I said above, I did some tests and this seems to work. However, I'm
42 not claiming that it's the solution to your problem, nor that it will
43 always work as expected. Therefore, I strongly suggest you test it
44 thoroughly before using it.
45
46 Hope that helped.
47 --
48 gentoo-user@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Trying to automate HTML ---> pdf felix@×××××××.com