-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Files #37
base: master
Are you sure you want to change the base?
Updated Files #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not what was expected.
quranref/scripts/.env
Outdated
DB_NAME=quranref | ||
DB_USERNAME=kashif | ||
DB_PASSWORD=compulife | ||
DB_COLLECTION=ayas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required here as this is not a configuration setting. Wherever you create the DB, the collection names are still going to be the same.
quranref/scripts/cli.py
Outdated
import typer | ||
#from database_conn import * | ||
from pyramid.paster import get_appsettings, setup_logging | ||
from quranref.scripts.surah_info_import import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import specific functions, variables from the module, don't use import *
quranref/scripts/database_conn.py
Outdated
DB_NAME: str | ||
DB_USERNAME: str | ||
DB_PASSWORD: str | ||
DB_COLLECTION: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again collection name is not going to change so using a variable for that doesn't make sense.
quranref/scripts/database_conn.py
Outdated
db = client.db(settings.DB_NAME,username=settings.DB_USERNAME, password=settings.DB_PASSWORD) | ||
#db =conn.Connection(username=settings.DB_USERNAME, password=settings.DB_PASSWORD).databases[settings.DB_NAME] | ||
if not db.has_collection(settings.DB_COLLECTION): | ||
ayasCollection = db.create_collection(settings.DB_COLLECTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent indentation. Use 4 spaces, not 8 spaces or tabs.
quranref/scripts/cli.py
Outdated
|
||
@quranref_app.command("quranref_import_surah_info") | ||
def quranref_scripts_surah_info_import(val:str): | ||
surah_info_import("quranref_import_surah_info development.ini") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aim was to create typer commands and not just call the existing scripts inside of of typer commands.
No description provided.