Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Use trailing docstring format for CF properties
  • Loading branch information
thobbs committed Aug 29, 2011
1 parent 3a7c748 commit 5661e4d
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions pycassa/columnfamily.py
Expand Up @@ -116,15 +116,14 @@ def _set_column_name_class(self, typestr):
def _get_column_name_class(self):
return self._column_name_class

column_name_class = property(_get_column_name_class,
_set_column_name_class,
doc = """ The data type of column names, which pycassa will use
to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``comparator_type``, but it may also be set manually if you want
autopacking behavior without setting a ``comparator_type``. Options
include anything in :mod:`~pycassa.system_manager`, such as "LongType". """)
column_name_class = property(_get_column_name_class, _set_column_name_class)
""" The data type of column names, which pycassa will use
to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``comparator_type``, but it may also be set manually if you want
autopacking behavior without setting a ``comparator_type``. Options
include anything in :mod:`~pycassa.system_manager`, such as "LongType". """

def _set_super_column_name_class(self, typestr):
self._super_column_name_class = marshal.extract_type_name(typestr)
Expand All @@ -135,9 +134,9 @@ def _get_super_column_name_class(self):
return self._super_column_name_class

super_column_name_class = property(_get_super_column_name_class,
_set_super_column_name_class,
doc = """ Like :attr:`column_name_class`, but for
super column names. """)
_set_super_column_name_class)
""" Like :attr:`column_name_class`, but for
super column names. """

def _set_default_validation_class(self, typestr):
self._default_validation_class = marshal.extract_type_name(typestr)
Expand All @@ -148,25 +147,24 @@ def _get_default_validation_class(self):
return self._default_validation_class

default_validation_class = property(_get_default_validation_class,
_set_default_validation_class,
doc = """ The default data type of column values, which pycassa
will use to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``default_validation_class``, but it may also be set manually if you want
autopacking behavior without setting a ``default_validation_class``. Options
include anything in :mod:`~pycassa.system_manager`, such as "LongType". """)
_set_default_validation_class)
""" The default data type of column values, which pycassa
will use to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``default_validation_class``, but it may also be set manually if you want
autopacking behavior without setting a ``default_validation_class``. Options
include anything in :mod:`~pycassa.system_manager`, such as "LongType". """

def _set_column_validators(self, other_dict):
self._column_validators = ColumnValidatorDict(other_dict)

def _get_column_validators(self):
return self._column_validators

column_validators = property(_get_column_validators,
_set_column_validators,
doc = """ Like :attr:`default_validation_class`, but is a
:class:`dict` mapping individual columns to types. """)
column_validators = property(_get_column_validators, _set_column_validators)
""" Like :attr:`default_validation_class`, but is a
:class:`dict` mapping individual columns to types. """

def _set_key_validation_class(self, typestr):
self._key_validation_class = marshal.extract_type_name(typestr)
Expand All @@ -177,16 +175,16 @@ def _get_key_validation_class(self):
return self._key_validation_class

key_validation_class = property(_get_key_validation_class,
_set_key_validation_class,
doc = """ The data type of row keys, which pycassa will use
to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``key_validation_class`` (which only exists in Cassandra 0.8 or greater),
but may be set manually if you want the autopacking behavior without
setting a ``key_validation_class`` or if you are using Cassandra 0.7.
Options include anything in :mod:`~pycassa.system_manager`, such as
"LongType".""")
_set_key_validation_class)
""" The data type of row keys, which pycassa will use
to determine how to pack and unpack them.
This is set automatically by inspecting the column family's
``key_validation_class`` (which only exists in Cassandra 0.8 or greater),
but may be set manually if you want the autopacking behavior without
setting a ``key_validation_class`` or if you are using Cassandra 0.7.
Options include anything in :mod:`~pycassa.system_manager`, such as
"LongType"."""

def __init__(self, pool, column_family, **kwargs):
"""
Expand Down

0 comments on commit 5661e4d

Please sign in to comment.