Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Error in __init__.py #13

Closed
SlamTheDragon opened this issue Apr 25, 2022 · 3 comments
Closed

Error in __init__.py #13

SlamTheDragon opened this issue Apr 25, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@SlamTheDragon
Copy link

The Problem

Using a java maven build for a bot designed specifically for a private server, I attempted to integrate this python aternos api using jython and somehow got an error within the library

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ":\directory\to\project\repository\COMPILED.jar\Lib\python_aternos\__init__.py", line 15
    def __init__(self, atconn:atconnect.AternosConnect) -> None:
                            ^
SyntaxError: mismatched input ':' expecting RPAREN

I couldn't find any more way to execute a py script inside a compiled jar file so I was left with this very last option and was greeted by this result

Any feedback are much appreciated, thanks!


Snippet of Java code:

try (PythonInterpreter pyInit = new PythonInterpreter()) {
   pyInit.exec("from python_aternos import Client");
   pyInit.exec("aternos = Client.from_credentials('*****','*****')");
   pyInit.exec("servs = aternos.list_servers()");
   pyInit.exec("myserv = servs[0]");
   pyInit.exec("myserv.start()");
   pyInit.exec("print('Server has been pinged to start')");
}
@DarkCat09
Copy link
Owner

I've never used Jython, but, considering the error message, I think it doesn't support the mypy syntax.
The module is created for the original Python interpreter and I can't guarantee the proper work of python-aternos in other Python implementations.

@DarkCat09 DarkCat09 added the wontfix This will not be worked on label Apr 25, 2022
@SlamTheDragon
Copy link
Author

Well that sounds unfortunate.. I'll try to get around with this then if there is another way of doing it, though thanks for the help!

@SlamTheDragon
Copy link
Author

Update:

The embedded aternos python library works with JEP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants