forked from cmccabe/linkulator2
manually added asdf's improvement to the parse_ignore_file() function.
This commit is contained in:
parent
5222b135dc
commit
1b8bdc92a6
17
linkulator
17
linkulator
|
@ -5,6 +5,7 @@
|
|||
import glob
|
||||
import getpass
|
||||
import os
|
||||
from pathlib import Path
|
||||
import time
|
||||
import signal
|
||||
import sys
|
||||
|
@ -53,14 +54,18 @@ link_data = []
|
|||
categories = []
|
||||
ignore_names = []
|
||||
|
||||
|
||||
# READS THE CURRENT USER'S IGNORE FILE AND ADDS ANY ENTRIES TO THE GLOBAL VARIABLE
|
||||
# IGNORE NAMES.
|
||||
def parse_ignore_file():
|
||||
ignore_file = glob.glob('/home/' + username + '/.linkulator/ignore')[0]
|
||||
global ignore_names
|
||||
if ignore_file:
|
||||
with open(ignore_file) as f:
|
||||
for line in f:
|
||||
ignore_name = line.split(" ")[0]
|
||||
ignore_names.append(ignore_name)
|
||||
p = Path(Path.home(), '.linkulator/ignore')
|
||||
if p.exists():
|
||||
s = p.read_text()
|
||||
l = s.splitlines()
|
||||
for line in l:
|
||||
name = line.split(" ")[0]
|
||||
ignore_names.append(name)
|
||||
|
||||
|
||||
def build_menu():
|
||||
|
|
Loading…
Reference in New Issue