Skip to content
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

Bot folder name scheme #34

Open
wencke-lm opened this issue Dec 21, 2021 · 0 comments
Open

Bot folder name scheme #34

wencke-lm opened this issue Dec 21, 2021 · 0 comments

Comments

@wencke-lm
Copy link
Contributor

All bot docker images are named slurk/<name>-bot
All bot classes are named <Name>Bot
I like that those follow a pattern.
However, our folders are named either <name>bot or only <name>

If we intend to use a template for bots, it would be positioned in the parent directory of all bot scripts #33 . The only two ways, I know of, how to import from there, are to manually manipulate syspath:

ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.append(ROOT)

Or to execute the bot scripts as modules from the root directory and use absolute imports from there (as seen in #33):

python -m echo

I prefer the later, but at least on WSL (Windows 10, Ubuntu 20.04 LTS) + conda, the python interpreter chooses the standard library module math over a folder in the current working directory with the same name.
So the name math for the MathBot can't be used for this approach.

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

No branches or pull requests

1 participant