-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from LanceMaverick/skb-dev
Skb dev
- Loading branch information
Showing
26 changed files
with
336 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ config.py | |
config.yml | ||
.#* | ||
*.db | ||
docker-compose.yml | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM python:3 | ||
|
||
# Use bash as the shell because we will need to source a virtualenv later | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Create a skybeard user | ||
RUN useradd -m skybeard | ||
USER skybeard | ||
WORKDIR /home/skybeard | ||
|
||
# Make a few directories which will be mounted to later | ||
RUN mkdir code db db_binary_entries skybeard_virtualenv | ||
|
||
# Create a base virtualenv. Normally, there's no need for a virtualenv in a | ||
# docker container, but since any beards that run can add to the requirements, | ||
# we'll need a virutalenv tied to a persistant container | ||
RUN python3 -m venv skybeard_virtualenv_frozen | ||
ADD requirements.txt . | ||
RUN . /home/skybeard/skybeard_virtualenv_frozen/bin/activate && pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
description: Enigma M3 Emulator plugin for Skybeard v2 | ||
git_url: https://github.com/artemis-beta/skb-enigmabeard.git | ||
name: enigmabeard | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
description: National Rail Enquiry plugin for Skybeard v2 | ||
git_url: https://github.com/artemis-beta/skb-natrailenq.git | ||
name: natrailenq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
description: 'Skybeard 2 plugin: Find answers to your questions using this Skybeard | ||
2 interface for W.I.L.L: https://github.com/ironman5366/W.I.L.L' | ||
git_url: https://github.com/LanceMaverick/skybeard_willbot.git | ||
name: willbeard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
dependencies: | ||
override: | ||
- pip install tox tox-pyenv | ||
- pyenv install 3.5.2 -s | ||
- pyenv install 3.6.0 -s | ||
- pyenv local 3.5.2 3.6.0 | ||
- pip3 install tox tox-pyenv nose | ||
- pip3 install -r requirements.txt | ||
|
||
test: | ||
override: | ||
- tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
beard_paths: | ||
- beards/ | ||
- beard_cache/ | ||
- examples/ | ||
- integration_test_beards/ | ||
|
||
beards: | ||
- askfor | ||
- database | ||
- debugonlyexample | ||
- config_helper | ||
# Integration test beards | ||
- different_name_inside | ||
- oldstyle_beard | ||
|
||
stache_paths: | ||
- moustaches | ||
|
||
staches: | ||
- postcats | ||
|
||
db_url: sqlite:///../db/skybeard-2.db | ||
db_bin_path: ../db_binary_entries/ | ||
|
||
admins: | ||
[ | ||
[Nathanael Farley, 89593615], | ||
] | ||
|
||
host: 0.0.0.0 | ||
port: 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import os | ||
|
||
from autoloaders import Git | ||
|
||
beard_paths = [ | ||
"beards/", | ||
"beard_cache/", | ||
"examples/", | ||
# Beards can come from anywhere! | ||
os.path.expanduser("~/git/"), | ||
# Even from git! | ||
#Git("https://github.com/nasfarley88/pdfpreviewbeard.git"), | ||
] | ||
|
||
# Beards can be specified as "all" which will attempt to load everything found | ||
# in beard_paths or can be specified as a list of strings of which beards to | ||
# load | ||
# beards = "all" | ||
beards = [ | ||
"askfor", | ||
"debugonlyexample", | ||
# "postcats", | ||
# "xkcdbeard", | ||
#"listbeard", | ||
#"relay_beard", | ||
# "repo_helper", | ||
#"except_on_purpose", | ||
# "teleplot", | ||
#"githubbeard", | ||
#"debugbeard", | ||
#"dicebeard", | ||
#"BabyFeederBeard", | ||
# "namedvotebeard", | ||
# "nth_home_beard", | ||
# "pdfpreviewbeard", # From git (above) | ||
] | ||
|
||
stache_paths = [ | ||
"moustaches", | ||
] | ||
|
||
# staches = "all" | ||
staches = [ | ||
"postcats", | ||
] | ||
|
||
db_url = "sqlite:///skybeard-2.db" | ||
db_bin_path = "./db_binary_entries" | ||
|
||
#put yourself, and anyone else you wish to, as an admin | ||
admins = [ | ||
("Nathanael Farley", 89593615) | ||
] | ||
|
||
#web server config | ||
host = '0.0.0.0' | ||
port = 8000 | ||
|
||
__doc__ = """This is sample documentation. Please update in your config.py! | ||
|
||
Current plugins enabled: {}""".format(beards) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
beard_paths: | ||
- beards/ | ||
- integration_test_beards/ | ||
|
||
beards: | ||
- debugbeard | ||
- different_name_inside | ||
- oldstyle_beard | ||
|
||
stache_paths: | ||
- moustaches | ||
|
||
staches: | ||
- postcats | ||
|
||
db_url: sqlite:///skybeard-2.db | ||
db_bin_path: ./db_binary_entries | ||
|
||
admins: | ||
[ | ||
] | ||
|
||
host: 0.0.0.0 | ||
port: 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
skybeard: | ||
build: . | ||
environment: | ||
- TG_BOT_TOKEN=YOUR_TOKEN_GOES_HERE | ||
- SKYBEARD_CONFIG=config.docker.yml.example | ||
command: ./code/run_on_docker.sh | ||
user: skybeard | ||
volumes: | ||
# This is where the code is hosted | ||
- .:/home/skybeard/code | ||
# These should be unique per bot. If they are not, database information | ||
# and python packages will be shared between bots. | ||
- skybeard_virtualenv:/home/skybeard/skybeard_virtualenv:z | ||
- skybeard_db:/home/skybeard/db:z | ||
- skybeard_db_binary_entries:/home/skybeard/db_binary_entries:z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This beard is designed to test having a different module name to folder name. |
20 changes: 20 additions & 0 deletions
20
...t_beards/different_name_inside/python/a_name_thats_different_from_the_outside/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from skybeard.beards import BeardChatHandler | ||
from skybeard.decorators import onerror | ||
|
||
|
||
class YetAnotherDifferentName(BeardChatHandler): | ||
|
||
__userhelp__ = """Default help message.""" | ||
|
||
__commands__ = [ | ||
# command, callback coro, help text | ||
("test_different_inside", 'test', 'Tests this beard.') | ||
] | ||
|
||
# __init__ is implicit | ||
|
||
@onerror() | ||
async def test(self, msg): | ||
await self.sender.sendMessage( | ||
"Test successful! {self} has been successfully imported and instantiated.".format( | ||
**locals())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from skybeard.utils import setup_beard | ||
|
||
setup_beard( | ||
"a_name_thats_different_from_the_outside", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from skybeard.beards import BeardChatHandler | ||
from skybeard.decorators import onerror | ||
|
||
|
||
class OldstyleBeard(BeardChatHandler): | ||
|
||
__userhelp__ = """Default help message.""" | ||
|
||
__commands__ = [ | ||
# command, callback coro, help text | ||
("test_oldstyle_beard", 'test', 'Tests this beard.') | ||
] | ||
|
||
# __init__ is implicit | ||
|
||
@onerror() | ||
async def test(self, msg): | ||
await self.sender.sendMessage( | ||
"Test successful! {self} has been successfully imported and instantiated.".format( | ||
**locals())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
aiohttp | ||
telepot>=10.4 | ||
pyconfig>=3.1.1 | ||
dataset>=0.7.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# If the virtualenv is not populated, copy it over. | ||
echo "Let's run skybeard!" | ||
if [[ "$(ls -A ~/skybeard_virtualenv)" ]]; | ||
then | ||
: | ||
else | ||
cp -r ~/skybeard_virtualenv_frozen/* ~/skybeard_virtualenv | ||
fi | ||
source ~/skybeard_virtualenv/bin/activate | ||
cd code | ||
python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.