Package: reportbug
Version: 3.33
Followup-For: Bug #387924

I changed get_avail_database to take 'package' as an argument, and then changed 
the return line to the following:
    startofitem = 0
    splitted = []
    while(startofitem != 1):
        endofitem = avail.find('\n\n',startofitem)
        if(endofitem != -1):
            item = avail[startofitem:endofitem]
            item = item.decode('utf-8', 'replace')
            if item.find(package)!=-1:
                splitted.append(item)
        startofitem=endofitem+2
    return splitted

I'm not a python coder, so I'm sure this could be better written.
Also, I'm not familiar with the inner workings of reportbug, so I don't know if 
I'm introducing any problems.
But, look!  Only 30M (which is about the size of the file dumped by 'apt-cache 
dumpavail'
I'm also curious if there is a way in python to force the garbage collection of 
'avail' before returning from this function.

-- Package-specific info:
** Environment settings:
EDITOR="xemacs"
INTERFACE="text"

** /home/jashar/.reportbugrc:
reportbug_version "3.15"
mode expert
ui text
realname "Jayen Ashar"
email "[EMAIL PROTECTED]"

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (980, 'testing'), (930, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages reportbug depends on:
ii  python                        2.4.4-2    An interactive high-level object-o
ii  python-central                0.5.12     register and build utility for Pyt

reportbug recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to