mirror of
https://github.com/tildeclub/ttbp.git
synced 2026-06-27 05:59:25 +00:00
breaking out nopub into its own function
This commit is contained in:
22
bin/core.py
22
bin/core.py
@@ -79,15 +79,10 @@ def load_files():
|
||||
|
||||
global FILES
|
||||
|
||||
exclude = []
|
||||
|
||||
if os.path.isfile(NOPUB):
|
||||
for line in open(NOPUB, "r"):
|
||||
exclude.append(line.rstrip())
|
||||
|
||||
FILES = []
|
||||
|
||||
for filename in os.listdir(DATA):
|
||||
if filename in exclude:
|
||||
if nopub(filename):
|
||||
continue
|
||||
filename = os.path.join(DATA, filename)
|
||||
if os.path.isfile(filename) and valid(filename):
|
||||
@@ -395,6 +390,19 @@ def www_neighbors():
|
||||
|
||||
write_global_feed(sortedUsers)
|
||||
|
||||
def nopub(filename):
|
||||
'''
|
||||
checks to see if given filename is in user's NOPUB
|
||||
'''
|
||||
|
||||
exclude = []
|
||||
|
||||
if os.path.isfile(NOPUB):
|
||||
for line in open(NOPUB, "r"):
|
||||
exclude.append(line.rstrip())
|
||||
|
||||
return os.path.basename(filename) in exclude
|
||||
|
||||
#############
|
||||
#############
|
||||
#############
|
||||
|
||||
Reference in New Issue
Block a user