Skip to content

Commit

Permalink
Merge pull request #3 from xbnstudios/BUGFIX/missed-plugins
Browse files Browse the repository at this point in the history
I missed some plugins…
  • Loading branch information
s0ph0s-2 committed Jun 27, 2020
2 parents c72d9b7 + dd855f5 commit ea544f9
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 36 deletions.
4 changes: 2 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = "s0ph0s"

# The short X.Y version
version = "4.0"
version = "5.0"
# The full version, including alpha/beta/rc tags
release = "v5.0.0"
release = "v5.0.1"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gelo/plugins/AudacityLabels.gelo-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Module = AudacityLabels
[Documentation]
Description = Create an Audacity label file from the markers.
Author = s0ph0s
Version = 2.1.0
Version = 3.0.0
Website = https://github.com/s0ph0s-2/Gelo
10 changes: 5 additions & 5 deletions gelo/plugins/AudacityLabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, config, mediator: arch.IMediator, show: str):
self.collision_count = 0
self.filename = self.avoid_overwrite_filename()
self.log.info("Using %s as the data file path" % self.filename)
self.delayed = conf.as_bool(self.config["delayed"])
self.delayed = self.config["delayed"]
self.channel = self.mediator.subscribe(
[arch.MarkerType.TRACK], AudacityLabels.__name__, delayed=self.delayed
)
Expand Down Expand Up @@ -102,16 +102,16 @@ def validate_config(self):
errors = []
if "path" not in self.config.keys():
errors.append(
"[plugin:audacity_markers] is missing the required" ' key "path"'
'["plugin:AudacityLabels"] is missing the required key "path"'
)
else:
self.config["path"] = os.path.expandvars(self.config["path"])
if "delayed" not in self.config.keys():
self.config["delayed"] = "False"
self.config["delayed"] = False
else:
if not conf.is_bool(self.config["delayed"]):
if type(self.config["delayed"]) is not bool:
errors.append(
"[plugin:audacity_labels] has a non-boolean "
'["plugin:AudacityLabels"] has a non-boolean '
'value for the key "delayed"'
)
# Return errors, if any
Expand Down
2 changes: 1 addition & 1 deletion gelo/plugins/HttpPusher.gelo-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Module = HttpPusher
[Documentation]
Description = Connect to one or more HTTP(S) endpoints to send marker data
Author = s0ph0s
Version = 2.0.0
Version = 2.0.1
Website = https://github.com/s0ph0s-2/Gelo
2 changes: 1 addition & 1 deletion gelo/plugins/HttpPusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def validate_config(self):
errors = []

if "delayed" not in self.config.keys():
self.config["delayed"] = "False"
self.config["delayed"] = False
else:
if type(self.config["delayed"]) is not bool:
errors.append(
Expand Down
2 changes: 1 addition & 1 deletion gelo/plugins/IRC.gelo-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Module = IRC
[Documentation]
Description = Connect to an IRC server to send chapter marks.
Author = s0ph0s
Version = 3.0.0
Version = 3.0.1
Website = https://github.com/s0ph0s-2/Gelo
12 changes: 6 additions & 6 deletions gelo/plugins/IRC.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ def validate_config(self):
if "message" not in self.config.keys():
errors.append('[plugin:irc] is missing the required key "message"')
if "delayed" not in self.config.keys():
self.config["delayed"] = "True"
self.config["delayed"] = True
else:
if type(self.config["delayed"]) is not bool:
errors.append(
'[plugin:irc] has a non-boolean value for the key "delayed"'
)
if "repeat_with" in self.config.keys():
if type(self.config["repeat_with"]) is not list:
errors.append(
Expand All @@ -191,10 +196,5 @@ def validate_config(self):
'"repeat_with". Ensure every element has quotes.'
)
break
else:
if type(self.config["delayed"]) is not bool:
errors.append(
'[plugin:irc] has a non-boolean value for the key "delayed"'
)
if len(errors) > 0:
raise gelo.conf.InvalidConfigurationError(errors)
2 changes: 1 addition & 1 deletion gelo/plugins/NowPlayingFile.gelo-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Module = NowPlayingFile
[Documentation]
Description = Write a single-line text file with the marker name, for BUTT.
Author = s0ph0s
Version = 2.1.2
Version = 3.0.0
Website = https://github.com/s0ph0s-2/Gelo
8 changes: 4 additions & 4 deletions gelo/plugins/NowPlayingFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, config, med: arch.IMediator, show: str):
"""Create a new NowPlayingFile marker sink."""
super().__init__(config, med, show)
self.validate_config()
self.delayed = conf.as_bool(self.config["delayed"])
self.delayed = self.config["delayed"]
self.channel = self.mediator.subscribe(
[arch.MarkerType.TRACK], NowPlayingFile.__name__, delayed=self.delayed
)
Expand All @@ -39,16 +39,16 @@ def validate_config(self):
errors = []
if "path" not in self.config.keys():
errors.append(
"[plugin:now_playing_file] is missing the required" ' key "path"'
'["plugin:NowPlayingFile"] is missing the required key "path"'
)
else:
self.config["path"] = os.path.expandvars(self.config["path"])
if "delayed" not in self.config.keys():
self.config["delayed"] = "False"
else:
if not conf.is_bool(self.config["delayed"]):
if type(self.config["delayed"]) is not bool:
errors.append(
"[plugin:now_playing_file] has a non-boolean "
'["plugin:NowPlayingFile"] has a non-boolean '
'value for the key "delayed"'
)
# Return errors, if any
Expand Down
2 changes: 1 addition & 1 deletion gelo/plugins/Tweeter.gelo-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Module = Tweeter
[Documentation]
Description = Tweet the marker.
Author = s0ph0s
Version = 2.1.0
Version = 3.0.0
Website = https://github.com/s0ph0s-2/Gelo

