You are not logged in.

#1 2009-03-11 20:33:30

Perre
Member
Registered: 2008-01-22
Posts: 189

[SOLVED] HellaNZB script for Conky broke after update

Hi!

I've been using the hellconk.py script (for conky) from the ubuntuforums for a while now and it's been great, but after updating some packages it seems to be broken. sad

When I start Conky it doesn't appear on my desktop at all and if I kill it I get the following traceback:

File "/home/per/.scripts/hellaconk.py", line 49, in <module>
    (options, args) = parser.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1380, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1424, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1531, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.6/optparse.py", line 774, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.6/optparse.py", line 794, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/home/per/.scripts/hellaconk.py", line 15, in NZB
    download = hellanzbServer.status()['currently_downloading']
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1235, in request
    self.send_content(h, request_body)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1349, in send_content
    connection.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 683, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 505, in create_connection
    sock.connect(sa)
  File "<string>", line 1, in connect

Here's the hellaconky script:

#!/usr/bin/python

# writen by Austin Trask
# contact austin@arcintel.com
# visit http://wiki.arcintel.com for more info

import xmlrpclib
import optparse

#change this next line to represent your hellanzb server info
SERVER = 'http://hellanzb:changeme@192.168.1.2:8080/'
hellanzbServer = xmlrpclib.ServerProxy(SERVER)

def NZB(option, opt, value, parser):
        download = hellanzbServer.status()['currently_downloading']
        if len(download) > 0:
                print download[0]['nzbName']
        else:
                print 'None'

def rate(option, opt, value, parser):
        rate = int(hellanzbServer.status()['rate'])
        print rate

def percentage(option, opt, value, parse):
        percent = hellanzbServer.status()['percent_complete']
        print percent


def ETA(option, opt, value, parse):
        eta = hellanzbServer.status()['eta']
        hours = (eta/3600)
        minutes = (eta/60)%60
        seconds = (eta%60)
        time_left = "%02d:%02d:%02d" % (hours, minutes, seconds)
        print time_left


parser = optparse.OptionParser()
parser.add_option("-n", "--nzb", action="callback", callback=NZB,
                  help="output current NZB")
parser.add_option("-r", "--rate", action="callback", callback=rate,
                  help="output hellanzb rate")
parser.add_option("-p", "--percent", action="callback", callback=percentage,
                  help="output completion percentage of current NZB")
parser.add_option("-e", "--eta", action="callback", callback=ETA,
                  help="displays the ETA of the current NZB")

(options, args) = parser.parse_args()

Here's the update that broke it:

[2009-03-11 19:58] starting full system upgrade
[2009-03-11 19:59] upgraded coreutils (6.12-1 -> 7.1-2)
[2009-03-11 19:59] The package is built using sysv ipc. If this causes segfaults
[2009-03-11 19:59] see included README file and rebuild the pkg --with-ipc=tcp
[2009-03-11 19:59] upgraded fakeroot (1.12.1-1 -> 1.12.2-2)
[2009-03-11 19:59] upgraded udev (135-1 -> 139-1)
[2009-03-11 19:59] upgraded initscripts (2009.01-1 -> 2009.03-1)
[2009-03-11 19:59] installed kernel26-firmware (2.6.28-1)
[2009-03-11 19:59] >>> Updating module dependencies. Please wait ...
[2009-03-11 19:59] >>> MKINITCPIO SETUP
[2009-03-11 19:59] >>> ----------------
[2009-03-11 19:59] >>> If you use LVM2, Encrypted root or software RAID,
[2009-03-11 19:59] >>> Ensure you enable support in /etc/mkinitcpio.conf .
[2009-03-11 19:59] >>> More information about mkinitcpio setup can be found here:
[2009-03-11 19:59] >>> http://wiki.archlinux.org/index.php/Mkinitcpio
[2009-03-11 19:59] 
[2009-03-11 19:59] >>> Generating initial ramdisk, using mkinitcpio.  Please wait...
[2009-03-11 19:59] ==> Building image "default"
[2009-03-11 19:59] ==> Running command: /sbin/mkinitcpio -k 2.6.28-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
[2009-03-11 19:59] :: Begin dry run
[2009-03-11 19:59] :: Parsing hook [base]
[2009-03-11 19:59] :: Parsing hook [udev]
[2009-03-11 19:59] :: Parsing hook [autodetect]
[2009-03-11 19:59] :: Parsing hook [sata]
[2009-03-11 19:59] :: Parsing hook [usb]
[2009-03-11 19:59] :: Parsing hook [usbinput]
[2009-03-11 19:59] :: Parsing hook [keymap]
[2009-03-11 19:59] :: Parsing hook [filesystems]
[2009-03-11 19:59] :: Generating module dependencies
[2009-03-11 19:59] :: Generating image '/boot/kernel26.img'...SUCCESS
[2009-03-11 19:59] ==> SUCCESS
[2009-03-11 19:59] ==> Building image "fallback"
[2009-03-11 19:59] ==> Running command: /sbin/mkinitcpio -k 2.6.28-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26-fallback.img -S autodetect
[2009-03-11 19:59] :: Begin dry run
[2009-03-11 19:59] :: Parsing hook [base]
[2009-03-11 19:59] :: Parsing hook [udev]
[2009-03-11 19:59] :: Parsing hook [sata]
[2009-03-11 19:59] :: Parsing hook [usb]
[2009-03-11 19:59] :: Parsing hook [usbinput]
[2009-03-11 19:59] :: Parsing hook [keymap]
[2009-03-11 19:59] :: Parsing hook [filesystems]
[2009-03-11 19:59] :: Generating module dependencies
[2009-03-11 19:59] :: Generating image '/boot/kernel26-fallback.img'...SUCCESS
[2009-03-11 19:59] ==> SUCCESS
[2009-03-11 19:59] upgraded kernel26 (2.6.28.7-1 -> 2.6.28.7-2)
[2009-03-11 19:59] upgraded klibc-udev (135-2 -> 139-1)
[2009-03-11 19:59] upgraded syslog-ng (2.1.3-2 -> 3.0.1-4)
[2009-03-11 20:01] synchronizing package lists
[2009-03-11 20:01] starting full system upgrade
[2009-03-11 21:01] synchronizing package lists
[2009-03-11 21:01] starting full system upgrade

What broke it? And how do I fix it? I love having the download status right there on my desktop so I need to get it fixed. hmm

Last edited by Perre (2009-03-12 19:00:04)

Offline

#2 2009-03-12 17:31:49

Perre
Member
Registered: 2008-01-22
Posts: 189

Re: [SOLVED] HellaNZB script for Conky broke after update

bump...

Edit: Finally figured it out. My router assigns IP adresses dynamically on each reboot. When my IP adress changed from 192.169.1.2 to 192.168.1.3 the hellaconk script got all confused. Ahh... roll

Last edited by Perre (2009-03-12 18:59:40)

Offline

Board footer

Powered by FluxBB