manually added asdf's improvement to the parse_ignore_file() function.

This commit is contained in:
cmccabe 2019-11-19 03:42:00 +00:00
parent 5222b135dc
commit 1b8bdc92a6
1 changed files with 11 additions and 6 deletions

View File

@ -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():