Skip to content

Melodi Integration 0.0.1 - #16

Draft
fipsi7 wants to merge 4 commits into
autosub-team:autosub_develfrom
fipsi7:autosub_devel
Draft

Melodi Integration 0.0.1#16
fipsi7 wants to merge 4 commits into
autosub-team:autosub_develfrom
fipsi7:autosub_devel

Conversation

@fipsi7

@fipsi7 fipsi7 commented Oct 20, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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"

Comment thread src/autosub.py

try:
config.read_file(open(opts.configfile))
config.readfp(open(opts.configfile))

Copy link
Copy Markdown
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

Comment thread src/autosub.sh
if [ -z "$2" ]
then
python3 autosub.py &
python3 autosub.py &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uneeded extra whitespace

Comment thread src/autosub.sh
echo "Started autosub with process id $PID"
else
python3 autosub.py --config-file $2 &
python3 autosub.py --config-file $2 &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uneeded extra whitespace

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
Copy Markdown
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