22 changes: 10 additions & 12 deletions gelo/plugins/Tweeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, config, mediator: gelo.arch.IMediator, show: str):
self.log = logging.getLogger("gelo.plugins.Tweeter")
self.validate_config()
self.log.debug("Configuration valid")
self.delayed = gelo.conf.as_bool(self.config["delayed"])
self.delayed = self.config["delayed"]
self.channel = self.mediator.subscribe(
[gelo.arch.MarkerType.TRACK], Tweeter.__name__, delayed=self.delayed
)
Expand Down Expand Up @@ -75,36 +75,34 @@ def validate_config(self):
"""Ensure the configuration file is valid."""
errors = []
if "consumer_key" not in self.config.keys():
errors.append(
"[plugin:tweeter] is missing the required key" ' "consumer_key"'
)
errors.append('[plugin:tweeter] is missing the required key "consumer_key"')
if "consumer_secret" not in self.config.keys():
errors.append(
"[plugin:tweeter] is missing the required key" ' "consumer_secret"'
'["plugin:Tweeter"] is missing the required key "consumer_secret"'
)
if "access_token_key" not in self.config.keys():
errors.append(
"[plugin:tweeter] is missing the required key" ' "access_token_key"'
'["plugin:Tweeter"] is missing the required key "access_token_key"'
)
if "access_token_secret" not in self.config.keys():
errors.append(
"[plugin:tweeter] is missing the required key" ' "access_token_secret"'
'["plugin:Tweeter"] is missing the required key "access_token_secret"'
)
if "announce_string" not in self.config.keys():
errors.append(
"[plugin:tweeter] is missing the required key" ' "announce_string"'
'["plugin:Tweeter"] is missing the required key "announce_string"'
)
if "delayed" not in self.config.keys():
self.config["delayed"] = "True"
self.config["delayed"] = True
else:
if not gelo.conf.is_bool(self.config["delayed"]):
if type(self.config["delayed"]) is not bool:
errors.append(
"[plugin:tweeter] has a non-boolean value for " 'the key "delayed"'
'["plugin:Tweeter"] has a non-boolean value for the key "delayed"'
)
if len(errors) > 0:
raise gelo.conf.InvalidConfigurationError(errors)


def register():
"""Authorize this app to tweet from your account."""
print("I haven't written this yet. Check back in v1.3.")
print("I haven't written this yet. Check back in the future.")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="gelo",
version="5.0.0",
version="5.0.1",
description="podcast chapter metadata gathering tool for content creators",
url="https://github.com/s0ph0s-2/Gelo",
author="s0ph0s-2",
Expand Down

0 comments on commit ea544f9

Please sign in to comment.