This repository has been archived by the owner on Sep 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arpan Mahanty <[email protected]>
- Loading branch information
1 parent
069ec92
commit 181ad90
Showing
7 changed files
with
368 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2023 JukeBox Developers - All Rights Reserved | ||
# This file is part of the JukeBox Music App and is released under the "MIT License Agreement" | ||
# Please see the LICENSE file that should have been included as part of this package | ||
|
||
from jukebox.globals import logger | ||
|
||
if __name__ == '__main__': | ||
logger.warning('This is a warning') | ||
logger.error('This is an error') |
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,9 @@ | ||
# Copyright (c) 2023 JukeBox Developers - All Rights Reserved | ||
# This file is part of the JukeBox Music App and is released under the "MIT License Agreement" | ||
# Please see the LICENSE file that should have been included as part of this package | ||
|
||
from jukebox import utils | ||
|
||
logger = utils.build_logger('jukebox.main') | ||
|
||
ID_VERSION: str = '0.2.1' |
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,21 @@ | ||
# Copyright (c) 2023 JukeBox Developers - All Rights Reserved | ||
# This file is part of the JukeBox Music App and is released under the "MIT License Agreement" | ||
# Please see the LICENSE file that should have been included as part of this package | ||
|
||
from rocketry import Rocketry | ||
|
||
from jukebox import utils | ||
|
||
logger = utils.build_logger('jukebox.service') | ||
|
||
rocketry = Rocketry() | ||
|
||
|
||
@rocketry.task('every 1 seconds') | ||
def do_ping(): | ||
logger.info('Ping') | ||
|
||
|
||
if __name__ == '__main__': | ||
logger.info('Starting scheduler service') | ||
rocketry.run() |
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 @@ | ||
# Copyright (c) 2023 JukeBox Developers - All Rights Reserved | ||
# This file is part of the JukeBox Music App and is released under the "MIT License Agreement" | ||
# Please see the LICENSE file that should have been included as part of this package | ||
|
||
from fastapi import FastAPI | ||
|
||
from .globals import ID_VERSION | ||
|
||
app = FastAPI( | ||
title="JukeBox Music App", | ||
version=ID_VERSION, | ||
) |
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,40 @@ | ||
# Copyright (c) 2023 JukeBox Developers - All Rights Reserved | ||
# This file is part of the JukeBox Music App and is released under the "MIT License Agreement" | ||
# Please see the LICENSE file that should have been included as part of this package | ||
|
||
import logging | ||
import logging.config | ||
|
||
import yaml | ||
|
||
# ------------------------------------------------------------------------------------ | ||
# Logging Utilities | ||
# ------------------------------------------------------------------------------------ | ||
|
||
logging_config: dict = yaml.safe_load(""" | ||
version: 1 | ||
disable_existing_loggers: true | ||
formatters: | ||
standard: | ||
format: '%(asctime)s %(name)s [%(process)d] %(threadName)s: %(levelname)s - %(message)s' | ||
handlers: | ||
console: | ||
class: logging.StreamHandler | ||
formatter: standard | ||
stream: ext://sys.stdout | ||
loggers: | ||
jukebox: | ||
level: DEBUG | ||
handlers: [console] | ||
propagate: no | ||
""") | ||
logging.config.dictConfig(logging_config) | ||
|
||
|
||
def build_logger(name: str = None) -> logging.Logger: | ||
""" | ||
Return a logger with the specified name, creating it if necessary. | ||
If no name is specified, return the root logger. | ||
""" | ||
return logging.getLogger(name) |
Large diffs are not rendered by default.
Oops, something went wrong.
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,13 +1,17 @@ | ||
[tool.poetry] | ||
name = "jukebox" | ||
version = "1.0.0" | ||
version = "0.2.1" | ||
description = "An Open Source Music Streaming App." | ||
authors = ["JukeBox Developers <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
fastapi = "^0.95.1" | ||
rocketry = "^2.5.1" | ||
pyyaml = "^6.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core>=1.1.0"] | ||
|