Skip to content

Melodi Integration 0.0.1 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: autosub_devel
Choose a base branch
from

Conversation

fipsi7
Copy link

@fipsi7 fipsi7 commented Oct 20, 2023

I added the Melodi API to the VELS plugin. It is still WIP, but should work.

@fipsi7 fipsi7 marked this pull request as draft October 20, 2023 08:26
MelodiPort = returnDict.get("PluginParameter").get(plugin_name).get("port")

api_con = api_vels_ob.Configuration()
api_con.host = "{}:{}/api".format(MelodiURL, MelodiPort)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative would be f-string, since Python 3.6:
api_con.host = f"{MelodiURL}:{MelodiPort}/api"

@@ -773,7 +773,7 @@ def check_init_ressources(config_file):
config = configparser.ConfigParser()

try:
config.read_file(open(opts.configfile))
config.readfp(open(opts.configfile))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readfp has been deprecated since Python 3.2 and was removed in Python 3.12 (October 2023). The function that shall be used is read_file

@@ -13,12 +13,12 @@ if [ $1 = "start" ]
then
if [ -z "$2" ]
then
python3 autosub.py &
python3 autosub.py &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uneeded extra whitespace

echo $! > autosub.pid
echo "No config file specified, using default.cfg!"
echo "Started autosub with process id $PID"
else
python3 autosub.py --config-file $2 &
python3 autosub.py --config-file $2 &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uneeded extra whitespace

@@ -98,7 +117,7 @@
###############
json_data = {
"Subject" : "Synthesis Result for Task{}".format(str(task_nr)),
"Message" : server +":" + str(port) + "/"+str(user_id),
"Message" : server + ":" + str(port) + "/" + str(user_id),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be done better with f-string

"{server}:{port}/{user_id}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants