This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 255
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 #62 from jammons/plugin_refactor
Refactor the Plugin architecture to make this work as a PyPi installable package
- Loading branch information
Showing
12 changed files
with
335 additions
and
154 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
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 @@ | ||
include LICENSE | ||
include CHANGELOG.md | ||
include README.md | ||
|
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,5 +1,4 @@ | ||
requests | ||
python-daemon | ||
pyyaml | ||
websocket-client | ||
slackclient |
Empty file.
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,36 @@ | ||
#!/usr/bin/env python | ||
from argparse import ArgumentParser | ||
import sys | ||
import os | ||
import yaml | ||
|
||
from rtmbot import RtmBot | ||
|
||
sys.path.append(os.getcwd()) | ||
|
||
|
||
def parse_args(): | ||
parser = ArgumentParser() | ||
parser.add_argument( | ||
'-c', | ||
'--config', | ||
help='Full path to config file.', | ||
metavar='path' | ||
) | ||
return parser.parse_args() | ||
|
||
|
||
def main(args=None): | ||
# load args with config path if not specified | ||
if not args: | ||
args = parse_args() | ||
|
||
config = yaml.load(open(args.config or 'rtmbot.conf', 'r')) | ||
bot = RtmBot(config) | ||
try: | ||
bot.start() | ||
except KeyboardInterrupt: | ||
sys.exit(0) | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.