create config_dir automatically
This commit is contained in:
parent
7bbafeedeb
commit
4dd422d07c
1 changed files with 2 additions and 0 deletions
2
issue_generator.py
Executable file → Normal file
2
issue_generator.py
Executable file → Normal file
|
@ -174,6 +174,8 @@ class FeedReader:
|
||||||
else: etag = None
|
else: etag = None
|
||||||
feed = feedparser.parse(self.url, etag=etag)
|
feed = feedparser.parse(self.url, etag=etag)
|
||||||
if feed.etag and feed.etag != etag:
|
if feed.etag and feed.etag != etag:
|
||||||
|
if not os.path.isdir(CONFIG_DIR):
|
||||||
|
os.mkdir(CONFIG_DIR)
|
||||||
with open(self.etag_file, mode='w', encoding="UTF-8") as file:
|
with open(self.etag_file, mode='w', encoding="UTF-8") as file:
|
||||||
file.write(feed.etag)
|
file.write(feed.etag)
|
||||||
if feed.status == 304:
|
if feed.status == 304:
|
||||||
|
|
Loading…
Reference in a new issue