bump version to 0.3rc1
This commit is contained in:
parent
cdd7a2569f
commit
85d13b9309
1 changed files with 15 additions and 4 deletions
19
discorss.py
19
discorss.py
|
|
@ -28,6 +28,7 @@ from types import SimpleNamespace
|
||||||
class Discorss:
|
class Discorss:
|
||||||
FEED_TIMEOUT_SECONDS = 15
|
FEED_TIMEOUT_SECONDS = 15
|
||||||
HASH_HISTORY_LIMIT = 10
|
HASH_HISTORY_LIMIT = 10
|
||||||
|
APP_VERSION = "0.3rc1"
|
||||||
|
|
||||||
def __init__(self, args=None):
|
def __init__(self, args=None):
|
||||||
if args is None:
|
if args is None:
|
||||||
|
|
@ -60,7 +61,11 @@ class Discorss:
|
||||||
response = await asyncio.to_thread(
|
response = await asyncio.to_thread(
|
||||||
requests.get,
|
requests.get,
|
||||||
hook["url"],
|
hook["url"],
|
||||||
headers={"user-agent": "DiscoRSS (https://git.frzn.dev/amr/discorss, 0.2)"},
|
headers={
|
||||||
|
"user-agent": "DiscoRSS (https://git.frzn.dev/amr/discorss, {})".format(
|
||||||
|
self.APP_VERSION
|
||||||
|
)
|
||||||
|
},
|
||||||
timeout=self.FEED_TIMEOUT_SECONDS,
|
timeout=self.FEED_TIMEOUT_SECONDS,
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
@ -274,11 +279,17 @@ class Discorss:
|
||||||
# Check for log and config files/paths, create empty directories if needed
|
# Check for log and config files/paths, create empty directories if needed
|
||||||
# TODO: change output to log file, as warning/error
|
# TODO: change output to log file, as warning/error
|
||||||
if not Path(self.log_dir).exists():
|
if not Path(self.log_dir).exists():
|
||||||
self.logger.warning("No log file path exists. Yark! We'll try and make %s...", self.log_dir)
|
self.logger.warning(
|
||||||
|
"No log file path exists. Yark! We'll try and make %s...", self.log_dir
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
Path(self.log_dir).mkdir(parents=True, exist_ok=True)
|
Path(self.log_dir).mkdir(parents=True, exist_ok=True)
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
self.logger.critical("The path {} already exists and is not a directory!".format(self.log_dir))
|
self.logger.critical(
|
||||||
|
"The path {} already exists and is not a directory!".format(
|
||||||
|
self.log_dir
|
||||||
|
)
|
||||||
|
)
|
||||||
if not Path(self.config_file_path).exists():
|
if not Path(self.config_file_path).exists():
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"No config file at {}! Snarf. We'll try and make {}...".format(
|
"No config file at {}! Snarf. We'll try and make {}...".format(
|
||||||
|
|
@ -302,7 +313,7 @@ class Discorss:
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
self.setup() # Handle the config and log paths
|
self.setup() # Handle the config and log paths
|
||||||
self.logger.info("Starting DiscoRSS run...")
|
self.logger.info("Starting DiscoRSS version {}...".format(self.APP_VERSION))
|
||||||
try:
|
try:
|
||||||
last_check = self.app_config["lastupdate"]
|
last_check = self.app_config["lastupdate"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue