Skip to content

Commit

Permalink
Remove hash comments from blacklist --autopull
Browse files Browse the repository at this point in the history
Automatically ignore all lines starting with a hash (treat as comments and ignore) in `blacklist_*.txt` and `bad_keywords.txt`
  • Loading branch information
iBug committed Jan 11, 2018
1 parent 6b2a67a commit 532935a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blacklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def exists(self, item):
class BasicListParser(BlacklistParser):
def parse(self):
with open(self._filename, 'r', encoding='utf-8') as f:
return [line.rstrip() for line in f if len(line.rstrip()) > 0]
return [line.rstrip() for line in f if len(line.rstrip()) > 0 and line[0] != '#']

def add(self, item: str):
with open(self._filename, 'a+', encoding='utf-8') as f:
Expand Down

0 comments on commit 532935a

Please sign in to comment.