Skip to content

Commit

Permalink
Merge pull request #277 from stscieisenhamer/versionwarn
Browse files Browse the repository at this point in the history
Change prd version printing to logging
  • Loading branch information
Witchblade101 authored Aug 4, 2022
2 parents 46f2999 + ef7e91f commit dadd359
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pysiaf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
"""

from __future__ import absolute_import, print_function, division
import logging
import re
import requests

# Configure logging
logger = logging.getLogger(__name__)

from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
Expand Down Expand Up @@ -34,9 +38,9 @@
is False][-1] # choose largest number from PRDs matching format: PRODOSSOC-###

if JWST_PRD_VERSION != newest_prd:
print("**WARNING**: LOCAL JWST PRD VERSION {} DOESN'T MATCH THE CURRENT ONLINE VERSION {}\nPlease "
"consider updating pysiaf, e.g. pip install --upgrade pysiaf or conda update pysiaf".format(
JWST_PRD_VERSION, newest_prd))
logger.warning("**WARNING**: LOCAL JWST PRD VERSION %s DOESN'T MATCH THE CURRENT ONLINE VERSION %s"
"\nPlease consider updating pysiaf, e.g. pip install --upgrade pysiaf or conda update pysiaf",
JWST_PRD_VERSION, newest_prd)
except:
print("**WARNING**: LOCAL JWST PRD VERSION {} CANNOT BE CHECKED AGAINST ONLINE VERSION".format(JWST_PRD_VERSION))
logger.warning("**WARNING**: LOCAL JWST PRD VERSION %s CANNOT BE CHECKED AGAINST ONLINE VERSION", JWST_PRD_VERSION)
pass

0 comments on commit dadd359

Please sign in to comment.