Skip to content

Commit

Permalink
Bump version: 0.3.1 → 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Jun 21, 2014
1 parent a308415 commit 7c0c860
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 40 deletions.
12 changes: 12 additions & 0 deletions .bumpversion.cfg
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 0.4.0
commit = True
tag = True

[bumpversion:file:tabination/__init__.py]

[bumpversion:file:doc/source/conf.py]
serialize =
{major}.{minor}.{patch}
{major}.{minor}

28 changes: 28 additions & 0 deletions CHANGELOG.rst
@@ -0,0 +1,28 @@
Changelog
=========

*django-tabination* uses `Semantic Versioning`_ 2.0.0.

v0.4.0 (2014-06-21)

- [add] Python 3 compatibility

v0.3.1 (2013-08-07)

- [bug] Fixed bug #10 related to multilevel navigation

v0.3.0 (2013-02-28)

- [add] Sorting of tabs

v0.2.0 (2013-02-18)

- [add] Multilevel navigation

v0.1.1 (2012-05-04)

- [add] Added ``current_tab_id`` to context by default

v0.1.0 (2012-04-04)

- [add] Initial version
26 changes: 0 additions & 26 deletions README.rst
Expand Up @@ -41,32 +41,6 @@ Currently there is no further configuration needed. For more information about
setup and usage, please refer to `the docs`_.


Changelog
---------

*django-tabination* uses `Semantic Versioning`_ 2.0.0-rc.1.

v0.3.1 (2013-08-07)

- [bug] Fixed bug #10 related to multilevel navigation

v0.3.0 (2013-02-28)

- [add] Sorting of tabs

v0.2.0 (2013-02-18)

- [add] Multilevel navigation

v0.1.1 (2012-05-04)

- [add] Added ``current_tab_id`` to context by default

v0.1.0 (2012-04-04)

- [add] Initial version


Coding Guidelines
-----------------

Expand Down
6 changes: 3 additions & 3 deletions doc/source/conf.py
Expand Up @@ -43,16 +43,16 @@

# General information about the project.
project = u'django-tabination'
copyright = u'2012 - 2013 Danilo Bargen and contributors'
copyright = u'2012 - 2014 Danilo Bargen and contributors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.3'
version = '0.4.0'
# The full version, including alpha/beta/rc tags.
release = '0.3.0'
release = '0.4.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion tabination/__init__.py
@@ -1,3 +1,3 @@
__VERSION__ = '0.3.1'
__VERSION__ = '0.4.0'
__AUTHOR__ = 'Danilo Bargen'
__AUTHOR_EMAIL__ = 'gezuru@gmail.com'
31 changes: 21 additions & 10 deletions tabination/views.py
@@ -1,20 +1,25 @@
"""
.. moduleauthor:: Danilo Bargen <gezuru@gmail.com>
.. moduleauthor:: Danilo Bargen <mail@dbrgn.ch>
"""
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals

from django.core.exceptions import ImproperlyConfigured
from django.views.generic import TemplateView

from six import with_metaclass


class _TabTracker(type):
"""Metaclass that tracks all subclasses with an _is_tab attribute.
"""
Metaclass that tracks all subclasses with an _is_tab attribute.
All tracked classes are stored inside self._registry.
If multilevel navigation is used all relationships between a parent
and it's children are stored in the self._children dictionary.
"""
def __init__(cls, name, bases, attrs):
if hasattr(cls, '_is_tab'):
Expand All @@ -26,8 +31,9 @@ def __init__(cls, name, bases, attrs):


class TabView(with_metaclass(_TabTracker, TemplateView)):
"""This is a tab view that sets different tab properties and handles the
tab groups.
"""
This is a tab view that sets different tab properties and handles the tab
groups.
All attributes can be overridden with a Python property, e.g.::
Expand All @@ -41,7 +47,6 @@ def tab_visible(self):
``self._registry`` list.
"""

_registry = []
"""In here, references to all tabs are stored."""
_children = {}
Expand All @@ -64,8 +69,10 @@ def tab_visible(self):
"""Weight of the tab, used for sorting the tabs."""

def get_group_tabs(self):
"""Return instances of all other tabs that are members of the
tab's tab group."""
"""
Return instances of all other tabs that are members of the tab's
tab group.
"""
if self.tab_group is None:
raise ImproperlyConfigured(
"%s requires a definition of 'tab_group'" %
Expand All @@ -75,7 +82,8 @@ def get_group_tabs(self):

@property
def tab_visible(self):
"""Whether or not this tab is shown in the tab group. Or to be more exact,
"""
Whether or not this tab is shown in the tab group. Or to be more exact,
whether or not this tab is contained in ``{{ tabs }}``.
The default behavior is to set the tab as visible if it has a label.
Expand All @@ -84,7 +92,8 @@ def tab_visible(self):
return self.tab_label is not None

def _process_tabs(self, tabs, current_tab, group_current_tab):
"""Process and prepare tabs.
"""
Process and prepare tabs.
This includes steps like updating references to the current tab,
filtering out hidden tabs, sorting tabs etc...
Expand Down Expand Up @@ -116,7 +125,8 @@ def _process_tabs(self, tabs, current_tab, group_current_tab):
return tabs

def get_context_data(self, **kwargs):
"""Adds tab information to context.
"""
Adds tab information to context.
To retrieve a list of all group tab instances, use
``{{ tabs }}`` in your template.
Expand All @@ -130,6 +140,7 @@ def get_context_data(self, **kwargs):
If the current tab has children they are added to the template
context as ``child_tabs``.
"""
context = super(TabView, self).get_context_data(**kwargs)

Expand Down

0 comments on commit 7c0c860

Please sign in to comment.