Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Updated Files #37

wants to merge 5 commits into from

Conversation

kashifpk
Copy link
Owner

No description provided.

Copy link
Owner Author

@kashifpk kashifpk left a 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.

DB_NAME=quranref
DB_USERNAME=kashif
DB_PASSWORD=compulife
DB_COLLECTION=ayas
Copy link
Owner Author

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.

import typer
#from database_conn import *
from pyramid.paster import get_appsettings, setup_logging
from quranref.scripts.surah_info_import import *
Copy link
Owner Author

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 *

DB_NAME: str
DB_USERNAME: str
DB_PASSWORD: str
DB_COLLECTION: str
Copy link
Owner Author

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.

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)
Copy link
Owner Author

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_app.command("quranref_import_surah_info")
def quranref_scripts_surah_info_import(val:str):
surah_info_import("quranref_import_surah_info development.ini")
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants