summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2020-03-16 22:18:37 +0100
committerSolderpunk <solderpunk@sdf.org>2020-03-16 22:18:37 +0100
commita3e9eadc8f70b38fff8228920994d7929a80b5bd (patch)
treebfacc31b1f4629a7862b8c200a45d2f5a5ae01cb
parentaf6caf2369c6da40924e12207cd70a55e90d12ec (diff)
Include only world readable files.
-rw-r--r--gemfeed.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gemfeed.py b/gemfeed.py
index 0cbe6a4..c99f3a2 100644
--- a/gemfeed.py
+++ b/gemfeed.py
@@ -2,6 +2,7 @@ import argparse
import datetime
import glob
import os.path
+import os.stat
import urllib.parse
from feedgen.feed import FeedGenerator
@@ -13,7 +14,12 @@ def find_files():
index = "index.{}".format(extension)
if index in files:
files.remove(index)
- return files
+ world_readable = []
+ for filename in files:
+ st = os.stat(filename)
+ if st.st_mode & stat.S_IROTH:
+ world_readable.append(filename)
+ return world_readable
def populate_entry_from_file(filename, base_url, entry):
url = urljoin(base_url, filename)