Commits

catapela committed 2847368

tested with django 1.4

  • Participants
  • Parent commits 2558c20

Comments (0)

Files changed (3)

 
 **Notes**
 
-    * Tested with Django 1.2 / 1.3
-    * Example project is included
+    * Tested with Django 1.2 / 1.3 / 1.4
+    * Example project is included (configured for Django 1.4)
 
 ========
 Features
         >>> import dynamicLink
         >>> dynamicLink.CKINST()
         >>> dynamicLink.VERSION
+        >>> dynamicLInk.REQUIRES
         >>> help(dynamicLink)
         >>> exit()
     

File dynamicLink/__init__.py

 import os
 import django
 import sys
+import django
 
 __version__ = VERSION = version.VERSION
 RELEASE_DJANGO = version.RELEASE_DJANGO
+REQUIRES = version.REQUIRES
 
 try:
     __doc__ = open(os.path.join(os.path.dirname(__file__), 'README_COPY')).read()
         if smalest_dlv > dlv:
             smalest_dlv = dlv
 
+    # Messages
+    part1 = 'Warning! "django-dynamic-link %s" (use: "dynamicLink.VERSION") is not ' \
+            'tested with "Django %s". May it runs with it may not! ' \
+            'With the installed django-dynamic-link is "Django %s" recommended. ' \
+            % str(version.VERSION), (str(django.VERSION), strform(greatest_dlv), strform(greatest_dlv))
+    part2 = 'Use "pip install django==%s.X". or downgrade django-dynamic-link. ' \
+            % strform(greatest_dlv)
+    part3 = 'Use "pip install django==%s.X" or try "pip install --upgrade django-dynamic-link". ' \
+            % strform(greatest_dlv)
+    part4 = 'To display all supported django versions in this release use "dynamicLink.RELEASE_DJANGO". ' \
+            'To display recommended django-dynamic-link versions dynamicLink.REQUIRES'
+
     # check dynaic link dependences
+    # Warnings
+    warning = True
     if djv < smalest_dlv:
-        print('Error! Django %s is not supported. With the installed version of dynamicLink is Django %s recommended. ' \
-        'Use "pip install django==%s.X". ' \
-        'To display all supported django versions use "dynamicLink.RELEASE_DJANGO".' \
-        % (str(django.VERSION), strform(greatest_dlv), strform(greatest_dlv) ))
+        print(part1)
+        print(part2)
+        print(part4)
     elif djv > greatest_dlv:
-        print('Error! This Version of dynamicLink (try: "dynamicLink.VERSION") needs an ' \
-        'older Django release (try: "dynamicLink.RELEASE_DJANGO"). ' \
-        'Use "pip install --upgrade django-dynamic-link" or use "pip install django==%s.X". '\
-        % strform(greatest_dlv))
-    elif sys.version_info[:2] < version.PYTHON_MIN:
+        print(part1)
+        print(part3)
+        print(part4)
+    else:
+        warning = False
+
+    # Errors
+    error = True
+    pyver =  sys.version_info[:2]
+    if pyver < version.PYTHON_MIN:
+        print('')
         print('Error! Wrong python version. dynamicLink depends on python %s or higher. ' \
         'With this python installation dynamicLink will not work properly!' \
         % strform(version.PYTHON_MIN))
     else:
-        print("No errors. All seems fine!")
+        error = False
 
+    # check the python version for the actual django installation
+    dja = django.VERSION[:2]
+    hint = True
+    if dja == (1,2) and not pyver >= (2,4):
+        print('')
+        print('Hint! Django %s requires Python 2.4 or greater.' % (dja,pyver))
+    elif dja == (1,3) and not pyver >= (2,4):
+        print('')
+        print('Hint! Django %s requires Python 2.4 or greater.' % (dja,pyver))
+    elif dja == (1,4) and not pyver >= (2,5):
+        print('')
+        print('Hint! Django %s requires Python 2.5 or greater.' % (dja,pyver))
+    else:
+        hint = False
+
+    # success message
+    if not error and not warning and not hint:
+        print("No errors or warnings. All seems fine!")

File dynamicLink/version.py

 import django
 import sys
 
-VERSION = (0,5,5,0)
-RELEASE_DJANGO = ((1,2),(1,3))
+VERSION = (0,5,6,0)
+RELEASE_DJANGO = ((1,2),(1,3),(1,4))
 PYTHON_MIN = (2,4)
+REQUIRES ="""
+django-dynamic-link 0.5.5 => Django 1.2, 1.3 :: Python >= 2.4 :: Example project: Django 1.3
+django-dynamic-link 0.6.x => Django 1.2, 1.3, 1.4(Python 2.5) :: Python >= 2.4 :: Example project: Django 1.4, Python 2.5
+
+(for an actual release visit http://pypi.python.org/pypi/django-dynamic-link/)
+"""
+
 APPLICATION_NAME = "Dynamic Link"
 VERSION_str = str(VERSION[:3]).strip('()').replace(',','.').replace(' ','')
 VERSION_INFO = """
 Modification date: 03.08.2011
 
 Hints:
-
-
+- 0.5.6     Example Project runs with Django 1.4
+- 0.5.5     dynamicLink.CKISNT() function added.
 - 0.5.4.1   Canges in setup.py - READM will now alsow be installed. Now if a package
             is installed than help(dynamicLink) outputs the README.
 - 0.5.4     Bugfix: Installation failed on Windows in spite of "/" on the end