From 7657171e7a51d12cdef4e944c91dc7f261e1d5f0 Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Wed, 24 Dec 2014 01:49:42 +0100 Subject: [PATCH] prepare 0.4.7; fix broken imports in CAPTCHA in ReCAPTCHA plugins; temporary left out the cloneable column from dashboard templates; add more readme files to example project sub packages; documentation updates; updated the licensing information about 3rd party packages --- CHANGELOG.rst | 8 ++ LICENSES.rst | 80 ++++++++++++++++++- examples/mezzanine_example/README.rst | 5 ++ examples/requirements.txt | 2 +- examples/simple/foo/README.rst | 9 +++ .../simple/override_simple_theme/README.rst | 4 + examples/simple/page/README.rst | 12 +++ .../settings_bootstrap3_theme_recaptcha.py | 4 +- examples/simple/templates/page/README.rst | 10 ++- setup.py | 2 +- src/fobi/__init__.py | 4 +- .../security/captcha/fobi_form_elements.py | 59 ++++++++------ .../security/recaptcha/README.rst | 6 ++ .../security/recaptcha/fobi_form_elements.py | 66 +++++++++------ .../templates/foundation5/dashboard.html | 4 +- .../simple/templates/simple/dashboard.html | 6 +- .../templates/fobi/generic/dashboard.html | 4 +- 17 files changed, 217 insertions(+), 68 deletions(-) create mode 100644 examples/mezzanine_example/README.rst create mode 100644 examples/simple/foo/README.rst create mode 100644 examples/simple/override_simple_theme/README.rst create mode 100644 examples/simple/page/README.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f37a00cc..e1175111 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,14 @@ are used for versioning (schema follows below): 0.3.4 to 0.4). - All backwards incompatible changes are mentioned in this document. +0.4.7 +------------------------------------- +2012-12-24 + +- Temporary left out the "cloneable" column from the dashboard templates. +- Fixed broken imports in CAPTCHA plugin. +- Fixed broken imports in ReCAPTCHA plugin. + 0.4.6 ------------------------------------- 2012-12-23 diff --git a/LICENSES.rst b/LICENSES.rst index f4d52334..d6e85182 100644 --- a/LICENSES.rst +++ b/LICENSES.rst @@ -3,6 +3,30 @@ Licenses ============================== Below information about third-party packages used in the project is presented. +Bootstrap3 +============================== +http://getbootstrap.com/ + +Licensing information: + +- Apache license 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + +django-autoslug +============================== +https://bitbucket.org/neithere/django-autoslug + +Licensing information: + +- LGPL 3 (https://www.gnu.org/licenses/lgpl.html) + +easy-thumbnails +============================== +https://github.com/SmileyChris/easy-thumbnails + +Licensing information: + +- BSD (http://opensource.org/licenses/BSD-3-Clause) + Font-awesome ============================== http://fontawesome.io/ @@ -13,13 +37,13 @@ Licensing information: - SIL OFL 1.1 (http://scripts.sil.org/OFL) - MIT (http://opensource.org/licenses/mit-license.html) -Bootstrap3 +Foundation 5 ============================== -http://getbootstrap.com/ +http://foundation.zurb.com/ Licensing information: -- Apache license 2.0 (http://www.apache.org/licenses/LICENSE-2.0) +- MIT (http://opensource.org/licenses/mit-license.html) jQuery Colorbox ============================== @@ -53,3 +77,53 @@ https://github.com/pmcelhaney/jQuery-Slugify-Plugin Licensing information: - BSD (https://github.com/pmcelhaney/jQuery-Slugify-Plugin/blob/master/LICENSE). + +ordereddict +============================== +https://pypi.python.org/pypi/ordereddict + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +Pillow +============================== +http://python-pillow.github.io/ + +Licensing information: + +- Python Imaging Library license (http://www.pythonware.com/products/pil/) + +Requests +============================== +https://python-requests.org + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +Six +============================== +https://bitbucket.org/gutworth/six/ + +Licensing information: + +- Apache 2.0 (http://opensource.org/licenses/Apache-2.0) + +Unidecode +============================== +https://pypi.python.org/pypi/Unidecode + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) + +vishap +============================== +https://pypi.python.org/pypi/vishap + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) +- LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html) + diff --git a/examples/mezzanine_example/README.rst b/examples/mezzanine_example/README.rst new file mode 100644 index 00000000..d8b4f4b1 --- /dev/null +++ b/examples/mezzanine_example/README.rst @@ -0,0 +1,5 @@ +===================================== +Example project for fobi.contrib.apps.mezzanine_integration +===================================== +Mezzanine integration example project for +``fobi.contrib.apps.mezzanine_integration``. diff --git a/examples/requirements.txt b/examples/requirements.txt index 5e555a2a..aa1e3ad8 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -31,7 +31,7 @@ tox #django-registration-redux>=1.1 #docutils==0.11 #ipdb==0.8 -#ipython==1.1.0 +#ipython==2.3.0 #ordereddict==1.1 # Selenium shall always be upgraded #selenium diff --git a/examples/simple/foo/README.rst b/examples/simple/foo/README.rst new file mode 100644 index 00000000..1fb3f1fe --- /dev/null +++ b/examples/simple/foo/README.rst @@ -0,0 +1,9 @@ +===================================== +Example app +===================================== +Gemeral purpose example app that: + +- Shows how to make a form callback. +- Contains a sample endpoint for testing the HTTP repost form handler plugin. +- Contains a management command for creating a test form data (to be used + in tests). diff --git a/examples/simple/override_simple_theme/README.rst b/examples/simple/override_simple_theme/README.rst new file mode 100644 index 00000000..55eb854e --- /dev/null +++ b/examples/simple/override_simple_theme/README.rst @@ -0,0 +1,4 @@ +===================================== +Example app +===================================== +Example app that shows how to override a theme. diff --git a/examples/simple/page/README.rst b/examples/simple/page/README.rst new file mode 100644 index 00000000..0cb00547 --- /dev/null +++ b/examples/simple/page/README.rst @@ -0,0 +1,12 @@ +============================================================== +FeinCMS Page package for fobi.contrib.apps.feincms_integration +============================================================== +FeinCMS Page package files. + +- admin +- migrations +- models +- static files + +Templates are located `here +`_. diff --git a/examples/simple/settings_bootstrap3_theme_recaptcha.py b/examples/simple/settings_bootstrap3_theme_recaptcha.py index f786cc66..377c7035 100644 --- a/examples/simple/settings_bootstrap3_theme_recaptcha.py +++ b/examples/simple/settings_bootstrap3_theme_recaptcha.py @@ -8,7 +8,7 @@ try: except Exception as e: pass -RECAPTCHA_PUBLIC_KEY = '' -RECAPTCHA_PRIVATE_KEY = '' +#RECAPTCHA_PUBLIC_KEY = '' +#RECAPTCHA_PRIVATE_KEY = '' RECAPTCHA_USE_SSL = True #FOBI_DEFAULT_THEME = 'simple' diff --git a/examples/simple/templates/page/README.rst b/examples/simple/templates/page/README.rst index 812b3ac8..fe414891 100644 --- a/examples/simple/templates/page/README.rst +++ b/examples/simple/templates/page/README.rst @@ -1,3 +1,7 @@ -============================ -FeinCMS page templates -============================ \ No newline at end of file +================================================================ +FeinCMS page templates for fobi.contrib.apps.feincms_integration +================================================================ +FeinCMS Page package templates. + +Models, admin part and static files are located `here +`_. diff --git a/setup.py b/setup.py index 4ea4d970..60643a70 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ for static_dir in static_dirs: for locale_dir in locale_dirs: locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)] -version = '0.4.6' +version = '0.4.7' install_requires = [ 'Pillow>=2.0.0', diff --git a/src/fobi/__init__.py b/src/fobi/__init__.py index f2745bca..8cacf827 100644 --- a/src/fobi/__init__.py +++ b/src/fobi/__init__.py @@ -1,6 +1,6 @@ __title__ = 'django-fobi' -__version__ = '0.4.6' -__build__ = 0x000015 +__version__ = '0.4.7' +__build__ = 0x000016 __author__ = 'Artur Barseghyan ' __copyright__ = 'Copyright (c) 2014 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' diff --git a/src/fobi/contrib/plugins/form_elements/security/captcha/fobi_form_elements.py b/src/fobi/contrib/plugins/form_elements/security/captcha/fobi_form_elements.py index 59664791..7f38c092 100644 --- a/src/fobi/contrib/plugins/form_elements/security/captcha/fobi_form_elements.py +++ b/src/fobi/contrib/plugins/form_elements/security/captcha/fobi_form_elements.py @@ -14,36 +14,49 @@ DJANGO_RECAPTCHA_INSTALLED = False DJANGO_SIMPLE_CAPTCHA_INSTALLED = False try: - import pip - installed_packages = pip.get_installed_distributions() - for installed_package in installed_packages: - if "django-recaptcha" == str(installed_package.key): - DJANGO_RECAPTCHA_INSTALLED = True + from captcha.fields import CaptchaField, CaptchaTextInput + DJANGO_SIMPLE_CAPTCHA_INSTALLED = True +except ImportError as e: + # Logging original exception + logger.error(e) + + # Trying to identify the problem + try: + import pip + installed_packages = pip.get_installed_distributions() + for installed_package in installed_packages: + if "django-recaptcha" == str(installed_package.key): + DJANGO_RECAPTCHA_INSTALLED = True + logger.error( + "You have installed the `django-recaptcha` in your " + "environment. At the moment you can't have both " + "`django-recaptcha` and `django-simple-captcha` installed " + "alongside due to app name collision (captcha). Remove " + "both packages using pip uninstall and reinstall the " + "`django-simple-captcha` if you want to make use of the " + "`fobi.contrib.plugins.form_elements.security.captcha` " + "package." + ) + if "django-simple-captcha" == str(installed_package.key): + DJANGO_SIMPLE_CAPTCHA_INSTALLED = True + + if DJANGO_SIMPLE_CAPTCHA_INSTALLED and not DJANGO_RECAPTCHA_INSTALLED: logger.error( - "You have installed the `django-recaptcha` in your " - "environment. At the moment you can't have both " - "`django-recaptcha` and `django-simple-captcha` installed " - "alongside due to app name collision (captcha). Remove " - "both packages using pip uninstall and reinstall the " + "You have installed the `django-simple-captcha` in your " + "environment, but imports seem to be broken. Remove " + "the package using pip uninstall and reinstall the " "`django-simple-captcha` if you want to make use of the " "`fobi.contrib.plugins.form_elements.security.captcha` " "package." ) - if "django-simple-captcha" == str(installed_package.key): - DJANGO_SIMPLE_CAPTCHA_INSTALLED = True -except ImportError: - try: - from captcha.fields import CaptchaField, CaptchaTextInput - DJANGO_SIMPLE_CAPTCHA_INSTALLED = True - except ImportError as e: - DJANGO_SIMPLE_CAPTCHA_INSTALLED = False + except ImportError: logger.error( - "{0}{1}".format(str(e), "; Likely you didn't yet install the" - "`django-simple-captcha` package. Note, that at " - "the moment you can't have both `django-recaptcha` " - "and `django-simple-captcha` installed alongside " - "due to app name collision (captcha).") + "Likely you didn't yet install the" + "`django-simple-captcha` package. Note, that at " + "the moment you can't have both `django-recaptcha` " + "and `django-simple-captcha` installed alongside " + "due to app name collision (captcha)." ) from fobi.base import FormElementPlugin, form_element_plugin_registry, get_theme diff --git a/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst b/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst index 6b857021..ee141bb1 100644 --- a/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst +++ b/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst @@ -58,6 +58,12 @@ packages. That limitation is likely to be solved in future in the ``django-recaptcha`` package. Until then, you should choose either one or another, but not both on the same time. +If you happen to see errors like "Input error: k: Format of site key was +invalid", make sure to have defined (and filled in properly) the +``RECAPTCHA_PUBLIC_KEY`` and ``RECAPTCHA_PRIVATE_KEY`` in your settnings.py. +See the `following `_ +thread for more information. + Usage =============================================== Note, that unlike most of the other form element plugins, default diff --git a/src/fobi/contrib/plugins/form_elements/security/recaptcha/fobi_form_elements.py b/src/fobi/contrib/plugins/form_elements/security/recaptcha/fobi_form_elements.py index 6448bc5b..21bc3390 100644 --- a/src/fobi/contrib/plugins/form_elements/security/recaptcha/fobi_form_elements.py +++ b/src/fobi/contrib/plugins/form_elements/security/recaptcha/fobi_form_elements.py @@ -14,38 +14,52 @@ DJANGO_RECAPTCHA_INSTALLED = False DJANGO_SIMPLE_CAPTCHA_INSTALLED = False try: - import pip - installed_packages = pip.get_installed_distributions() - for installed_package in installed_packages: - if "django-simple-captcha" == str(installed_package.key): - DJANGO_SIMPLE_CAPTCHA_INSTALLED = True + from captcha.fields import ReCaptchaField + from captcha.widgets import ReCaptcha as ReCaptchaWidget + DJANGO_RECAPTCHA_INSTALLED = True +except ImportError as e: + # Logging original exception + logger.error(e) + + # Trying to identify the problem + try: + import pip + installed_packages = pip.get_installed_distributions() + for installed_package in installed_packages: + if "django-simple-captcha" == str(installed_package.key): + DJANGO_SIMPLE_CAPTCHA_INSTALLED = True + logger.error( + "You have installed the `django-simple-captcha` in your " + "environment. At the moment you can't have both " + "`django-simple-captcha` and `django-recaptcha` installed " + "alongside due to app name collision (captcha). Remove " + "both packages using pip uninstall and reinstall the" + "`django-recaptcha` if you want to make use of the " + "`fobi.contrib.plugins.form_elements.security.recaptcha` " + "package." + ) + if "django-recaptcha" == str(installed_package.key): + DJANGO_RECAPTCHA_INSTALLED = True + + if DJANGO_RECAPTCHA_INSTALLED and not DJANGO_SIMPLE_CAPTCHA_INSTALLED: logger.error( - "You have installed the `django-simple-captcha` in your " - "environment. At the moment you can't have both " - "`django-simple-captcha` and `django-recaptcha` installed " - "alongside due to app name collision (captcha). Remove " - "both packages using pip uninstall and reinstall the" + "You have installed the `django-recaptcha` in your " + "environment, but imports seem to be broken. Remove " + "the package using pip uninstall and reinstall the " "`django-recaptcha` if you want to make use of the " "`fobi.contrib.plugins.form_elements.security.recaptcha` " "package." ) - if "django-recaptcha" == str(installed_package.key): - DJANGO_RECAPTCHA_INSTALLED = True -except ImportError: - try: - from captcha.fields import ReCaptchaField - from captcha.widgets import ReCaptcha as ReCaptchaWidget - DJANGO_RECAPTCHA_INSTALLED = True - except ImportError as e: - DJANGO_RECAPTCHA_INSTALLED = False - logger.error( - "{0}{1}".format(str(e), "; Likely you didn't yet install the" - "`django-simple-captcha` package. Note, that at " - "the moment you can't have both `django-recaptcha` " - "and `django-simple-captcha` installed alongside " - "due to app name collision (captcha).") - ) + except ImportError: + DJANGO_RECAPTCHA_INSTALLED = False + logger.error( + "; Likely you didn't yet install the" + "`django-simple-captcha` package. Note, that at " + "the moment you can't have both `django-recaptcha` " + "and `django-simple-captcha` installed alongside " + "due to app name collision (captcha)." + ) from fobi.base import FormElementPlugin, form_element_plugin_registry, get_theme from fobi.contrib.plugins.form_elements.security.recaptcha import UID diff --git a/src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html b/src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html index 674fd596..5097ecfa 100644 --- a/src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html +++ b/src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html @@ -28,7 +28,7 @@ {% trans "Form" %} {% trans "Is public" %} - {% trans "Is cloneable" %} + {#{% trans "Is cloneable" %}#} {% trans "Actions" %} @@ -37,7 +37,7 @@ {{ form_entry.name }} {{ form_entry.is_public }} - {{ form_entry.is_cloneable }} + {#{{ form_entry.is_cloneable }}#}
  • {% trans "Edit" %}
  • diff --git a/src/fobi/contrib/themes/simple/templates/simple/dashboard.html b/src/fobi/contrib/themes/simple/templates/simple/dashboard.html index 04284fe8..8ae4634b 100644 --- a/src/fobi/contrib/themes/simple/templates/simple/dashboard.html +++ b/src/fobi/contrib/themes/simple/templates/simple/dashboard.html @@ -49,12 +49,12 @@
    - + {% comment %}
    {% trans "Cloneable?" %}
    - + {% endcomment %}
    {% trans "Actions" %} @@ -68,7 +68,7 @@ {{ form_entry.name }} {{ form_entry.is_public }} - {{ form_entry.is_cloneable }} + {#{{ form_entry.is_cloneable }}#}
    • diff --git a/src/fobi/templates/fobi/generic/dashboard.html b/src/fobi/templates/fobi/generic/dashboard.html index 9317ccaa..739c9fde 100644 --- a/src/fobi/templates/fobi/generic/dashboard.html +++ b/src/fobi/templates/fobi/generic/dashboard.html @@ -29,7 +29,7 @@ {% trans "Form" %} {% trans "Is public" %} - {% trans "Is cloneable" %} + {#{% trans "Is cloneable" %}#} {% trans "Actions" %} @@ -38,7 +38,7 @@ {{ form_entry.name }} {{ form_entry.is_public }} - {{ form_entry.is_cloneable }} + {#{{ form_entry.is_cloneable }}#}