Skip to content

Commit

Permalink
prepare 0.6.1; fixes in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Dec 20, 2015
1 parent 795418f commit d9b09bc
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 71 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.

0.6.1
-----
2015-12-21

- Documentation fixes.

0.6
---
2015-12-18
Expand Down
48 changes: 26 additions & 22 deletions docs/conf.distrib
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import os
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath('../examples'))

from nine.versions import DJANGO_LTE_1_7, DJANGO_GTE_1_8, DJANGO_GTE_1_7

if DJANGO_GTE_1_7:
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'simple.settings_docs')
django.setup()

try:
import fobi
version = fobi.__version__
Expand All @@ -31,18 +38,16 @@ except ImportError as err:
project = u'django-fobi'
copyright = u'2014, Artur Barseghyan <artur.barseghyan@gmail.com>'

from nine.versions import DJANGO_LTE_1_7, DJANGO_GTE_1_8

try:
from simple import settings as example_settings
from simple import settings_docs as docs_settings
except Exception as e:
PROJECT_DIR = lambda base : os.path.abspath(os.path.join(os.path.dirname(__file__), base).replace('\\','/'))
gettext = lambda s: s

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

class ExampleSettings(object):
class DocsSettings(object):
"""
"""
INSTALLED_APPS = (
Expand Down Expand Up @@ -75,7 +80,6 @@ except Exception as e:
# *****************************************************************
'fobi',


# *****************************************************************
# *****************************************************************
# ************************* Fobi form elements ********************
Expand Down Expand Up @@ -254,13 +258,13 @@ except Exception as e:
TEMPLATE_DEBUG = False
# END class ExampleSettings()

example_settings = ExampleSettings()
docs_settings = DocsSettings()

# -- Django configuration ------------------------------------------------------
from django.conf import settings

if not settings.configured:
INSTALLED_APPS = list(example_settings.INSTALLED_APPS)
INSTALLED_APPS = list(docs_settings.INSTALLED_APPS)

INSTALLED_APPS.append('mptt')
INSTALLED_APPS.append('cms')
Expand All @@ -274,29 +278,29 @@ if not settings.configured:
INSTALLED_APPS.remove('foo')

django_configuration = {
'DATABASES': example_settings.DATABASES,
'DATABASES': docs_settings.DATABASES,
'INSTALLED_APPS': INSTALLED_APPS,
'MEDIA_ROOT': example_settings.MEDIA_ROOT,
'MEDIA_URL': example_settings.MEDIA_URL,
'MIDDLEWARE_CLASSES': example_settings.MIDDLEWARE_CLASSES,
'ROOT_URLCONF': example_settings.ROOT_URLCONF,
'SECRET_KEY': example_settings.SECRET_KEY,
'SITE_ID': example_settings.SITE_ID,
'STATICFILES_DIRS': example_settings.STATICFILES_DIRS,
'STATICFILES_FINDERS': example_settings.STATICFILES_FINDERS,
'STATIC_URL': example_settings.STATIC_URL,
'STATIC_ROOT': example_settings.STATIC_ROOT,
'MEDIA_ROOT': docs_settings.MEDIA_ROOT,
'MEDIA_URL': docs_settings.MEDIA_URL,
'MIDDLEWARE_CLASSES': docs_settings.MIDDLEWARE_CLASSES,
'ROOT_URLCONF': docs_settings.ROOT_URLCONF,
'SECRET_KEY': docs_settings.SECRET_KEY,
'SITE_ID': docs_settings.SITE_ID,
'STATICFILES_DIRS': docs_settings.STATICFILES_DIRS,
'STATICFILES_FINDERS': docs_settings.STATICFILES_FINDERS,
'STATIC_URL': docs_settings.STATIC_URL,
'STATIC_ROOT': docs_settings.STATIC_ROOT,
}

if DJANGO_GTE_1_8:
django_configuration.update({
'TEMPLATES': example_settings.TEMPLATES
'TEMPLATES': docs_settings.TEMPLATES
})
else:
django_configuration.update({
'TEMPLATE_CONTEXT_PROCESSORS': example_settings.TEMPLATE_CONTEXT_PROCESSORS,
'TEMPLATE_DIRS': example_settings.TEMPLATE_DIRS,
'TEMPLATE_LOADERS': example_settings.TEMPLATE_LOADERS,
'TEMPLATE_CONTEXT_PROCESSORS': docs_settings.TEMPLATE_CONTEXT_PROCESSORS,
'TEMPLATE_DIRS': docs_settings.TEMPLATE_DIRS,
'TEMPLATE_LOADERS': docs_settings.TEMPLATE_LOADERS,
})

settings.configure(**django_configuration)
Expand Down
48 changes: 26 additions & 22 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath('../examples'))

from nine.versions import DJANGO_LTE_1_7, DJANGO_GTE_1_8, DJANGO_GTE_1_7

if DJANGO_GTE_1_7:
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'simple.settings_docs')
django.setup()

