Changeset 6b396f


Ignore:
Timestamp:
12/21/2009 01:58:24 PM (15 years ago)
Author:
John Garland <johnnyg@gmail.com>
Children:
6a8e023
Parents:
b2990e
Message:

More relaxed definition of what a commented line is in a blocklist.
Decorate readranges with raiseError rather than parse to increase performance.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rb2990e r6b396f  
    1313        * Fix blocklist status icon not opening the blocklist preference
    1414          page in certain locales
     15        * Fix blocklist not recognising comments that begin with whitespace
     16        * Minor speedup in parsing blocklists
    1517
    1618=== Deluge 1.2.0_rc5 (17 December 2009) ===
  • deluge/plugins/blocklist/blocklist/readers.py

    rb2990e r6b396f  
    6161    def is_ignored(self, line):
    6262        """Ignore commented lines and blank lines"""
    63         return line.startswith('#') or not line.strip()
     63        line = line.strip()
     64        return line.startswith('#') or not line
    6465
    6566    def is_valid(self):
     
    8182        return valid
    8283
     84    @raiseError(ReaderParseError)
    8385    def readranges(self):
    8486        """Yields each ip range from the file"""
     
    9193class EmuleReader(BaseReader):
    9294    """Blocklist reader for emule style blocklists"""
    93     @raiseError(ReaderParseError)
    9495    def parse(self, line):
    9596        return line.strip().split(" , ")[0].split(" - ")
     
    9798class SafePeerReader(BaseReader):
    9899    """Blocklist reader for SafePeer style blocklists"""
    99     @raiseError(ReaderParseError)
    100100    def parse(self, line):
    101101        return line.strip().split(":")[-1].split("-")
Note: See TracChangeset for help on using the changeset viewer.