[PATCH] exclude-dir file format that accepts comments

Issue #4 resolved
Anonymous created an issue
def _load_from_file(self, filename):
    infile = open(filename)
    new_list = []
    for l in infile.readlines():
        l = l.partition('#')[0]
        l = l.strip()
        if len(l) > 0:
            new_list.append(l)

    return new_list

Comments (3)

  1. Anonymous

    Oops, all lines have been merged into one line. Here it goes again:

        def _load_from_file(self, filename):
            infile = open(filename)
            new_list = []
            for l in infile.readlines():
                l = l.partition('#')[0]
                l = l.strip()
                if len(l) > 0:
                    new_list.append(l)
                
            return new_list
    
  2. Log in to comment