-
Notifications
You must be signed in to change notification settings - Fork 0
Tried out black on the project. #18
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,19 +26,27 @@ | |
|
|
||
| #: The directory in which data for OCSP Dashboard is stored. Can be set from the environment variable | ||
| #: ``OCSPDASH_DIRECTORY`` or defaults to ``~/.ocspdash`` | ||
| OCSPDASH_DIRECTORY = os.environ.get('OCSPDASH_DIRECTORY', os.path.join(os.path.expanduser('~'), '.ocspdash')) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should save default OCSPdash location as a variable as well |
||
| OCSPDASH_DIRECTORY = os.environ.get( | ||
| 'OCSPDASH_DIRECTORY', os.path.join(os.path.expanduser('~'), '.ocspdash') | ||
| ) | ||
|
|
||
| if not os.path.exists(OCSPDASH_DIRECTORY): | ||
| os.makedirs(OCSPDASH_DIRECTORY) | ||
|
|
||
| OCSPDASH_DEFAULT_CONNECTION = 'sqlite:///' + os.path.join(OCSPDASH_DIRECTORY, 'ocspdash.db') | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like what it did here |
||
| OCSPDASH_DEFAULT_CONNECTION = 'sqlite:///' + os.path.join( | ||
| OCSPDASH_DIRECTORY, 'ocspdash.db' | ||
| ) | ||
| OCSPDASH_CONNECTION = os.environ.get('OCSPDASH_CONNECTION', OCSPDASH_DEFAULT_CONNECTION) | ||
|
|
||
| #: The rate limit for connecting to Censys. Can be set from the environmental variable ``OCSPDASH_RATE`` or defaults | ||
| # to ``0.2``. | ||
| CENSYS_RATE_LIMIT = float(os.environ.get('OCSPDASH_RATE', 0.2)) # max requests per second | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. too bad os.environ.get doesn't work like the one from flask.request.args.get |
||
| CENSYS_RATE_LIMIT = float( | ||
| os.environ.get('OCSPDASH_RATE', 0.2) | ||
| ) # max requests per second | ||
|
|
||
| OCSPDASH_USER_AGENT_IDENTIFIER = f'OCSPdash/{VERSION}' | ||
| OCSPDASH_USER_AGENT = ' '.join([requests.utils.default_user_agent(), OCSPDASH_USER_AGENT_IDENTIFIER]) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you write it with a join on a space |
||
| OCSPDASH_USER_AGENT = ' '.join( | ||
| [requests.utils.default_user_agent(), OCSPDASH_USER_AGENT_IDENTIFIER] | ||
| ) | ||
|
|
||
| OCSP_JWT_ALGORITHM = os.environ.get('OCSP_JWT_ALGORITHM', 'ES512') | ||
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 line is too long (and has too many inner calls) so you should change it to have more temporary variables