mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Added createsuperuser function, & execute it from configure. This
enables docker users to access the django administration site without requiring access to a cli
This commit is contained in:
17
pyShelf.py
17
pyShelf.py
@@ -17,28 +17,37 @@ sys.path.insert(0, PRG_PATH)
|
||||
tx = None
|
||||
|
||||
|
||||
async def runImport():
|
||||
async def RunImport():
|
||||
"""
|
||||
Begin live import of books
|
||||
"""
|
||||
execute_scan(PRG_PATH, config=config)
|
||||
MakeCollections(PRG_PATH, config=config)
|
||||
return "Import Complete"
|
||||
|
||||
|
||||
async def socketio(websocket, path):
|
||||
"""
|
||||
Web Socket Controller
|
||||
"""
|
||||
async for message in websocket:
|
||||
config.logger.info("Message Processing")
|
||||
if message == "ping":
|
||||
config.logger.info("<< Ping")
|
||||
tx = pong(message)
|
||||
tx = pong()
|
||||
elif message == "importBooks":
|
||||
config.logger.info("Starting Import")
|
||||
tx = "Starting Import . . ."
|
||||
await websocket.send(tx)
|
||||
await runImport()
|
||||
await RunImport()
|
||||
tx = "complete"
|
||||
await websocket.send(tx)
|
||||
|
||||
|
||||
def pong(message):
|
||||
def pong():
|
||||
"""
|
||||
Respond to incoming pings
|
||||
"""
|
||||
config.logger.info(">> Pong")
|
||||
return "pong"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user