From dncarreira at gmail.com Fri Nov 6 06:18:50 2009 From: dncarreira at gmail.com (Duarte Carreira) Date: Thu, 5 Nov 2009 19:18:50 +0000 Subject: trying to run planet.py via mod_python Message-ID: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> Hi. I am desperate by now trying to update my planet by running planet.py through the browser... my provider configured mod_python and I already tested a simple python script that outputs system variables. But I cannot run planet.py no matter what I do... no errors appear in the logs and no output is shown on the browser. I don't have access to shell so am pretty limited in what I can do... Can anyone lend a helping hand?? Thanks, Duarte -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091105/7bb86d14/attachment.htm From kensanata at gmail.com Fri Nov 6 11:02:47 2009 From: kensanata at gmail.com (=?ISO-8859-1?Q?Alex_Schr=F6der?=) Date: Fri, 6 Nov 2009 01:02:47 +0100 Subject: trying to run planet.py via mod_python In-Reply-To: <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> Message-ID: <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> On Fri, Nov 6, 2009 at 00:45, Duarte Carreira wrote: > well i don't have access to cron in this server, just to cpanel... yes i'm > trying to run planet.py through some web page. It may be a cgi script, php, > python. No idea what cpanel is, but I guess you want to run the planet every now and then by calling a CGI script on a regular basis, and then you'll publish the URL to the resulting HTML file. My setup? test.ini: [Planet] name = Test cache_directory = /home/alex/planet/test log_level = INFO output_theme = musings output_dir = /var/www/alex/campaignwiki.org/test items_per_page = 5 activity_threshold = 90 [http://www.emacswiki.org/alex/?action=rss] name = Alex Schroeder test.pl CGI script: #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp 'fatalsToBrowser'; print header; print start_html('Run Planet'); print pre(`/home/alex/venus/planet.py /home/alex/planet/test.ini 2>&1`); print end_html; Output in the web page after making the script executable: INFO:planet.runner:Socket timeout set to 20 seconds INFO:planet.runner:Building work queue INFO:planet.runner:Feed http://www.emacswiki.org/alex/?action=rss unchanged INFO:planet.runner:Loading cached data ~/campaignwiki.org $ ls test atom.xml default.css foafroll.xml images index.html mutants.html mutants.xml opml.xml personalize.js Works for me? Perhaps the code examples will help you get started? Regards Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091106/ee1574f6/attachment.htm From dncarreira at gmail.com Fri Nov 6 21:54:18 2009 From: dncarreira at gmail.com (Duarte Carreira) Date: Fri, 6 Nov 2009 10:54:18 +0000 Subject: trying to run planet.py via mod_python In-Reply-To: <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> Message-ID: <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> I have mod_python working but cannot find a way to run planet.py... no output or error is shown on the webpage... If someone can send me an example script I'd appreciate it. Duarte On Fri, Nov 6, 2009 at 12:02 AM, Alex Schr?der wrote: > On Fri, Nov 6, 2009 at 00:45, Duarte Carreira wrote: > >> well i don't have access to cron in this server, just to cpanel... yes i'm >> trying to run planet.py through some web page. It may be a cgi script, php, >> python. > > > No idea what cpanel is, but I guess you want to run the planet every now > and then by calling a CGI script on a regular basis, and then you'll publish > the URL to the resulting HTML file. > > My setup? > > test.ini: > > [Planet] > name = Test > cache_directory = /home/alex/planet/test > log_level = INFO > output_theme = musings > output_dir = /var/www/alex/campaignwiki.org/test > items_per_page = 5 > activity_threshold = 90 > [http://www.emacswiki.org/alex/?action=rss] > name = Alex Schroeder > > test.pl CGI script: > > #!/usr/bin/perl > > use CGI qw/:standard/; > use CGI::Carp 'fatalsToBrowser'; > print header; > print start_html('Run Planet'); > print pre(`/home/alex/venus/planet.py /home/alex/planet/test.ini 2>&1`); > print end_html; > > Output in the web page after making the script executable: > > INFO:planet.runner:Socket timeout set to 20 seconds > INFO:planet.runner:Building work queue > INFO:planet.runner:Feed http://www.emacswiki.org/alex/?action=rss unchanged > > > INFO:planet.runner:Loading cached data > > ~/campaignwiki.org $ ls test > atom.xml default.css foafroll.xml images index.html mutants.html > mutants.xml opml.xml personalize.js > > Works for me? Perhaps the code examples will help you get started? > > Regards > Alex > > -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091106/93acab60/attachment.htm From kensanata at gmail.com Fri Nov 6 22:04:43 2009 From: kensanata at gmail.com (=?ISO-8859-1?Q?Alex_Schr=F6der?=) Date: Fri, 6 Nov 2009 12:04:43 +0100 Subject: trying to run planet.py via mod_python In-Reply-To: <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> Message-ID: <9abbd5730911060304k581bd79cj4bc53df004797a54@mail.gmail.com> On Fri, Nov 6, 2009 at 11:54, Duarte Carreira wrote: > I have mod_python working but cannot find a way to run planet.py... no > output or error is shown on the webpage... > If someone can send me an example script I'd appreciate it. > Hm, didn't I just send you an example script that worked for me? Note how my test.pl Perl script calls python.py. I don't think you need mod_python for this. I just use the Perl script to handle the CGI parts because it's what I'm most familiar with. Anyway, I actually installed and tested the setup I sent you, so I know it works. If it still fails, you need to start looking for error logs and the like. -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091106/90d38ce8/attachment.htm From fred at cm17.com Fri Nov 6 22:04:07 2009 From: fred at cm17.com (Frederic Muller) Date: Fri, 06 Nov 2009 19:04:07 +0800 Subject: trying to run planet.py via mod_python In-Reply-To: <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> Message-ID: <4AF402A7.5040103@cm17.com> What I would do is to replicate all your planet install on a virtual machine locally and see if it works. Then it might help you to identify where the problem is coming from. Fred Duarte Carreira wrote: > I have mod_python working but cannot find a way to run planet.py... no > output or error is shown on the webpage... > > If someone can send me an example script I'd appreciate it. > > Duarte > > On Fri, Nov 6, 2009 at 12:02 AM, Alex Schr?der > wrote: > > On Fri, Nov 6, 2009 at 00:45, Duarte Carreira > > wrote: > > well i don't have access to cron in this server, just to > cpanel... yes i'm trying to run planet.py through some web > page. It may be a cgi script, php, python. > > > No idea what cpanel is, but I guess you want to run the planet > every now and then by calling a CGI script on a regular basis, and > then you'll publish the URL to the resulting HTML file. > > My setup? > > test.ini: > > [Planet] > name = Test > cache_directory = /home/alex/planet/test > log_level = INFO > output_theme = musings > output_dir = /var/www/alex/campaignwiki.org/test > > items_per_page = 5 > activity_threshold = 90 > [http://www.emacswiki.org/alex/?action=rss] > name = Alex Schroeder > > test.pl CGI script: > > #!/usr/bin/perl > > use CGI qw/:standard/; > use CGI::Carp 'fatalsToBrowser'; > print header; > print start_html('Run Planet'); > print pre(`/home/alex/venus/planet.py /home/alex/planet/test.ini > 2>&1`); > print end_html; > > Output in the web page after making the script executable: > > INFO:planet.runner:Socket timeout set to 20 seconds > INFO:planet.runner:Building work queue > INFO:planet.runner:Feed http://www.emacswiki.org/alex/?action=rss unchanged > > > > INFO:planet.runner:Loading cached data > > > ~/campaignwiki.org $ ls test > atom.xml default.css foafroll.xml images index.html > mutants.html mutants.xml opml.xml personalize.js > > Works for me? Perhaps the code examples will help you get started? > > Regards > Alex > > From stuart.freeman at et.gatech.edu Sat Nov 7 09:19:02 2009 From: stuart.freeman at et.gatech.edu (D. Stuart Freeman) Date: Fri, 6 Nov 2009 17:19:02 -0500 Subject: Template filter config syntax Message-ID: <20091106221902.GI17829@cetel-004-xx6.admin.gatech.edu> I'm trying to get a template filter to work, but I can't seem to figure out where to specify it. I've got the filter in: /var/www/planet/filter/myfilter.py then in planet.ini there's a [Planet] section that contains: filter_directories = /usr/share/planet-venus/filter /var/www/planet/filter and in /var/www/planet/theme/config.ini I have a [Planet] section that has: filters = myfilter.py I've verified that running 'python myfilter.py < output/index.html' completes and outputs what I want, but when I run 'planet -v -d planet.ini' the output doesn't get filtered. -- D. Stuart Freeman Georgia Institute of Technology -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : /archives/devel/attachments/20091106/ba25cb8f/attachment.pgp From dncarreira at gmail.com Mon Nov 9 09:24:44 2009 From: dncarreira at gmail.com (Duarte Carreira) Date: Sun, 8 Nov 2009 22:24:44 +0000 Subject: Fwd: trying to run planet.py via mod_python In-Reply-To: <6717b0ac0911060502q1ff6d3ddg6bc3d379491f0766@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> <9abbd5730911060304k581bd79cj4bc53df004797a54@mail.gmail.com> <6717b0ac0911060502q1ff6d3ddg6bc3d379491f0766@mail.gmail.com> Message-ID: <6717b0ac0911081424v4cc7bf87t89f928ab2275950f@mail.gmail.com> ---------- Forwarded message ---------- From: Duarte Carreira Date: Fri, Nov 6, 2009 at 1:02 PM Subject: Re: trying to run planet.py via mod_python To: Alex Schr?der Alex, sorry about that. Don't know how but I managed to send my previous email before I got to see your reply... gmail must have fooled me ;) I'm definitely going to try your script and post here the results But I'm very optimistic! Thanks, Duarte On Fri, Nov 6, 2009 at 11:04 AM, Alex Schr?der wrote: > On Fri, Nov 6, 2009 at 11:54, Duarte Carreira wrote: > >> I have mod_python working but cannot find a way to run planet.py... no >> output or error is shown on the webpage... >> If someone can send me an example script I'd appreciate it. >> > > Hm, didn't I just send you an example script that worked for me? Note how > my test.pl Perl script calls python.py. I don't think you need mod_python > for this. I just use the Perl script to handle the CGI parts because it's > what I'm most familiar with. > > Anyway, I actually installed and tested the setup I sent you, so I know it > works. If it still fails, you need to start looking for error logs and the > like. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091108/202705f9/attachment.htm From dncarreira at gmail.com Mon Nov 9 09:30:27 2009 From: dncarreira at gmail.com (Duarte Carreira) Date: Sun, 8 Nov 2009 22:30:27 +0000 Subject: trying to run planet.py via mod_python In-Reply-To: <6717b0ac0911081424v4cc7bf87t89f928ab2275950f@mail.gmail.com> References: <6717b0ac0911051118s6fbfd52co64f7cf518236d509@mail.gmail.com> <6717b0ac0911051545ua937ed2tf8dd928c944b9ab@mail.gmail.com> <9abbd5730911051602y69e33a32m6534ebb76e12e5ab@mail.gmail.com> <6717b0ac0911060254x41577c8eo2561efd7a04edfc1@mail.gmail.com> <9abbd5730911060304k581bd79cj4bc53df004797a54@mail.gmail.com> <6717b0ac0911060502q1ff6d3ddg6bc3d379491f0766@mail.gmail.com> <6717b0ac0911081424v4cc7bf87t89f928ab2275950f@mail.gmail.com> Message-ID: <6717b0ac0911081430w3ba6e25ds217d648c40776d0f@mail.gmail.com> So I've been working on a script and came up with this by copy/pasting several examples found googling around. It works (to some extent). I tried to output each line from planet.py, but it only ouputs everything in the end. This results in a timeout error that I wanted to prevent. I also tried to kill the script if it takes too long but this hasn't been tested. I'm posting the script here if anyone is interested. If anyone can say why the ouput is not done line-by-line it would be great. Duarte #!/usr/bin/perl use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; $|=1; $CommandTimeoutDuration = 180; print header; print start_html('Run Planet'); print "
"; $command = "/path_to/venus/planet.py
/path_to/config.ini"; $command .= " 1>&1 2>&1"; $SIG{'ALRM'} =
\&CommandTimeout; alarm($CommandTimeoutDuration); open IN, "$command |" or
die "Could not execute \"$command\": $!\n"; while() { $_ =~
s/(\n|\r\n)$//; print "$_\n"; } close IN; print "
"; print end_html; #------------------------------------------------------------------------------ # This function is called when the timeout for a command expires. We need to # terminate the script immediately. This function is valid only on Unix. It is # never called when the script is running on NT. #------------------------------------------------------------------------------ sub CommandTimeout { alarm(0); print < Command exceeded maximum time of $CommandTimeoutDuration second(s).
Killed it! END exit; } On Sun, Nov 8, 2009 at 10:24 PM, Duarte Carreira wrote: > > > ---------- Forwarded message ---------- > From: Duarte Carreira > Date: Fri, Nov 6, 2009 at 1:02 PM > Subject: Re: trying to run planet.py via mod_python > To: Alex Schr?der > > > Alex, sorry about that. Don't know how but I managed to send my previous > email before I got to see your reply... gmail must have fooled me ;) > > I'm definitely going to try your script and post here the results But I'm > very optimistic! > > Thanks, > Duarte > > > > On Fri, Nov 6, 2009 at 11:04 AM, Alex Schr?der wrote: > >> On Fri, Nov 6, 2009 at 11:54, Duarte Carreira wrote: >> >>> I have mod_python working but cannot find a way to run planet.py... no >>> output or error is shown on the webpage... >>> If someone can send me an example script I'd appreciate it. >>> >> >> Hm, didn't I just send you an example script that worked for me? Note how >> my test.pl Perl script calls python.py. I don't think you need mod_python >> for this. I just use the Perl script to handle the CGI parts because it's >> what I'm most familiar with. >> >> Anyway, I actually installed and tested the setup I sent you, so I know it >> works. If it still fails, you need to start looking for error logs and the >> like. >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091108/ba2f454f/attachment.htm From dncarreira at gmail.com Mon Nov 9 21:31:48 2009 From: dncarreira at gmail.com (Duarte Carreira) Date: Mon, 9 Nov 2009 10:31:48 +0000 Subject: trying to run planet.py via mod_python Message-ID: <6717b0ac0911090231p7809a01etb6dbb4d12e521c8c@mail.gmail.com> Seems code was a bit garbled, so trying again. Duarte #!/usr/bin/perl use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; $|=1; $CommandTimeoutDuration = 180; print header; print start_html('Run Planet'); print "
";
 $command = "/path_to/venus/planet.py /path_to/config.ini";
 $command .= " 1>&1 2>&1";
 $SIG{'ALRM'} = \&CommandTimeout;
 alarm($CommandTimeoutDuration);
 open IN, "$command |" or
   die "Could not execute \"$command\": $!\n";
 while() {
   $_ =~s/(\n|\r\n)$//;
   print "$_\n";
 } close IN;
 print "
"; print end_html; #------------------------------------------------------------------------------ # This function is called when the timeout for a command expires. We need to # terminate the script immediately. This function is valid only on Unix. It is # never called when the script is running on NT. #------------------------------------------------------------------------------ sub CommandTimeout { alarm(0); print < Command exceeded maximum time of $CommandTimeoutDuration second(s).
Killed it! END exit; } On Mon, Nov 9, 2009 at 1:00 AM, wrote: > ------------------------------ > > Message: 2 > Date: Sun, 8 Nov 2009 22:30:27 +0000 > From: Duarte Carreira > Subject: Re: trying to run planet.py via mod_python > To: devel at lists.planetplanet.org > Message-ID: > <6717b0ac0911081430w3ba6e25ds217d648c40776d0f at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > So I've been working on a script and came up with this by copy/pasting > several examples found googling around. > It works (to some extent). I tried to output each line from planet.py, but > it only ouputs everything in the end. This results in a timeout error that > I > wanted to prevent. I also tried to kill the script if it takes too long but > this hasn't been tested. > > I'm posting the script here if anyone is interested. If anyone can say why > the ouput is not done line-by-line it would be great. > > Duarte > > #!/usr/bin/perl use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; > $|=1; $CommandTimeoutDuration = 180; print header; print start_html('Run > Planet'); print "
"; $command = "/path_to/venus/planet.py
> /path_to/config.ini"; $command .= " 1>&1 2>&1"; $SIG{'ALRM'} =
> \&CommandTimeout; alarm($CommandTimeoutDuration); open IN, "$command |" or
> die "Could not execute \"$command\": $!\n"; while() { $_ =~
> s/(\n|\r\n)$//; print "$_\n"; } close IN; print "
"; print end_html; > > #------------------------------------------------------------------------------ > # This function is called when the timeout for a command expires. We need > to > # terminate the script immediately. This function is valid only on Unix. It > is # never called when the script is running on NT. > > #------------------------------------------------------------------------------ > sub CommandTimeout { alarm(0); print < Command exceeded maximum > time of $CommandTimeoutDuration second(s).
Killed it! END exit; > } > > -------------- next part -------------- An HTML attachment was scrubbed... URL: /archives/devel/attachments/20091109/9c98d171/attachment.htm