try:
import fobi
version = fobi.__version__
Expand All @@ -31,18 +38,16 @@
project = u'django-fobi'
copyright = u'2014, Artur Barseghyan <artur.barseghyan@gmail.com>'

from nine.versions import DJANGO_LTE_1_7, DJANGO_GTE_1_8

try:
from simple import settings as example_settings
from simple import settings_docs as docs_settings
except Exception as e:
PROJECT_DIR = lambda base : os.path.abspath(os.path.join(os.path.dirname(__file__), base).replace('\\','/'))
gettext = lambda s: s

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

class ExampleSettings(object):
class DocsSettings(object):
"""
"""
INSTALLED_APPS = (
Expand Down Expand Up @@ -75,7 +80,6 @@ class ExampleSettings(object):
# *****************************************************************
'fobi',


# *****************************************************************
# *****************************************************************
# ************************* Fobi form elements ********************
Expand Down Expand Up @@ -254,13 +258,13 @@ class ExampleSettings(object):
TEMPLATE_DEBUG = False
# END class ExampleSettings()

example_settings = ExampleSettings()
docs_settings = DocsSettings()

# -- Django configuration ------------------------------------------------------
from django.conf import settings

if not settings.configured:
INSTALLED_APPS = list(example_settings.INSTALLED_APPS)
INSTALLED_APPS = list(docs_settings.INSTALLED_APPS)

INSTALLED_APPS.append('mptt')
INSTALLED_APPS.append('cms')
Expand All @@ -274,29 +278,29 @@ class ExampleSettings(object):
INSTALLED_APPS.remove('foo')

django_configuration = {
'DATABASES': example_settings.DATABASES,
'DATABASES': docs_settings.DATABASES,
'INSTALLED_APPS': INSTALLED_APPS,
'MEDIA_ROOT': example_settings.MEDIA_ROOT,
'MEDIA_URL': example_settings.MEDIA_URL,
'MIDDLEWARE_CLASSES': example_settings.MIDDLEWARE_CLASSES,
'ROOT_URLCONF': example_settings.ROOT_URLCONF,
'SECRET_KEY': example_settings.SECRET_KEY,
'SITE_ID': example_settings.SITE_ID,
'STATICFILES_DIRS': example_settings.STATICFILES_DIRS,
'STATICFILES_FINDERS': example_settings.STATICFILES_FINDERS,
'STATIC_URL': example_settings.STATIC_URL,
'STATIC_ROOT': example_settings.STATIC_ROOT,
'MEDIA_ROOT': docs_settings.MEDIA_ROOT,
'MEDIA_URL': docs_settings.MEDIA_URL,
'MIDDLEWARE_CLASSES': docs_settings.MIDDLEWARE_CLASSES,
'ROOT_URLCONF': docs_settings.ROOT_URLCONF,
'SECRET_KEY': docs_settings.SECRET_KEY,
'SITE_ID': docs_settings.SITE_ID,
'STATICFILES_DIRS': docs_settings.STATICFILES_DIRS,
'STATICFILES_FINDERS': docs_settings.STATICFILES_FINDERS,
'STATIC_URL': docs_settings.STATIC_URL,
'STATIC_ROOT': docs_settings.STATIC_ROOT,
}

if DJANGO_GTE_1_8:
django_configuration.update({
'TEMPLATES': example_settings.TEMPLATES
'TEMPLATES': docs_settings.TEMPLATES
})
else:
django_configuration.update({
'TEMPLATE_CONTEXT_PROCESSORS': example_settings.TEMPLATE_CONTEXT_PROCESSORS,
'TEMPLATE_DIRS': example_settings.TEMPLATE_DIRS,
'TEMPLATE_LOADERS': example_settings.TEMPLATE_LOADERS,
'TEMPLATE_CONTEXT_PROCESSORS': docs_settings.TEMPLATE_CONTEXT_PROCESSORS,
'TEMPLATE_DIRS': docs_settings.TEMPLATE_DIRS,
'TEMPLATE_LOADERS': docs_settings.TEMPLATE_LOADERS,
})

settings.configure(**django_configuration)
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if "%1" == "clean" (


REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 2> nul
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok

Expand Down
6 changes: 6 additions & 0 deletions examples/simple/settings_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from settings import *

INSTALLED_APPS = list(INSTALLED_APPS)

if 'foo' in INSTALLED_APPS:
INSTALLED_APPS.remove('foo')
2 changes: 1 addition & 1 deletion examples/simple/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "example.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simple.settings")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
for locale_dir in locale_dirs:
locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)]

version = '0.6'
version = '0.6.1'

install_requires = [
'Pillow>=2.0.0',
Expand Down
4 changes: 2 additions & 2 deletions src/fobi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.6'
__build__ = 0x000049
__version__ = '0.6.1'
__build__ = 0x00004a
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
Expand Down

0 comments on commit d9b09bc

Please sign in to comment.