1. catapela
  2. django-dynamic-link


django-dynamic-link / dynamicLink / __init__.py

catapela 178bdb7 
catapela 227a50d 
catapela 2bf84fc 

catapela 178bdb7 

catapela 227a50d 

catapela 2bf84fc 

import version
import os
import django
import sys

__version__ = VERSION = version.VERSION

    __doc__ = open(os.path.join(os.path.dirname(__file__), 'README_COPY')).read()
    __docformat__ = 'reStructuredText'
except IOError:
    __doc__ = 'For full documentation review the README file in your package or go to: http://pypi.python.org/pypi/django-dynamic-link/'
    __docformat__ = 'txt'

def CKINST():
    print('I try to find errors for you!')
    djv = django.VERSION
    greatest_dlv = version.RELEASE_DJANGO[0]
    smalest_dlv = version.RELEASE_DJANGO[0]

    # find greatest and smallest possible django version for dynamic link
    for dlv in version.RELEASE_DJANGO:
        if greatest_dlv < dlv:
            greatest_dlv = dlv
        if smalest_dlv > dlv:
            smalest_dlv = dlv

    # check dynaic link dependences
    if djv < smalest_dlv:
        print('Django %s is not supported. Please install a more recent django version.' % dlv)
    elif djv > greatest_dlv:
        print('This Version on dynamicLink (try: dynamicLink.VERSION) needs an older Django release (try: dynamicLink.RELEASE_DJANGO).')
    elif sys.version_info < version.PYTHON:
        print('dynamicLink depends on python %s or higher.' % version.PYTHON)
        print("No errors. All seems fine!")