python package
This commit is contained in:
parent
c0dc240e44
commit
4ae27d2a00
5 changed files with 24 additions and 4 deletions
0
partybot/__init__.py
Normal file
0
partybot/__init__.py
Normal file
|
@ -10,11 +10,10 @@ import random
|
||||||
import re
|
import re
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# from database import db_session, init_db
|
|
||||||
from sqlalchemy import create_engine, and_
|
from sqlalchemy import create_engine, and_
|
||||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from models import Base, Karma, Optout, Queue, Preferences, MdnpRequests
|
from partybot.models import Base, Karma, Optout, Queue, Preferences, MdnpRequests
|
||||||
|
|
||||||
_startup = threading.Event()
|
_startup = threading.Event()
|
||||||
_shutdown = threading.Event()
|
_shutdown = threading.Event()
|
||||||
|
@ -353,8 +352,7 @@ def on_open(ws):
|
||||||
t = threading.Thread(target=run)
|
t = threading.Thread(target=run)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
a_parser = argparse.ArgumentParser()
|
a_parser = argparse.ArgumentParser()
|
||||||
a_parser.add_argument(
|
a_parser.add_argument(
|
||||||
|
@ -394,3 +392,7 @@ if __name__ == "__main__":
|
||||||
while r:
|
while r:
|
||||||
_error.clear()
|
_error.clear()
|
||||||
r = ws.run_forever()
|
r = ws.run_forever()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
18
setup.py
Normal file
18
setup.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='partybot',
|
||||||
|
py_modules=['models','pnutbot'],
|
||||||
|
install_requires=[
|
||||||
|
'PyYAML',
|
||||||
|
'pnutpy',
|
||||||
|
'requests',
|
||||||
|
'SQLAlchemy',
|
||||||
|
'websocket-client',
|
||||||
|
],
|
||||||
|
entry_points={
|
||||||
|
'console_scripts': [
|
||||||
|
'partybot = partybot.pnutbot:main'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
)
|
Loading…
Reference in a new issue